summaryrefslogtreecommitdiff
path: root/tools/perf/util/target.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/target.h')
-rw-r--r--tools/perf/util/target.h45
1 files changed, 23 insertions, 22 deletions
diff --git a/tools/perf/util/target.h b/tools/perf/util/target.h
index 2d0c506..a4be857 100644
--- a/tools/perf/util/target.h
+++ b/tools/perf/util/target.h
@@ -4,7 +4,7 @@
#include <stdbool.h>
#include <sys/types.h>
-struct target {
+struct perf_target {
const char *pid;
const char *tid;
const char *cpu_list;
@@ -12,11 +12,10 @@ struct target {
uid_t uid;
bool system_wide;
bool uses_mmap;
- bool force_per_cpu;
};
-enum target_errno {
- TARGET_ERRNO__SUCCESS = 0,
+enum perf_target_errno {
+ PERF_ERRNO_TARGET__SUCCESS = 0,
/*
* Choose an arbitrary negative big number not to clash with standard
@@ -25,40 +24,42 @@ enum target_errno {
*
* http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/errno.h.html
*/
- __TARGET_ERRNO__START = -10000,
+ __PERF_ERRNO_TARGET__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 target__parse_uid() */
- TARGET_ERRNO__INVALID_UID,
- TARGET_ERRNO__USER_NOT_FOUND,
+ /* 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,
- __TARGET_ERRNO__END,
+ /* for perf_target__parse_uid() */
+ PERF_ERRNO_TARGET__INVALID_UID,
+ PERF_ERRNO_TARGET__USER_NOT_FOUND,
+
+ __PERF_ERRNO_TARGET__END,
};
-enum target_errno target__validate(struct target *target);
-enum target_errno target__parse_uid(struct target *target);
+enum perf_target_errno perf_target__validate(struct perf_target *target);
+enum perf_target_errno perf_target__parse_uid(struct perf_target *target);
-int target__strerror(struct target *target, int errnum, char *buf, size_t buflen);
+int perf_target__strerror(struct perf_target *target, int errnum, char *buf,
+ size_t buflen);
-static inline bool target__has_task(struct target *target)
+static inline bool perf_target__has_task(struct perf_target *target)
{
return target->tid || target->pid || target->uid_str;
}
-static inline bool target__has_cpu(struct target *target)
+static inline bool perf_target__has_cpu(struct perf_target *target)
{
return target->system_wide || target->cpu_list;
}
-static inline bool target__none(struct target *target)
+static inline bool perf_target__none(struct perf_target *target)
{
- return !target__has_task(target) && !target__has_cpu(target);
+ return !perf_target__has_task(target) && !perf_target__has_cpu(target);
}
#endif /* _PERF_TARGET_H */