summaryrefslogtreecommitdiff
path: root/tools/perf/bash_completion
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2012-08-09 18:31:52 +0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-08-09 22:59:26 +0400
commita3277d2d5a0d5d9492993ab68af8a8dc96760dd1 (patch)
treee9c621444e7a31b801b5c57753409bab0a46484e /tools/perf/bash_completion
parent98a4179c9aa1e99adf5103e6e0d05f563d902de1 (diff)
downloadlinux-a3277d2d5a0d5d9492993ab68af8a8dc96760dd1.tar.xz
perf tools: Support for events bash completion
Add basic bash completion for the -e option in record, top and stat subcommands. Only hardware, software and tracepoint events are supported. Breakpoints, raw events and events grouping completion need more thinking. Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: David Ahern <dsahern@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1344522713-27951-3-git-send-email-fweisbec@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/bash_completion')
-rw-r--r--tools/perf/bash_completion6
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()
local cur cmd
COMPREPLY=()
- _get_comp_words_by_ref cur
+ _get_comp_words_by_ref cur prev
cmd=${COMP_WORDS[0]}
@@ -14,6 +14,10 @@ _perf()
if [ $COMP_CWORD -eq 1 ]; then
cmds=$($cmd --list-cmds)
COMPREPLY=( $( compgen -W '$cmds' -- "$cur" ) )
+ # List possible events for -e option
+ elif [[ $prev == "-e" && "${COMP_WORDS[1]}" == @(record|stat|top) ]]; then
+ cmds=$($cmd list --raw-dump)
+ COMPREPLY=( $( compgen -W '$cmds' -- "$cur" ) )
# Fall down to list regular files
else
_filedir