summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/generate-cmdlist.sh
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2016-01-07 10:14:04 +0100
committerArnaldo Carvalho de Melo <acme@redhat.com>2016-01-08 16:46:17 +0100
commitcbd08b7335c9d559f424dcef7bea333605597490 (patch)
tree84f0e37fd70a9de25446fb330cd310ebf9b77c30 /tools/perf/util/generate-cmdlist.sh
parentperf report: Change default to use event group view (diff)
downloadlinux-cbd08b7335c9d559f424dcef7bea333605597490.tar.xz
linux-cbd08b7335c9d559f424dcef7bea333605597490.zip
perf tools: Do not show trace command if it's not compiled in
The trace command still appears in help message when you run simple 'perf' command. It's because the generate-cmdlist.sh does not care about the HAVE_LIBAUDIT_SUPPORT dependency of trace command and puts it into generated common_cmds array. Wrapping trace command under HAVE_LIBAUDIT_SUPPORT dependency, which will exclude it from common_cmds array if HAVE_LIBAUDIT_SUPPORT is not set. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Noel Grandin <noelgrandin@gmail.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1452158050-28061-8-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/generate-cmdlist.sh')
-rwxr-xr-xtools/perf/util/generate-cmdlist.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/perf/util/generate-cmdlist.sh b/tools/perf/util/generate-cmdlist.sh
index 36a885d2cd22..0ac2037c970c 100755
--- a/tools/perf/util/generate-cmdlist.sh
+++ b/tools/perf/util/generate-cmdlist.sh
@@ -36,4 +36,19 @@ do
}' "Documentation/perf-$cmd.txt"
done
echo "#endif /* HAVE_LIBELF_SUPPORT */"
+
+echo "#ifdef HAVE_LIBAUDIT_SUPPORT"
+sed -n -e 's/^perf-\([^ ]*\)[ ].* audit*/\1/p' command-list.txt |
+sort |
+while read cmd
+do
+ sed -n '
+ /^NAME/,/perf-'"$cmd"'/H
+ ${
+ x
+ s/.*perf-'"$cmd"' - \(.*\)/ {"'"$cmd"'", "\1"},/
+ p
+ }' "Documentation/perf-$cmd.txt"
+done
+echo "#endif /* HAVE_LIBELF_SUPPORT */"
echo "};"