From patchwork Mon Dec 12 15:55:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Clark X-Patchwork-Id: 13071213 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4F5D6C10F1D for ; Mon, 12 Dec 2022 15:57:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YDj8mDJjbqdf92kmSpaEBODw7VBp5MOUZKSOXjFNmxA=; b=WaYw4CTBdpTwHT KwFvBtLfwNjfpLX3fXil2RTXTH4186NfmoXjI+K0Krx6idDTNVTHfRzY8VJh1URHvBcvdXFADSX+L mJpdoF8k0aO1SoJ4jYOC8Qc89KfZwgdZyWaOEv3WSyrk9aqouJJGiwOnI5Sl9k+tHX8j/Ut5RjFBa TPH36IUFRaWYSXomP6FQymHRLk/1yynzJuK/WC7EmBV0LKMi7c7KW33KSUSqZ/+rC80vz6QXGYM4P 9wf57cuMXJ8n+3EdDeao8uiWSGRxqzPxfX+sYK3gHgcvhjOcI68twjVOpFNigLw8wtInZBd3LTl5F urJPLswoef3OgvlGRk0Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p4l9t-001m13-EZ; Mon, 12 Dec 2022 15:56:01 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p4l9i-001lqn-7p for linux-arm-kernel@lists.infradead.org; Mon, 12 Dec 2022 15:55:52 +0000 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 4D77B2F4; Mon, 12 Dec 2022 07:56:23 -0800 (PST) Received: from e126815.warwick.arm.com (e126815.arm.com [10.32.32.26]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 4BBAA3F71E; Mon, 12 Dec 2022 07:55:40 -0800 (PST) From: James Clark To: linux-perf-users@vger.kernel.org Cc: Al.Grant@arm.com, James Clark , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , John Garry , Will Deacon , Mike Leach , Leo Yan , Mathieu Poirier , Suzuki K Poulose , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org Subject: [PATCH 1/5] perf: cs-etm: Print unknown header version as an error Date: Mon, 12 Dec 2022 15:55:09 +0000 Message-Id: <20221212155513.2259623-2-james.clark@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221212155513.2259623-1-james.clark@arm.com> References: <20221212155513.2259623-1-james.clark@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221212_075550_349173_2EFBD7CD X-CRM114-Status: GOOD ( 12.01 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This is an error rather than just for the raw trace dump so always print it as an error. Also remove the duplicate header version check. Signed-off-by: James Clark --- tools/perf/util/cs-etm.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c index 16db965ac995..aeb1e30888db 100644 --- a/tools/perf/util/cs-etm.c +++ b/tools/perf/util/cs-etm.c @@ -2623,14 +2623,7 @@ static void cs_etm__print_auxtrace_info(__u64 *val, int num) { int i, cpu = 0, version, err; - /* bail out early on bad header version */ version = val[0]; - if (version > CS_HEADER_CURRENT_VERSION) { - /* failure.. return */ - fprintf(stdout, " Unknown Header Version = %x, ", version); - fprintf(stdout, "Version supported <= %x\n", CS_HEADER_CURRENT_VERSION); - return; - } for (i = 0; i < CS_HEADER_VERSION_MAX; i++) fprintf(stdout, cs_etm_global_header_fmts[i], val[i]); @@ -2916,9 +2909,8 @@ int cs_etm__process_auxtrace_info(union perf_event *event, /* Look for version of the header */ hdr_version = ptr[0]; if (hdr_version > CS_HEADER_CURRENT_VERSION) { - /* print routine will print an error on bad version */ - if (dump_trace) - cs_etm__print_auxtrace_info(auxtrace_info->priv, 0); + pr_err("\nCS ETM Trace: Unknown Header Version = %#" PRIx64, hdr_version); + pr_err(", version supported <= %x\n", CS_HEADER_CURRENT_VERSION); return -EINVAL; }