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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 3 Apr 2020 12:01:11 +0200
From:   Jiri Olsa <jolsa@...hat.com>
To:     Adrian Hunter <adrian.hunter@...el.com>
Cc:     Arnaldo Carvalho de Melo <acme@...nel.org>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] perf script: Simplify auxiliary event printing functions

On Thu, Apr 02, 2020 at 05:15:48PM +0300, Adrian Hunter wrote:
> This simplifies the print functions for the following perf script
> options:
> 
> 	--show-task-events
> 	--show-namespace-events
> 	--show-cgroup-events
> 	--show-mmap-events
> 	--show-switch-events
> 	--show-lost-events
> 	--show-bpf-events
> 
> Example:
> 	# perf record --switch-events -a -e cycles -c 10000 sleep 1
>  Before:
> 	# perf script --show-task-events --show-namespace-events --show-cgroup-events --show-mmap-events --show-switch-events --show-lost-events --show-bpf-events >out-before.txt
>  After:
> 	# perf script --show-task-events --show-namespace-events --show-cgroup-events --show-mmap-events --show-switch-events --show-lost-events --show-bpf-events >out-after.txt
> 	# diff -s out-before.txt out-after.txt
> 	Files out-before.txt and out-after.tx are identical
> 
> Signed-off-by: Adrian Hunter <adrian.hunter@...el.com>
> ---
>  tools/perf/builtin-script.c | 304 ++++++++----------------------------
>  1 file changed, 66 insertions(+), 238 deletions(-)

awesome ;-)

> 
> diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
> index 186ebf827fa1..348fec9743a4 100644
> --- a/tools/perf/builtin-script.c
> +++ b/tools/perf/builtin-script.c
> @@ -2040,7 +2040,7 @@ static int cleanup_scripting(void)
>  
>  static bool filter_cpu(struct perf_sample *sample)
>  {
> -	if (cpu_list)
> +	if (cpu_list && sample->cpu != (u32)-1)
>  		return !test_bit(sample->cpu, cpu_bitmap);

why is this needed? filter_cpu seems to be already called
from all the changed functions..

thanks,
jirka

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ