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]
Message-ID: <194c676b-3a73-7f34-1f29-a157b5e4731f@intel.com>
Date:   Mon, 19 Dec 2022 08:59:48 +0200
From:   Adrian Hunter <adrian.hunter@...el.com>
To:     Yang Jihong <yangjihong1@...wei.com>, peterz@...radead.org,
        mingo@...hat.com, acme@...nel.org, mark.rutland@....com,
        alexander.shishkin@...ux.intel.com, jolsa@...nel.org,
        namhyung@...nel.org, irogers@...gle.com, kan.liang@...ux.intel.com,
        kim.phillips@....com, german.gomez@....com, ravi.bangoria@....com,
        linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] perf tool: Fix output unexpected messages in quiet mode

On 19/12/22 04:49, Yang Jihong wrote:
> When perf uses quiet mode, perf_quiet_option sets debug_peo_args to -1,

Seems like redirect_to_stderr has similar issue?

> and display_attr incorrectly determines the value of debug_peo_args.
> As a result, unexpected information is displayed.
> 
> Before:
>   # perf record --quiet -- ls > /dev/null
>   ------------------------------------------------------------
>   perf_event_attr:
>     size                             128
>     { sample_period, sample_freq }   4000
>     sample_type                      IP|TID|TIME|PERIOD
>     read_format                      ID|LOST
>     disabled                         1
>     inherit                          1
>     mmap                             1
>     comm                             1
>     freq                             1
>     enable_on_exec                   1
>     task                             1
>     precise_ip                       3
>     sample_id_all                    1
>     exclude_guest                    1
>     mmap2                            1
>     comm_exec                        1
>     ksymbol                          1
>     bpf_event                        1
>   ------------------------------------------------------------
>   ...
> 
> After:
>   # perf record --quiet -- ls > /dev/null
>   #
> 
> Fixes: ccd26741f5e6 ("perf tool: Provide an option to print perf_event_open args and return value")
> Signed-off-by: Yang Jihong <yangjihong1@...wei.com>

Reviewed-by: Adrian Hunter <adrian.hunter@...el.com>

> ---
>  tools/perf/util/debug.h | 2 +-
>  tools/perf/util/evsel.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/perf/util/debug.h b/tools/perf/util/debug.h
> index f99468a7f681..f6ab84c93ec0 100644
> --- a/tools/perf/util/debug.h
> +++ b/tools/perf/util/debug.h
> @@ -41,7 +41,7 @@ extern int debug_data_convert;
>  
>  /* Special macro to print perf_event_open arguments/return value. */
>  #define pr_debug2_peo(fmt, ...) {				\
> -	if (debug_peo_args)						\
> +	if (debug_peo_args > 0)						\
>  		pr_debugN(0, pr_fmt(fmt), ##__VA_ARGS__);	\
>  	else							\
>  		pr_debugN(2, pr_fmt(fmt), ##__VA_ARGS__);	\
> diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
> index 999dd1700502..45cf144c5d5d 100644
> --- a/tools/perf/util/evsel.c
> +++ b/tools/perf/util/evsel.c
> @@ -1775,7 +1775,7 @@ static int __open_attr__fprintf(FILE *fp, const char *name, const char *val,
>  
>  static void display_attr(struct perf_event_attr *attr)
>  {
> -	if (verbose >= 2 || debug_peo_args) {
> +	if (verbose >= 2 || debug_peo_args > 0) {
>  		fprintf(stderr, "%.60s\n", graph_dotted_line);
>  		fprintf(stderr, "perf_event_attr:\n");
>  		perf_event_attr__fprintf(stderr, attr, __open_attr__fprintf, NULL);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ