From e2726d99645c5fa1fd9abd6353270fde624696f8 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Thu, 22 Jan 2015 10:34:22 -0300 Subject: tools lib fs: Adopt debugfs open strerrno method As this is not specific to an evlist and may be used with other tools. Cc: Adrian Hunter Cc: Borislav Petkov Cc: David Ahern Cc: Don Zickus Cc: Frederic Weisbecker Cc: Jiri Olsa Cc: Namhyung Kim Cc: Stephane Eranian Link: http://lkml.kernel.org/n/tip-a9up9mivx1pzdf5tqrqsx62d@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo tools/perf/util/include/asm/hash.h --- tools/perf/builtin-trace.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'tools/perf/builtin-trace.c') diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index 258f6550c736..2f82dd78b086 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -2062,8 +2062,15 @@ static int trace__run(struct trace *trace, int argc, const char **argv) perf_evlist__add_vfs_getname(evlist); if ((trace->trace_pgfaults & TRACE_PFMAJ) && - perf_evlist__add_pgfault(evlist, PERF_COUNT_SW_PAGE_FAULTS_MAJ)) + perf_evlist__add_pgfault(evlist, PERF_COUNT_SW_PAGE_FAULTS_MAJ)) { + /* + * FIXME: This one needs better error handling, as by now we + * already checked that debugfs is mounted and that we have access to it, + * so probably the case is that something is busted wrt this specific + * software event, ditto for the next gotos to out_error_tp... + */ goto out_error_tp; + } if ((trace->trace_pgfaults & TRACE_PFMIN) && perf_evlist__add_pgfault(evlist, PERF_COUNT_SW_PAGE_FAULTS_MIN)) @@ -2203,7 +2210,7 @@ out: char errbuf[BUFSIZ]; out_error_tp: - perf_evlist__strerror_tp(evlist, errno, errbuf, sizeof(errbuf)); + debugfs__strerror_open(errno, errbuf, sizeof(errbuf)); goto out_error; out_error_mmap: -- cgit v1.2.3