tools lib fs debugfs: Introduce debugfs__strerror_open_tp
tip-bot for Arnaldo Carvalho de Melo
merge botCommit-ID: 2cc990ba3af4f9511f0d016c73b8163591f890e7 Gitweb: http://git.kernel.org/tip/2cc990ba3af4f9511f0d016c73b8163591f890e7 Author: Arnaldo Carvalho de Melo <[email protected]> AuthorDate: Thu, 22 Jan 2015 11:13:43 -0300 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Thu, 22 Jan 2015 17:02:20 -0300
tools lib fs debugfs: Introduce debugfs__strerror_open_tp
There will be other cases where not just a tracepoint event is being opened below the debugfs mountpoint, but it is rather common, so provide one helper for that.
Cc Adrian Hunter <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc David Ahern <[email protected]>
Cc Don Zickus <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Stephane Eranian <[email protected]>
Signed-off-by Arnaldo Carvalho de Melo <[email protected]>
--- tools/lib/api/fs/debugfs.c | 9 +++++++++ tools/lib/api/fs/debugfs.h | 1 + tools/perf/builtin-trace.c | 13 ++++++++----- 3 files changed, 18 insertions(+), 5 deletions(-)
tools/lib/api/fs/debugfs.c +9 -0
@@ -125,3 +125,12 @@ int debugfs__strerror_open(int err, char *buf, size_t size, const char *filenamereturn 0 ; } + +int debugfs__strerror_open_tp (int err,char *buf,size_t size,const char *sys,const char *name) +{ +char path[PATH_MAX ]; + +snprintf (path,PATH_MAX ,"tracing/events/%s/%s" , sys, name ?:"*" ); + +return debugfs__strerror_open (err, buf, size, path); +}
tools/lib/api/fs/debugfs.h +1 -0
@@ -27,5 +27,6 @@ char *debugfs_mount(const char *mountpoint);extern char debugfs_mountpoint[];int debugfs__strerror_open (int err,char *buf,size_t size,const char *filename); +int debugfs__strerror_open_tp (int err,char *buf,size_t size,const char *sys,const char *name);#endif /* __API_DEBUGFS_H__ */
tools/perf/builtin-trace.c +8 -5
@@ -2071,9 +2071,9 @@ static int trace__run(struct trace *trace, int argc, const char **argv) goto out_error_mem;if (trace->sched && -perf_evlist__add_newtp (evlist,"sched" ,"sched_stat_runtime" , - trace__sched_stat_runtime)) - goto out_error_tp; +perf_evlist__add_newtp (evlist,"sched" ,"sched_stat_runtime" , + trace__sched_stat_runtime)) + goto out_error_sched_stat_runtime; err =perf_evlist__create_maps (evlist, &trace->opts.target);if (err <0 ) {
@@ -2203,9 +2203,12 @@ out: {char errbuf[BUFSIZ ]; -out_error_tp: +out_error_sched_stat_runtime: +debugfs__strerror_open_tp (errno, errbuf,sizeof (errbuf),"sched" ,"sched_stat_runtime" ); + goto out_error; + out_error_raw_syscalls: -debugfs__strerror_open (errno, errbuf,sizeof (errbuf),"tracing/events/raw_syscalls" ); +debugfs__strerror_open_tp (errno, errbuf,sizeof (errbuf),"raw_syscalls" ,"sys_(enter|exit)" ); goto out_error; out_error_mmap: