summaryrefslogtreecommitdiffstats
path: root/tools/perf/bash_completion
Commit message (Collapse)AuthorAgeFilesLines
* perf completion: Rename file to reflect zsh supportRamkumar Ramachandra2013-11-271-202/+0
| | | | | | | | Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Link: http://lkml.kernel.org/r/1384704807-15779-6-git-send-email-artagnon@gmail.com [ Fix 'make install' target ] Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
* perf completion: Introduce zsh supportRamkumar Ramachandra2013-11-271-1/+62
| | | | | | | | | | | | __perfcomp(), __perfcomp_colon(), and _perf() have to be overridden. Inspired by the way the git.git completion system is structured. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/1384704807-15779-5-git-send-email-artagnon@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
* perf completion: Factor out call to __ltrim_colon_completionsRamkumar Ramachandra2013-11-271-2/+7
| | | | | | | | | | | | | | | | | In our sole callsite, __ltrim_colon_completions is called after __perfcomp, to modify the COMPREPLY set by the invocation. This is problematic, because in the zsh equivalent (using compset/ compadd), we'll have to generate completions in one-shot. So factor out this entire callsite into a special override'able __perfcomp_colon function; we will override it when introducing zsh support. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Link: http://lkml.kernel.org/r/1384704807-15779-4-git-send-email-artagnon@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
* perf completion: Factor out compgen stuffRamkumar Ramachandra2013-11-271-5/+10
| | | | | | | | | | | compgen is a bash-builtin; factor out the invocations into a separate function to give us a chance to override it with a zsh equivalent in future patches. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Link: http://lkml.kernel.org/r/1384704807-15779-3-git-send-email-artagnon@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
* perf completion: Introduce a layer of indirectionRamkumar Ramachandra2013-11-271-6/+11
| | | | | | | | | | | Define the variables cur, words, cword, and prev outside the main completion function so that we have a chance to override it when we introduce zsh support. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Link: http://lkml.kernel.org/r/1384704807-15779-2-git-send-email-artagnon@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
* perf completion: Use more comp wordsRamkumar Ramachandra2013-10-091-6/+6
| | | | | | | | | | 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 <artagnon@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Link: http://lkml.kernel.org/r/1372941691-14684-8-git-send-email-artagnon@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
* perf completion: Strip dependency on bash-completionRamkumar Ramachandra2013-10-091-6/+77
| | | | | | | | | | | | 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 <artagnon@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Namhyung Kim <namhyung.kim@lge.com> Link: http://lkml.kernel.org/r/1372941691-14684-7-git-send-email-artagnon@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
* perf completion: Strip function_exists ()Ramkumar Ramachandra2013-10-091-7/+1
| | | | | | | | | Use "type" to check existence consistently. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Link: http://lkml.kernel.org/r/1372941691-14684-6-git-send-email-artagnon@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
* perf completion: Strip dependency on _filedirRamkumar Ramachandra2013-10-091-4/+3
| | | | | | | | | | | _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 <artagnon@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Link: http://lkml.kernel.org/r/1372941691-14684-4-git-send-email-artagnon@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
* perf completion: Update __ltrim_colon_completionsRamkumar Ramachandra2013-10-091-1/+1
| | | | | | | | | | 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 <artagnon@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Link: http://lkml.kernel.org/r/1372941691-14684-3-git-send-email-artagnon@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
* perf completion: Don't dictate perf install locationRamkumar Ramachandra2013-10-091-1/+1
| | | | | | | | | | | | | | | 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 <artagnon@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Link: http://lkml.kernel.org/r/1372941691-14684-2-git-send-email-artagnon@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
* perf tools: Complete tracepoint event namesNamhyung Kim2012-10-041-2/+16
| | | | | | | | | | | | | | | | | | | | 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 <namhyung@kernel.org> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1349328234-16995-1-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
* perf tools: Long option completion support for each subcommandsNamhyung Kim2012-10-021-2/+7
| | | | | | | | | | | | | | 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 <namhyung@kernel.org> Acked-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1349191294-6926-4-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
* perf tools: Complete long option names of perf commandNamhyung Kim2012-10-021-3/+9
| | | | | | | | | | | | | | 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 <namhyung@kernel.org> Acked-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1349191294-6926-3-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
* perf tools: Check existence of _get_comp_words_by_ref when bash completingNamhyung Kim2012-10-021-2/+13
| | | | | | | | | | | | | | | | | | 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 <namhyung@kernel.org> Acked-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1349191294-6926-2-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
* perf tools: Support for events bash completionFrederic Weisbecker2012-08-091-1/+5
| | | | | | | | | | | | | | | | | | | 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>
* perf tools: Initial bash completion supportFrederic Weisbecker2012-08-091-0/+22
This implements bash completion for perf subcommands such as record, report, script, probe, etc... 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-2-git-send-email-fweisbec@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
OpenPOWER on IntegriCloud