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]
Message-ID: <20210719193929.GE2255168@p14s>
Date:   Mon, 19 Jul 2021 13:39:29 -0600
From:   Mathieu Poirier <mathieu.poirier@...aro.org>
To:     James Clark <james.clark@....com>
Cc:     acme@...nel.org, coresight@...ts.linaro.org, leo.yan@...aro.org,
        al.grant@....com, branislav.rankov@....com, suzuki.poulose@....com,
        anshuman.khandual@....com, Mike Leach <mike.leach@...aro.org>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Jiri Olsa <jolsa@...hat.com>,
        Namhyung Kim <namhyung@...nel.org>,
        John Garry <john.garry@...wei.com>,
        Will Deacon <will@...nel.org>,
        linux-arm-kernel@...ts.infradead.org,
        linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/6] perf cs-etm: Suppress printing when resetting decoder

On Tue, Jul 13, 2021 at 04:40:06PM +0100, James Clark wrote:
> The decoder is quite noisy when being reset. In a future commit,
> dump-raw-trace will use a code path that resets the decoder rather than
> creating a new one, so printing has to be suppressed to not flood the
> output.
> 
> Signed-off-by: James Clark <james.clark@....com>
> ---
>  tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
>

Reviewed-by: Mathieu Poirier <mathieu.poirier@...aro.org>

> diff --git a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
> index 3e1a05bc82cc..ed1f0326f859 100644
> --- a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
> +++ b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
> @@ -35,6 +35,7 @@
>  struct cs_etm_decoder {
>  	void *data;
>  	void (*packet_printer)(const char *msg);
> +	bool suppress_printing;
>  	dcd_tree_handle_t dcd_tree;
>  	cs_etm_mem_cb_type mem_access;
>  	ocsd_datapath_resp_t prev_return;
> @@ -74,9 +75,10 @@ int cs_etm_decoder__reset(struct cs_etm_decoder *decoder)
>  	ocsd_datapath_resp_t dp_ret;
>  
>  	decoder->prev_return = OCSD_RESP_CONT;
> -
> +	decoder->suppress_printing = true;
>  	dp_ret = ocsd_dt_process_data(decoder->dcd_tree, OCSD_OP_RESET,
>  				      0, 0, NULL, NULL);
> +	decoder->suppress_printing = false;
>  	if (OCSD_DATA_RESP_IS_FATAL(dp_ret))
>  		return -1;
>  
> @@ -146,8 +148,10 @@ static void cs_etm_decoder__print_str_cb(const void *p_context,
>  					 const char *msg,
>  					 const int str_len)
>  {
> -	if (p_context && str_len)
> -		((struct cs_etm_decoder *)p_context)->packet_printer(msg);
> +	const struct cs_etm_decoder *decoder = p_context;
> +
> +	if (p_context && str_len && !decoder->suppress_printing)
> +		decoder->packet_printer(msg);
>  }
>  
>  static int
> -- 
> 2.28.0
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ