Skip to content

Commit cbd08b7

Browse files
olsajiriacmel
authored andcommitted
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>
1 parent 1e9abf8 commit cbd08b7

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

‎tools/perf/command-list.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ perf-stat mainporcelain common
2626
perf-test mainporcelain common
2727
perf-timechart mainporcelain common
2828
perf-top mainporcelain common
29-
perf-trace mainporcelain common
29+
perf-trace mainporcelain audit

‎tools/perf/util/generate-cmdlist.sh‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,19 @@ do
3636
}' "Documentation/perf-$cmd.txt"
3737
done
3838
echo "#endif /* HAVE_LIBELF_SUPPORT */"
39+
40+
echo "#ifdef HAVE_LIBAUDIT_SUPPORT"
41+
sed -n -e 's/^perf-\([^ ]*\)[ ].* audit*/\1/p' command-list.txt |
42+
sort |
43+
while read cmd
44+
do
45+
sed -n '
46+
/^NAME/,/perf-'"$cmd"'/H
47+
${
48+
x
49+
s/.*perf-'"$cmd"' - \(.*\)/ {"'"$cmd"'", "\1"},/
50+
p
51+
}' "Documentation/perf-$cmd.txt"
52+
done
53+
echo "#endif /* HAVE_LIBELF_SUPPORT */"
3954
echo "};"

0 commit comments

Comments
 (0)