perf target: Shorten perf_target__ to target__
Getting unwieldly long, for this app domain should be descriptive enough and the use of __ to separate the class from the method names should help with avoiding clashes with other code bases. Reported-by: David Ahern <dsahern@gmail.com> Suggested-by: Ingo Molnar <mingo@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/20131112113427.GA4053@ghostprotocols.net Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
#include <stdbool.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
struct perf_target {
|
||||
struct target {
|
||||
const char *pid;
|
||||
const char *tid;
|
||||
const char *cpu_list;
|
||||
@@ -14,8 +14,8 @@ struct perf_target {
|
||||
bool uses_mmap;
|
||||
};
|
||||
|
||||
enum perf_target_errno {
|
||||
PERF_ERRNO_TARGET__SUCCESS = 0,
|
||||
enum target_errno {
|
||||
TARGET_ERRNO__SUCCESS = 0,
|
||||
|
||||
/*
|
||||
* Choose an arbitrary negative big number not to clash with standard
|
||||
@@ -24,42 +24,40 @@ enum perf_target_errno {
|
||||
*
|
||||
* http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/errno.h.html
|
||||
*/
|
||||
__PERF_ERRNO_TARGET__START = -10000,
|
||||
__TARGET_ERRNO__START = -10000,
|
||||
|
||||
/* for target__validate() */
|
||||
TARGET_ERRNO__PID_OVERRIDE_CPU = __TARGET_ERRNO__START,
|
||||
TARGET_ERRNO__PID_OVERRIDE_UID,
|
||||
TARGET_ERRNO__UID_OVERRIDE_CPU,
|
||||
TARGET_ERRNO__PID_OVERRIDE_SYSTEM,
|
||||
TARGET_ERRNO__UID_OVERRIDE_SYSTEM,
|
||||
|
||||
/* for perf_target__validate() */
|
||||
PERF_ERRNO_TARGET__PID_OVERRIDE_CPU = __PERF_ERRNO_TARGET__START,
|
||||
PERF_ERRNO_TARGET__PID_OVERRIDE_UID,
|
||||
PERF_ERRNO_TARGET__UID_OVERRIDE_CPU,
|
||||
PERF_ERRNO_TARGET__PID_OVERRIDE_SYSTEM,
|
||||
PERF_ERRNO_TARGET__UID_OVERRIDE_SYSTEM,
|
||||
/* for target__parse_uid() */
|
||||
TARGET_ERRNO__INVALID_UID,
|
||||
TARGET_ERRNO__USER_NOT_FOUND,
|
||||
|
||||
/* for perf_target__parse_uid() */
|
||||
PERF_ERRNO_TARGET__INVALID_UID,
|
||||
PERF_ERRNO_TARGET__USER_NOT_FOUND,
|
||||
|
||||
__PERF_ERRNO_TARGET__END,
|
||||
__TARGET_ERRNO__END,
|
||||
};
|
||||
|
||||
enum perf_target_errno perf_target__validate(struct perf_target *target);
|
||||
enum perf_target_errno perf_target__parse_uid(struct perf_target *target);
|
||||
enum target_errno target__validate(struct target *target);
|
||||
enum target_errno target__parse_uid(struct target *target);
|
||||
|
||||
int perf_target__strerror(struct perf_target *target, int errnum, char *buf,
|
||||
size_t buflen);
|
||||
int target__strerror(struct target *target, int errnum, char *buf, size_t buflen);
|
||||
|
||||
static inline bool perf_target__has_task(struct perf_target *target)
|
||||
static inline bool target__has_task(struct target *target)
|
||||
{
|
||||
return target->tid || target->pid || target->uid_str;
|
||||
}
|
||||
|
||||
static inline bool perf_target__has_cpu(struct perf_target *target)
|
||||
static inline bool target__has_cpu(struct target *target)
|
||||
{
|
||||
return target->system_wide || target->cpu_list;
|
||||
}
|
||||
|
||||
static inline bool perf_target__none(struct perf_target *target)
|
||||
static inline bool target__none(struct target *target)
|
||||
{
|
||||
return !perf_target__has_task(target) && !perf_target__has_cpu(target);
|
||||
return !target__has_task(target) && !target__has_cpu(target);
|
||||
}
|
||||
|
||||
#endif /* _PERF_TARGET_H */
|
||||
|
||||
Reference in New Issue
Block a user