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:   Mon, 26 Sep 2022 20:50:40 +0100
From:   Arnaldo Carvalho de Melo <acme@...nel.org>
To:     Chen Zhongjin <chenzhongjin@...wei.com>
Cc:     linux-kernel@...r.kernel.org, linux-perf-users@...r.kernel.org,
        peterz@...radead.org, mingo@...hat.com, mark.rutland@....com,
        alexander.shishkin@...ux.intel.com, jolsa@...nel.org,
        namhyung@...nel.org, irogers@...gle.com, john.garry@...wei.com,
        adrian.hunter@...el.com, ak@...ux.intel.com,
        florian.fischer@...q.space
Subject: Re: [PATCH -next 1/5] perf: Fix show_arg_names not working for tp
 arg names

Em Mon, Sep 26, 2022 at 11:14:36AM +0800, Chen Zhongjin escreveu:
> trace__fprintf_tp_fields() will always print arg names because when
> implemented it is forced to print arg_names with:
> (1 || trace->show_arg_names)
> 
> So the printing looks like:
> 
> > cat ~/.perfconfig
>     [trace]
>         show_arg_names = no
> 
> > perf trace -e syscalls:*mmap sleep 1
>     0.000 sleep/1119 syscalls:sys_enter_mmap(NULL, 8192, READ|WRITE, PRIVATE|ANONYMOUS)
>     0.179 sleep/1119 syscalls:sys_exit_mmap(__syscall_nr: 9, ret: 140535426170880)
>     ...
> 
> Although the comment said that perhaps we need a show_tp_arg_names.
> I don't think it's necessary to control them separately because
> it's not so clean that part of the log shows arg names but other not.
> Also when we are tracing functions it's rare to especially distinguish
> syscalls and tp trace.
> 
> Only use one option to control arg names printing is more resonable
> and simple. So remove the force condition and commit.
> 
> After fix:
 
> > perf trace -e syscalls:*mmap sleep 1
>     0.000 sleep/1121 syscalls:sys_enter_mmap(NULL, 8192, READ|WRITE, PRIVATE|ANONYMOUS)
>     0.163 sleep/1121 syscalls:sys_exit_mmap(9, 140454467661824)
>     ...

Thanks, applied.

- Arnaldo

 
> Fixes: f11b2803bb88 ("perf trace: Allow choosing how to augment the tracepoint arguments")
> Signed-off-by: Chen Zhongjin <chenzhongjin@...wei.com>
> ---
>  tools/perf/builtin-trace.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
> index 0bd9d01c0df9..c7bb7a8222a6 100644
> --- a/tools/perf/builtin-trace.c
> +++ b/tools/perf/builtin-trace.c
> @@ -2762,11 +2762,7 @@ static size_t trace__fprintf_tp_fields(struct trace *trace, struct evsel *evsel,
>  
>  		printed += scnprintf(bf + printed, size - printed, "%s", printed ? ", " : "");
>  
> -		/*
> -		 * XXX Perhaps we should have a show_tp_arg_names,
> -		 * leaving show_arg_names just for syscalls?
> -		 */
> -		if (1 || trace->show_arg_names)
> +		if (trace->show_arg_names)
>  			printed += scnprintf(bf + printed, size - printed, "%s: ", field->name);
>  
>  		printed += syscall_arg_fmt__scnprintf_val(arg, bf + printed, size - printed, &syscall_arg, val);
> -- 
> 2.17.1

-- 

- Arnaldo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ