diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-12 21:20:11 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-12 21:20:11 -0400 |
commit | ade0899b298ba2c43bfd6abd8cbc2545944cde0c (patch) | |
tree | a448dfb440b3b958b6306bb43620cd5d76f504bf /tools/perf/bash_completion | |
parent | 871a0596cb2f51b57dc583d1a7c4be0186582fe7 (diff) | |
parent | 95cf59ea72331d0093010543b8951bb43f262cac (diff) |
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf updates from Ingo Molnar:
"This tree includes some late late perf items that missed the first
round:
tools:
- Bash auto completion improvements, now we can auto complete the
tools long options, tracepoint event names, etc, from Namhyung Kim.
- Look up thread using tid instead of pid in 'perf sched'.
- Move global variables into a perf_kvm struct, from David Ahern.
- Hists refactorings, preparatory for improved 'diff' command, from
Jiri Olsa.
- Hists refactorings, preparatory for event group viewieng work, from
Namhyung Kim.
- Remove double negation on optional feature macro definitions, from
Namhyung Kim.
- Remove several cases of needless global variables, on most
builtins.
- misc fixes
kernel:
- sysfs support for IBS on AMD CPUs, from Robert Richter.
- Support for an upcoming Intel CPU, the Xeon-Phi / Knights Corner
HPC blade PMU, from Vince Weaver.
- misc fixes"
* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (46 commits)
perf: Fix perf_cgroup_switch for sw-events
perf: Clarify perf_cpu_context::active_pmu usage by renaming it to ::unique_pmu
perf/AMD/IBS: Add sysfs support
perf hists: Add more helpers for hist entry stat
perf hists: Move he->stat.nr_events initialization to a template
perf hists: Introduce struct he_stat
perf diff: Removing the total_period argument from output code
perf tool: Add hpp interface to enable/disable hpp column
perf tools: Removing hists pair argument from output path
perf hists: Separate overhead and baseline columns
perf diff: Refactor diff displacement possition info
perf hists: Add struct hists pointer to struct hist_entry
perf tools: Complete tracepoint event names
perf/x86: Add support for Intel Xeon-Phi Knights Corner PMU
perf evlist: Remove some unused methods
perf evlist: Introduce add_newtp method
perf kvm: Move global variables into a perf_kvm struct
perf tools: Convert to BACKTRACE_SUPPORT
perf tools: Long option completion support for each subcommands
perf tools: Complete long option names of perf command
...
Diffstat (limited to 'tools/perf/bash_completion')
-rw-r--r-- | tools/perf/bash_completion | 50 |
1 files changed, 43 insertions, 7 deletions
diff --git a/tools/perf/bash_completion b/tools/perf/bash_completion index 1958fa539d0f..56e6a12aab59 100644 --- a/tools/perf/bash_completion +++ b/tools/perf/bash_completion | |||
@@ -1,23 +1,59 @@ | |||
1 | # perf completion | 1 | # perf completion |
2 | 2 | ||
3 | function_exists() | ||
4 | { | ||
5 | declare -F $1 > /dev/null | ||
6 | return $? | ||
7 | } | ||
8 | |||
9 | function_exists __ltrim_colon_completions || | ||
10 | __ltrim_colon_completions() | ||
11 | { | ||
12 | if [[ "$1" == *:* && "$COMP_WORDBREAKS" == *:* ]]; then | ||
13 | # Remove colon-word prefix from COMPREPLY items | ||
14 | local colon_word=${1%${1##*:}} | ||
15 | local i=${#COMPREPLY[*]} | ||
16 | while [[ $((--i)) -ge 0 ]]; do | ||
17 | COMPREPLY[$i]=${COMPREPLY[$i]#"$colon_word"} | ||
18 | done | ||
19 | fi | ||
20 | } | ||
21 | |||
3 | have perf && | 22 | have perf && |
4 | _perf() | 23 | _perf() |
5 | { | 24 | { |
6 | local cur cmd | 25 | local cur prev cmd |
7 | 26 | ||
8 | COMPREPLY=() | 27 | COMPREPLY=() |
9 | _get_comp_words_by_ref cur prev | 28 | if function_exists _get_comp_words_by_ref; then |
29 | _get_comp_words_by_ref -n : cur prev | ||
30 | else | ||
31 | cur=$(_get_cword :) | ||
32 | prev=${COMP_WORDS[COMP_CWORD-1]} | ||
33 | fi | ||
10 | 34 | ||
11 | cmd=${COMP_WORDS[0]} | 35 | cmd=${COMP_WORDS[0]} |
12 | 36 | ||
13 | # List perf subcommands | 37 | # List perf subcommands or long options |
14 | if [ $COMP_CWORD -eq 1 ]; then | 38 | if [ $COMP_CWORD -eq 1 ]; then |
15 | cmds=$($cmd --list-cmds) | 39 | if [[ $cur == --* ]]; then |
16 | COMPREPLY=( $( compgen -W '$cmds' -- "$cur" ) ) | 40 | COMPREPLY=( $( compgen -W '--help --version \ |
41 | --exec-path --html-path --paginate --no-pager \ | ||
42 | --perf-dir --work-tree --debugfs-dir' -- "$cur" ) ) | ||
43 | else | ||
44 | cmds=$($cmd --list-cmds) | ||
45 | COMPREPLY=( $( compgen -W '$cmds' -- "$cur" ) ) | ||
46 | fi | ||
17 | # List possible events for -e option | 47 | # List possible events for -e option |
18 | elif [[ $prev == "-e" && "${COMP_WORDS[1]}" == @(record|stat|top) ]]; then | 48 | elif [[ $prev == "-e" && "${COMP_WORDS[1]}" == @(record|stat|top) ]]; then |
19 | cmds=$($cmd list --raw-dump) | 49 | evts=$($cmd list --raw-dump) |
20 | COMPREPLY=( $( compgen -W '$cmds' -- "$cur" ) ) | 50 | COMPREPLY=( $( compgen -W '$evts' -- "$cur" ) ) |
51 | __ltrim_colon_completions $cur | ||
52 | # List long option names | ||
53 | elif [[ $cur == --* ]]; then | ||
54 | subcmd=${COMP_WORDS[1]} | ||
55 | opts=$($cmd $subcmd --list-opts) | ||
56 | COMPREPLY=( $( compgen -W '$opts' -- "$cur" ) ) | ||
21 | # Fall down to list regular files | 57 | # Fall down to list regular files |
22 | else | 58 | else |
23 | _filedir | 59 | _filedir |