|
@@ -25,8 +25,6 @@ enum event_result {
|
|
|
EVT_HANDLED_ALL
|
|
|
};
|
|
|
|
|
|
-char debugfs_path[MAXPATHLEN];
|
|
|
-
|
|
|
#define CHW(x) .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_##x
|
|
|
#define CSW(x) .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_##x
|
|
|
|
|
@@ -140,7 +138,7 @@ static int tp_event_has_id(struct dirent *sys_dir, struct dirent *evt_dir)
|
|
|
char evt_path[MAXPATHLEN];
|
|
|
int fd;
|
|
|
|
|
|
- snprintf(evt_path, MAXPATHLEN, "%s/%s/%s/id", debugfs_path,
|
|
|
+ snprintf(evt_path, MAXPATHLEN, "%s/%s/%s/id", tracing_events_path,
|
|
|
sys_dir->d_name, evt_dir->d_name);
|
|
|
fd = open(evt_path, O_RDONLY);
|
|
|
if (fd < 0)
|
|
@@ -171,16 +169,16 @@ struct tracepoint_path *tracepoint_id_to_path(u64 config)
|
|
|
char evt_path[MAXPATHLEN];
|
|
|
char dir_path[MAXPATHLEN];
|
|
|
|
|
|
- if (debugfs_valid_mountpoint(debugfs_path))
|
|
|
+ if (debugfs_valid_mountpoint(tracing_events_path))
|
|
|
return NULL;
|
|
|
|
|
|
- sys_dir = opendir(debugfs_path);
|
|
|
+ sys_dir = opendir(tracing_events_path);
|
|
|
if (!sys_dir)
|
|
|
return NULL;
|
|
|
|
|
|
for_each_subsystem(sys_dir, sys_dirent, sys_next) {
|
|
|
|
|
|
- snprintf(dir_path, MAXPATHLEN, "%s/%s", debugfs_path,
|
|
|
+ snprintf(dir_path, MAXPATHLEN, "%s/%s", tracing_events_path,
|
|
|
sys_dirent.d_name);
|
|
|
evt_dir = opendir(dir_path);
|
|
|
if (!evt_dir)
|
|
@@ -447,7 +445,7 @@ parse_single_tracepoint_event(char *sys_name,
|
|
|
u64 id;
|
|
|
int fd;
|
|
|
|
|
|
- snprintf(evt_path, MAXPATHLEN, "%s/%s/%s/id", debugfs_path,
|
|
|
+ snprintf(evt_path, MAXPATHLEN, "%s/%s/%s/id", tracing_events_path,
|
|
|
sys_name, evt_name);
|
|
|
|
|
|
fd = open(evt_path, O_RDONLY);
|
|
@@ -485,7 +483,7 @@ parse_multiple_tracepoint_event(struct perf_evlist *evlist, char *sys_name,
|
|
|
struct dirent *evt_ent;
|
|
|
DIR *evt_dir;
|
|
|
|
|
|
- snprintf(evt_path, MAXPATHLEN, "%s/%s", debugfs_path, sys_name);
|
|
|
+ snprintf(evt_path, MAXPATHLEN, "%s/%s", tracing_events_path, sys_name);
|
|
|
evt_dir = opendir(evt_path);
|
|
|
|
|
|
if (!evt_dir) {
|
|
@@ -528,7 +526,7 @@ parse_tracepoint_event(struct perf_evlist *evlist, const char **strp,
|
|
|
char sys_name[MAX_EVENT_LENGTH];
|
|
|
unsigned int sys_length, evt_length;
|
|
|
|
|
|
- if (debugfs_valid_mountpoint(debugfs_path))
|
|
|
+ if (debugfs_valid_mountpoint(tracing_events_path))
|
|
|
return 0;
|
|
|
|
|
|
evt_name = strchr(*strp, ':');
|
|
@@ -920,10 +918,10 @@ void print_tracepoint_events(const char *subsys_glob, const char *event_glob)
|
|
|
char evt_path[MAXPATHLEN];
|
|
|
char dir_path[MAXPATHLEN];
|
|
|
|
|
|
- if (debugfs_valid_mountpoint(debugfs_path))
|
|
|
+ if (debugfs_valid_mountpoint(tracing_events_path))
|
|
|
return;
|
|
|
|
|
|
- sys_dir = opendir(debugfs_path);
|
|
|
+ sys_dir = opendir(tracing_events_path);
|
|
|
if (!sys_dir)
|
|
|
return;
|
|
|
|
|
@@ -932,7 +930,7 @@ void print_tracepoint_events(const char *subsys_glob, const char *event_glob)
|
|
|
!strglobmatch(sys_dirent.d_name, subsys_glob))
|
|
|
continue;
|
|
|
|
|
|
- snprintf(dir_path, MAXPATHLEN, "%s/%s", debugfs_path,
|
|
|
+ snprintf(dir_path, MAXPATHLEN, "%s/%s", tracing_events_path,
|
|
|
sys_dirent.d_name);
|
|
|
evt_dir = opendir(dir_path);
|
|
|
if (!evt_dir)
|
|
@@ -964,16 +962,16 @@ int is_valid_tracepoint(const char *event_string)
|
|
|
char evt_path[MAXPATHLEN];
|
|
|
char dir_path[MAXPATHLEN];
|
|
|
|
|
|
- if (debugfs_valid_mountpoint(debugfs_path))
|
|
|
+ if (debugfs_valid_mountpoint(tracing_events_path))
|
|
|
return 0;
|
|
|
|
|
|
- sys_dir = opendir(debugfs_path);
|
|
|
+ sys_dir = opendir(tracing_events_path);
|
|
|
if (!sys_dir)
|
|
|
return 0;
|
|
|
|
|
|
for_each_subsystem(sys_dir, sys_dirent, sys_next) {
|
|
|
|
|
|
- snprintf(dir_path, MAXPATHLEN, "%s/%s", debugfs_path,
|
|
|
+ snprintf(dir_path, MAXPATHLEN, "%s/%s", tracing_events_path,
|
|
|
sys_dirent.d_name);
|
|
|
evt_dir = opendir(dir_path);
|
|
|
if (!evt_dir)
|