1 /* SPDX-License-Identifier: GPL-2.0 */ 1 /* SPDX-License-Identifier: GPL-2.0 */ 2 #ifndef __PERF_TRACEPOINT_H 2 #ifndef __PERF_TRACEPOINT_H 3 #define __PERF_TRACEPOINT_H 3 #define __PERF_TRACEPOINT_H 4 4 5 #include <dirent.h> 5 #include <dirent.h> 6 #include <string.h> 6 #include <string.h> 7 #include <stdbool.h> << 8 7 9 int tp_event_has_id(const char *dir_path, stru 8 int tp_event_has_id(const char *dir_path, struct dirent *evt_dir); 10 9 11 #define for_each_event(dir_path, evt_dir, evt_ 10 #define for_each_event(dir_path, evt_dir, evt_dirent) \ 12 while ((evt_dirent = readdir(evt_dir)) 11 while ((evt_dirent = readdir(evt_dir)) != NULL) \ 13 if (evt_dirent->d_type == DT_D 12 if (evt_dirent->d_type == DT_DIR && \ 14 (strcmp(evt_dirent->d_name 13 (strcmp(evt_dirent->d_name, ".")) && \ 15 (strcmp(evt_dirent->d_name 14 (strcmp(evt_dirent->d_name, "..")) && \ 16 (!tp_event_has_id(dir_path 15 (!tp_event_has_id(dir_path, evt_dirent))) 17 16 18 #define for_each_subsystem(sys_dir, sys_dirent 17 #define for_each_subsystem(sys_dir, sys_dirent) \ 19 while ((sys_dirent = readdir(sys_dir)) 18 while ((sys_dirent = readdir(sys_dir)) != NULL) \ 20 if (sys_dirent->d_type == DT_D 19 if (sys_dirent->d_type == DT_DIR && \ 21 (strcmp(sys_dirent->d_name 20 (strcmp(sys_dirent->d_name, ".")) && \ 22 (strcmp(sys_dirent->d_name 21 (strcmp(sys_dirent->d_name, ".."))) 23 22 24 bool is_valid_tracepoint(const char *event_str !! 23 int is_valid_tracepoint(const char *event_string); 25 24 26 #endif /* __PERF_TRACEPOINT_H */ 25 #endif /* __PERF_TRACEPOINT_H */ 27 26
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.