0001
0002 #ifndef __PERF_TRACEPOINT_H
0003 #define __PERF_TRACEPOINT_H
0004
0005 #include <dirent.h>
0006 #include <string.h>
0007
0008 int tp_event_has_id(const char *dir_path, struct dirent *evt_dir);
0009
0010 #define for_each_event(dir_path, evt_dir, evt_dirent) \
0011 while ((evt_dirent = readdir(evt_dir)) != NULL) \
0012 if (evt_dirent->d_type == DT_DIR && \
0013 (strcmp(evt_dirent->d_name, ".")) && \
0014 (strcmp(evt_dirent->d_name, "..")) && \
0015 (!tp_event_has_id(dir_path, evt_dirent)))
0016
0017 #define for_each_subsystem(sys_dir, sys_dirent) \
0018 while ((sys_dirent = readdir(sys_dir)) != NULL) \
0019 if (sys_dirent->d_type == DT_DIR && \
0020 (strcmp(sys_dirent->d_name, ".")) && \
0021 (strcmp(sys_dirent->d_name, "..")))
0022
0023 int is_valid_tracepoint(const char *event_string);
0024
0025 #endif