path: root/tools/perf
diff options
authorYunlong Song <>2015-03-18 21:35:51 +0800
committerArnaldo Carvalho de Melo <>2015-03-19 13:49:38 -0300
commite003ce54d2ccbb8da0fd4f421e1cc9686ef25add (patch)
treec631ffd7a3b29a66b164fbd8b6ed4ca73011972c /tools/perf
parent3346b542f4165cb0007cfe3600866acbee67c686 (diff)
perf tools: Fix the bash completion for listing subcommands of perf
The bash completion does not support listing subcommands for 'perf --<long option> <TAB>'. Example: Before this patch: $ perf --debug <TAB> $ As shown above, the subcommands of perf does not come out. After this patch: $ perf --debug <TAB> annotate buildid-cache data evlist inject kvm lock probe report script test top version bench buildid-list diff help kmem list mem record sched stat timechart trace As shown above, the subcommands of perf can come out now. Signed-off-by: Yunlong Song <> Tested-by: Arnaldo Carvalho de Melo <> Cc: Paul Mackerras <> Cc: Peter Zijlstra <> Cc: Wang Nan <> Link: Signed-off-by: Arnaldo Carvalho de Melo <>
Diffstat (limited to 'tools/perf')
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/ b/tools/perf/
index 3e25d3ea17f9..7b98ae48f0bf 100644
--- a/tools/perf/
+++ b/tools/perf/
@@ -130,7 +130,7 @@ __perf_main ()
# Skip options backward and find the last perf command
# List perf subcommands or long options
- if [ $cword -eq 1 ]; then
+ if [ -z $prev_skip_opts ]; then
if [[ $cur == --* ]]; then
cmds=$($cmd --list-opts)