Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7020359rwb; Mon, 12 Dec 2022 09:05:50 -0800 (PST) X-Google-Smtp-Source: AA0mqf4NHELs1ztw7ufb7F3RblFIGr+HrdFJcpoLMU8smAyNeIZT+SMOIh9ypozdKyZeLF7TSffA X-Received: by 2002:a17:906:298c:b0:7c1:9eb:845b with SMTP id x12-20020a170906298c00b007c109eb845bmr14082822eje.16.1670864749928; Mon, 12 Dec 2022 09:05:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670864749; cv=none; d=google.com; s=arc-20160816; b=mlnl4/Inap+uPoa6mmgjUlvX7B5dLbM0CEeZT5TywuawsZKI1VMLxXYibmPwYF8s/y 2Q/ejODS19ocqW5IPbBNCCT/4nCPW1LJwt/Vg0uQ1hcC36nVuA7B388tstI6+WoE4AKa Q+1Udl6gTgMMCE2iBHkdKNlTLNADGIXAasZNQ5hed5dpxHExVpOw2EpFxzOcSEcdNpQB 4+okBxAQHtknDmD2JRoOi/MTSocDgDNWCwui+R+J414Bf2chpDeJflJzS7KRfJSHHXnP Y991hm0uekiQoTtGxJ5iKg/tErNcQH1QQE9gI8P2NL29VSEa1h6ynVvoHa9Clkpqob2b QBMA== 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=e9zzCYLtBXw13x2mcYukb9TWHJyvI1Bb5Iv+FhBP1yA=; b=mdUF4NOscohvCGMFV/PWusMY1R2kWD/ZIDlpoV95x65Khxu7bLxlLEg/vOnCGrqjAa YuUh3P7fFWD1E9Sb1hW/CqDNwkmgTqvJC6HAAJlyzpwvz0LTLt1e17clCEHHAV0tcWab +mVwoIRVEic835FIA8zSsPsuJHGdSJX6JTyUQF9wvbzSJMZa1pnjeRkmCk+ulZ3NM+dh KwGXTDnlxPvQvFbmNRSRTMo7QDlOSc/okMZjhVOR4jmXAqnJnLiccppwc2BT1KmfVqie Y1iRkijI63S0GMEuybJaBkRx7HR54yKq3hsadiKRaZe/tB0BxFn7p7JVPLyV2Ia3sUIj nQtg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jg14-20020a170907970e00b007c0a7286afesi6822919ejc.946.2022.12.12.09.05.31; Mon, 12 Dec 2022 09:05:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S232624AbiLLPzp (ORCPT + 74 others); Mon, 12 Dec 2022 10:55:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232618AbiLLPzn (ORCPT ); Mon, 12 Dec 2022 10:55:43 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0CC5064FA; Mon, 12 Dec 2022 07:55:43 -0800 (PST) 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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; } -- 2.25.1