tracepoint.h 835 B

1234567891011121314151617181920212223242526
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __PERF_TRACEPOINT_H
  3. #define __PERF_TRACEPOINT_H
  4. #include <dirent.h>
  5. #include <string.h>
  6. #include <stdbool.h>
  7. int tp_event_has_id(const char *dir_path, struct dirent *evt_dir);
  8. #define for_each_event(dir_path, evt_dir, evt_dirent) \
  9. while ((evt_dirent = readdir(evt_dir)) != NULL) \
  10. if (evt_dirent->d_type == DT_DIR && \
  11. (strcmp(evt_dirent->d_name, ".")) && \
  12. (strcmp(evt_dirent->d_name, "..")) && \
  13. (!tp_event_has_id(dir_path, evt_dirent)))
  14. #define for_each_subsystem(sys_dir, sys_dirent) \
  15. while ((sys_dirent = readdir(sys_dir)) != NULL) \
  16. if (sys_dirent->d_type == DT_DIR && \
  17. (strcmp(sys_dirent->d_name, ".")) && \
  18. (strcmp(sys_dirent->d_name, "..")))
  19. bool is_valid_tracepoint(const char *event_string);
  20. #endif /* __PERF_TRACEPOINT_H */