diff options
Diffstat (limited to 'tools/perf/bash_completion')
-rw-r--r-- | tools/perf/bash_completion | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/perf/bash_completion b/tools/perf/bash_completion index 9a31fa5ed2a9..1958fa539d0f 100644 --- a/tools/perf/bash_completion +++ b/tools/perf/bash_completion | |||
@@ -6,7 +6,7 @@ _perf() | |||
6 | local cur cmd | 6 | local cur cmd |
7 | 7 | ||
8 | COMPREPLY=() | 8 | COMPREPLY=() |
9 | _get_comp_words_by_ref cur | 9 | _get_comp_words_by_ref cur prev |
10 | 10 | ||
11 | cmd=${COMP_WORDS[0]} | 11 | cmd=${COMP_WORDS[0]} |
12 | 12 | ||
@@ -14,6 +14,10 @@ _perf() | |||
14 | if [ $COMP_CWORD -eq 1 ]; then | 14 | if [ $COMP_CWORD -eq 1 ]; then |
15 | cmds=$($cmd --list-cmds) | 15 | cmds=$($cmd --list-cmds) |
16 | COMPREPLY=( $( compgen -W '$cmds' -- "$cur" ) ) | 16 | COMPREPLY=( $( compgen -W '$cmds' -- "$cur" ) ) |
17 | # List possible events for -e option | ||
18 | elif [[ $prev == "-e" && "${COMP_WORDS[1]}" == @(record|stat|top) ]]; then | ||
19 | cmds=$($cmd list --raw-dump) | ||
20 | COMPREPLY=( $( compgen -W '$cmds' -- "$cur" ) ) | ||
17 | # Fall down to list regular files | 21 | # Fall down to list regular files |
18 | else | 22 | else |
19 | _filedir | 23 | _filedir |