lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 07 Aug 2012 08:48:04 -0600
From:	David Ahern <dsahern@...il.com>
To:	Frederic Weisbecker <fweisbec@...il.com>
CC:	Arnaldo Carvalho de Melo <acme@...stprotocols.net>,
	LKML <linux-kernel@...r.kernel.org>,
	Ingo Molnar <mingo@...nel.org>, Jiri Olsa <jolsa@...hat.com>,
	Namhyung Kim <namhyung@...il.com>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH 2/2] perf tools: Support for events bash completion

On 8/7/12 7:19 AM, Frederic Weisbecker wrote:
> 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@...il.com>
> Cc: David Ahern <dsahern@...il.com>
> Cc: Ingo Molnar <mingo@...nel.org>
> Cc: Jiri Olsa <jolsa@...hat.com>
> Cc: Namhyung Kim <namhyung@...il.com>
> Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
> Cc: Stephane Eranian <eranian@...gle.com>
> ---
>   tools/perf/bash_completion     |    6 +++-
>   tools/perf/builtin-list.c      |   14 ++++---
>   tools/perf/util/parse-events.c |   70 +++++++++++++++++++++++++---------------
>   tools/perf/util/parse-events.h |    7 ++--
>   4 files changed, 61 insertions(+), 36 deletions(-)
>
> diff --git a/tools/perf/bash_completion b/tools/perf/bash_completion
> index 3547703..25f4d99 100644
> --- a/tools/perf/bash_completion
> +++ b/tools/perf/bash_completion
> @@ -6,12 +6,16 @@ _perf()
>   	local cur
>
>   	COMPREPLY=()
> -	_get_comp_words_by_ref cur
> +	_get_comp_words_by_ref cur prev
>
>   	# List perf subcommands
>   	if [ $COMP_CWORD -eq 1 ]; then
>   		cmds=$(perf --list-cmds)
>   		COMPREPLY=( $( compgen -W '$cmds' -- "$cur" ) )
> +	# List possible events for -e option
> +	elif [[ $prev == "-e" && "${COMP_WORDS[1]}" == @(record|stat|top) ]]; then
> +		cmds=$(perf list --raw-dump)
> +		COMPREPLY=( $( compgen -W '$cmds' -- $cur ) )
>   	# Fall down to list regular files
>   	else
>   		_filedir

Any reason to show a file list except for -i and -o options? e.g.,

diff --git a/tools/perf/bash_completion b/tools/perf/bash_completion
index 25f4d99..be97349 100644
--- a/tools/perf/bash_completion
+++ b/tools/perf/bash_completion
@@ -17,7 +17,7 @@ _perf()
         cmds=$(perf list --raw-dump)
         COMPREPLY=( $( compgen -W '$cmds' -- $cur ) )
     # Fall down to list regular files
-   else
+   elif [[ $prev == "-o" || $prev == "-i" ]]; then
         _filedir
     fi
  } &&

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ