Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4006061pxv; Tue, 13 Jul 2021 08:42:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUUNn/vOUxhyfGuZ+BFJblz32QPWfwgdchwqs5WDNWgBnWCPSyiw6CpYT1SnCOB5IZkJNs X-Received: by 2002:a02:c95a:: with SMTP id u26mr4648262jao.49.1626190925236; Tue, 13 Jul 2021 08:42:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626190925; cv=none; d=google.com; s=arc-20160816; b=TsS6NwbX0G/mCjp/PIuRIbNcx9FX0i8w8PcifZwoKWPxo8nL3cBD1UTOzKCbYAYg22 Raf5gRcLAjm+EHzrUWlSR+weHxTfeUIz9t3x29ZTA5nf2fgKln6Fz7jpj8Pf8gfp0bne RyJvqMnys39CJ4AvB8CSwirx9zj1qmvUQFxQL4NgnC6AgqULBO0tZXzjevhjcq3WLyJ2 dR8iPyRI7RSQEdciD0ok5hv/ACuZuGwSNX6x2/+ixQ0Si+WGY+5WaHDXCfcpJWWScM7S ucfaXGGFqbfWGGuk5r01flkPu2N9C6NCl3rIOOy7Im3dulrpuc1CQuFxBNe4d9KCAMVu M9VQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=2GVFZW7KfSGh2hp/cHyXrhGRZEIr1+lINjHehl0av8Q=; b=ntE4sbmWt15KXH3ZP//23QOOxLtFuuFaS98KX+/+B4+U28ZH61Cgk3a0nqmXbKm6af do6lMoxR4qWwf1lFavemjdPMUz7SisqDJrovcX1xjeFzWwLAE8TZ1W74M5e8b5RQMgws HCg3av+OAdx9Lk52CmmM/x0c75fdfRHhaT0SIJsVSyFMSdwgnt7X2Tp0bU/kGodf2Xud sMjr9rUaHNYW5bB4RUSA9/NmNEARFE2aFv2RGMdWyYh/vy1VdJ3VipRNIm60QBZSv7h5 19oiJLu7F5/8bmoej1IAYCOOnHas3aP5v6+vLcIdGhSL703dkd/QAJRKnGxomC3aWJa6 q+gA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x6si686143jas.60.2021.07.13.08.41.53; Tue, 13 Jul 2021 08:42:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237164AbhGMPnn (ORCPT + 99 others); Tue, 13 Jul 2021 11:43:43 -0400 Received: from foss.arm.com ([217.140.110.172]:45626 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237162AbhGMPnn (ORCPT ); Tue, 13 Jul 2021 11:43:43 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C0A406D; Tue, 13 Jul 2021 08:40:52 -0700 (PDT) Received: from e121896.arm.com (unknown [10.57.35.35]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id F12143F774; Tue, 13 Jul 2021 08:40:48 -0700 (PDT) From: James Clark To: acme@kernel.org, mathieu.poirier@linaro.org, coresight@lists.linaro.org, leo.yan@linaro.org Cc: al.grant@arm.com, branislav.rankov@arm.com, suzuki.poulose@arm.com, anshuman.khandual@arm.com, James Clark , Mike Leach , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , John Garry , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/6] perf cs-etm: Suppress printing when resetting decoder Date: Tue, 13 Jul 2021 16:40:06 +0100 Message-Id: <20210713154008.29656-5-james.clark@arm.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210713154008.29656-1-james.clark@arm.com> References: <20210713154008.29656-1-james.clark@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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