target.h 1007 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #ifndef _PERF_TARGET_H
  2. #define _PERF_TARGET_H
  3. #include <stdbool.h>
  4. #include <sys/types.h>
  5. struct perf_target {
  6. const char *pid;
  7. const char *tid;
  8. const char *cpu_list;
  9. const char *uid_str;
  10. uid_t uid;
  11. bool system_wide;
  12. };
  13. enum perf_target_errno {
  14. PERF_ERRNO_TARGET__SUCCESS = 0,
  15. /*
  16. * Choose an arbitrary negative big number not to clash with standard
  17. * errno since SUS requires the errno has distinct positive values.
  18. * See 'Issue 6' in the link below.
  19. *
  20. * http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/errno.h.html
  21. */
  22. __PERF_ERRNO_TARGET__START = -10000,
  23. /* for perf_target__validate() */
  24. PERF_ERRNO_TARGET__PID_OVERRIDE_CPU = __PERF_ERRNO_TARGET__START,
  25. PERF_ERRNO_TARGET__PID_OVERRIDE_UID,
  26. PERF_ERRNO_TARGET__UID_OVERRIDE_CPU,
  27. PERF_ERRNO_TARGET__PID_OVERRIDE_SYSTEM,
  28. PERF_ERRNO_TARGET__UID_OVERRIDE_SYSTEM,
  29. __PERF_ERRNO_TARGET__END,
  30. };
  31. enum perf_target_errno perf_target__validate(struct perf_target *target);
  32. #endif /* _PERF_TARGET_H */