* [tip:perf/core] perf trace: Warn the user when not available
@ 2014-06-05 14:30 tip-bot for Arnaldo Carvalho de Melo
0 siblings, 0 replies; only message in thread
From: tip-bot for Arnaldo Carvalho de Melo @ 2014-06-05 14:30 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, eranian, paulus, acme, hpa, mingo, jolsa, peterz,
efault, namhyung, fweisbec, adrian.hunter, dsahern, tglx, dzickus
Commit-ID: 1b5726220fe16ac38eb2db43e7bc82e69f449fca
Gitweb: http://git.kernel.org/tip/1b5726220fe16ac38eb2db43e7bc82e69f449fca
Author: Arnaldo Carvalho de Melo <acme@redhat.com>
AuthorDate: Mon, 26 May 2014 16:02:29 -0300
Committer: Jiri Olsa <jolsa@kernel.org>
CommitDate: Tue, 3 Jun 2014 21:34:00 +0200
perf trace: Warn the user when not available
When the audit-libs devel package is not found at build time we disable
the 'trace' command, as we are not able to map syscall numbers to
strings, but then the message the user is presented is cryptic:
[root@zoo linux]# trace ls
perf: 'ls' is not a perf-command. See 'perf --help'.
Fix it by presenting a more helpful message:
[root@zoo linux]# trace l
trace command not available: missing audit-libs devel package at build time.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-uxeunqetd0sgxyibusapen9a@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
tools/perf/perf.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/tools/perf/perf.c b/tools/perf/perf.c
index 431798a..78f7b92 100644
--- a/tools/perf/perf.c
+++ b/tools/perf/perf.c
@@ -481,14 +481,18 @@ int main(int argc, const char **argv)
fprintf(stderr, "cannot handle %s internally", cmd);
goto out;
}
-#ifdef HAVE_LIBAUDIT_SUPPORT
if (!prefixcmp(cmd, "trace")) {
+#ifdef HAVE_LIBAUDIT_SUPPORT
set_buildid_dir();
setup_path();
argv[0] = "trace";
return cmd_trace(argc, argv, NULL);
- }
+#else
+ fprintf(stderr,
+ "trace command not available: missing audit-libs devel package at build time.\n");
+ goto out;
#endif
+ }
/* Look for flags.. */
argv++;
argc--;
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2014-06-05 14:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-05 14:30 [tip:perf/core] perf trace: Warn the user when not available tip-bot for Arnaldo Carvalho de Melo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox