Ramkumar Ramachandra
6e0dc374a2
perf completion: Use more comp words
...
The completion words $words and $cword are available, so we might as
well use them instead of directly accessing COMP_WORDS.
Signed-off-by: Ramkumar Ramachandra <[email protected] >
Cc: Frederic Weisbecker <[email protected] >
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2013-10-09 11:12:31 -03:00
Ramkumar Ramachandra
c3fb6717e9
perf completion: Strip dependency on bash-completion
...
The bash-completion package defines the _get_comp_words_by_ref function.
There is no need to depend on it, as we can reimplement it like git.git
has.
Signed-off-by: Ramkumar Ramachandra <[email protected] >
Cc: Frederic Weisbecker <[email protected] >
Cc: Namhyung Kim <[email protected] >
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2013-10-09 11:12:24 -03:00
Ramkumar Ramachandra
4685a6cfae
perf completion: Strip function_exists ()
...
Use "type" to check existence consistently.
Signed-off-by: Ramkumar Ramachandra <[email protected] >
Cc: Frederic Weisbecker <[email protected] >
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2013-10-09 11:12:06 -03:00
Ramkumar Ramachandra
7b6c48e16e
perf completion: Strip dependency on _filedir
...
_filedir is defined in the bash-completion package, but there is no need
to depend on it. Instead, call complete with multiple -o arguments
before the -F argument like in git.git's completion script.
Signed-off-by: Ramkumar Ramachandra <[email protected] >
Cc: Frederic Weisbecker <[email protected] >
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2013-10-09 11:11:55 -03:00
Ramkumar Ramachandra
30079d1d5e
perf completion: Update __ltrim_colon_completions
...
The function is taken from the bash-completion package; update it to use
the latest version where colon_word doesn't miss quoting.
Signed-off-by: Ramkumar Ramachandra <[email protected] >
Cc: Frederic Weisbecker <[email protected] >
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2013-10-09 11:11:48 -03:00
Ramkumar Ramachandra
1ba6e01782
perf completion: Don't dictate perf install location
...
The statement
have perf
limits the locations in which to look for the perf program. Moreover,
it depends on the bash-completion package to be installed. Replace it
with a call to `type perf`.
Signed-off-by: Ramkumar Ramachandra <[email protected] >
Cc: Frederic Weisbecker <[email protected] >
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2013-10-09 11:11:40 -03:00
Namhyung Kim
ae0c1f9934
perf tools: Complete tracepoint event names
...
Currently tracepoint events cannot be completed because they contain a
colon (:) character. The colon is considered as a word separator when
bash completion is done - variable COMP_WORDBREAKS contains colon - so
if a word being completed contains a colon it can be a problem.
Recent versions of bash completion provide -n switch to
_get_comp_words_by_ref and __ltrim_colon_completions functions in order
to resolve this issue. Copy the latter in case not exists.
Signed-off-by: Namhyung Kim <[email protected] >
Cc: David Ahern <[email protected] >
Cc: Frederic Weisbecker <[email protected] >
Cc: Ingo Molnar <[email protected] >
Cc: Paul Mackerras <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2012-10-04 12:44:52 -03:00
Namhyung Kim
4d8061faca
perf tools: Long option completion support for each subcommands
...
Add internal --list-opts option to print all of long option names to
stdout so that it can be used for bash completion engine.
Signed-off-by: Namhyung Kim <[email protected] >
Acked-by: Frederic Weisbecker <[email protected] >
Cc: David Ahern <[email protected] >
Cc: Frederic Weisbecker <[email protected] >
Cc: Ingo Molnar <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2012-10-02 18:36:44 -03:00
Namhyung Kim
35c2fde115
perf tools: Complete long option names of perf command
...
The main perf binary can receive a number of options that configure
working environment. Add them to the completion script.
Signed-off-by: Namhyung Kim <[email protected] >
Acked-by: Frederic Weisbecker <[email protected] >
Cc: David Ahern <[email protected] >
Cc: Frederic Weisbecker <[email protected] >
Cc: Ingo Molnar <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2012-10-02 18:36:43 -03:00
Namhyung Kim
a1d668c3ff
perf tools: Check existence of _get_comp_words_by_ref when bash completing
...
The '_get_comp_words_by_ref' function is available from the bash
completion v1.2 so that earlier version emits following warning:
$ perf re<TAB>_get_comp_words_by_ref: command not found
Use older '_get_cword' method when the above function doesn't exist.
Signed-off-by: Namhyung Kim <[email protected] >
Acked-by: Frederic Weisbecker <[email protected] >
Cc: David Ahern <[email protected] >
Cc: Frederic Weisbecker <[email protected] >
Cc: Ingo Molnar <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2012-10-02 18:36:42 -03:00
Frederic Weisbecker
a3277d2d5a
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 <[email protected] >
Cc: David Ahern <[email protected] >
Cc: Ingo Molnar <[email protected] >
Cc: Jiri Olsa <[email protected] >
Cc: Namhyung Kim <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Cc: Stephane Eranian <[email protected] >
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2012-08-09 15:59:26 -03:00
Frederic Weisbecker
98a4179c9a
perf tools: Initial bash completion support
...
This implements bash completion for perf subcommands such as record,
report, script, probe, etc...
Signed-off-by: Frederic Weisbecker <[email protected] >
Cc: David Ahern <[email protected] >
Cc: Ingo Molnar <[email protected] >
Cc: Jiri Olsa <[email protected] >
Cc: Namhyung Kim <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Cc: Stephane Eranian <[email protected] >
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2012-08-09 15:58:51 -03:00