From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 24F66C433E0 for ; Mon, 11 Jan 2021 09:49:08 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BD0C722AAA for ; Mon, 11 Jan 2021 09:49:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BD0C722AAA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Cc:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Jttmudv5LnRCThWzuPxQd52LWklXPwYsLp/ajHFDWtc=; b=Dbm16egj3UHoog2Y7nbNyYYWv rY6BHb4Zk/BPOHzBTZM3jiIRr/togTk3jTVyegyL3BpQ23UdC+pZZuuBdnfP10MGsywlmzEJdf4Fq bDyHg8hRLpw35TLdTg/3LW94kewyu0G2Thops07T5NiU+wML9YYzC+tGNo+t0wgyTs82lRWv3/Kyq Pnstwj4tIxvb61kUKy3uiCooYaty7DDMVERV5h76Ie5bKP3nZ1MmIA8EguONhErQ00jADTaYi8Mvq nYkE3fHl9J+qhfonEIjespzNKcCX7cgHA/jPZ0inb8xJXnnCq1+hxK+L44Eqbs0+ATOfh6PCz+ZiJ SpHdfu6lw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kytnh-0000Ie-IB; Mon, 11 Jan 2021 09:47:49 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kytne-0000Gz-A3 for linux-arm-kernel@lists.infradead.org; Mon, 11 Jan 2021 09:47:47 +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 CC012101E; Mon, 11 Jan 2021 01:47:44 -0800 (PST) Received: from [10.57.39.145] (unknown [10.57.39.145]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3EE1C3F70D; Mon, 11 Jan 2021 01:47:41 -0800 (PST) Subject: Re: [PATCH v1 5/7] perf cs-etm: Fixup PID_FMT when it is zero To: Leo Yan , Arnaldo Carvalho de Melo , Mathieu Poirier , Mike Leach , Alexander Shishkin , John Garry , Will Deacon , Peter Zijlstra , Ingo Molnar , Mark Rutland , Jiri Olsa , Namhyung Kim , Daniel Kiss , Denis Nikitin , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20210109074435.626855-1-leo.yan@linaro.org> <20210109074435.626855-6-leo.yan@linaro.org> From: Suzuki K Poulose Message-ID: <27c8f898-93f3-6a2d-5e9e-b5b1225df1c9@arm.com> Date: Mon, 11 Jan 2021 09:47:31 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20210109074435.626855-6-leo.yan@linaro.org> Content-Language: en-GB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210111_044746_489026_2842C99C X-CRM114-Status: GOOD ( 23.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 1/9/21 7:44 AM, Leo Yan wrote: > If the metadata item CS_ETM_PID_FMT/CS_ETMV4_PID_FMT is zero, this means > the perf data file is recorded with old version tool and the tool has > not extended to support the item. > > For this case, this patch fixes up PID_FMT entry to set the value as > BIT(ETM_OPT_CTXTID), this info will be delivered to the decoder to > extract PID from packet's field "context_id". > > Signed-off-by: Leo Yan Acked-by: Suzuki K Poulose > --- > tools/perf/util/cs-etm.c | 19 +++++++++++++++++++ > 1 file changed, 19 insertions(+) > > diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c > index 763085db29ae..8c125134a756 100644 > --- a/tools/perf/util/cs-etm.c > +++ b/tools/perf/util/cs-etm.c > @@ -7,6 +7,7 @@ > */ > > #include > +#include > #include > #include > #include > @@ -2577,6 +2578,15 @@ int cs_etm__process_auxtrace_info(union perf_event *event, > for (k = 0; k < metadata_cpu_array_size; k++) > metadata[j][k] = ptr[i + k]; > > + /* > + * If the data in CS_ETM_PID_FMT is zero, means the > + * information isn't stored in the data file, this is > + * because the old perf tool hasn't yet supported > + * CS_ETM_PID_FMT. Fixup the item to option "CTXTID". > + */ > + if (!metadata[j][CS_ETM_PID_FMT]) > + metadata[j][CS_ETM_PID_FMT] = BIT(ETM_OPT_CTXTID); > + > /* The traceID is our handle */ > idx = metadata[j][CS_ETM_ETMTRACEIDR]; > i += metadata_cpu_array_size; > @@ -2590,6 +2600,15 @@ int cs_etm__process_auxtrace_info(union perf_event *event, > for (k = 0; k < metadata_cpu_array_size; k++) > metadata[j][k] = ptr[i + k]; > > + /* > + * If the data in CS_ETMV4_PID_FMT is zero, means the > + * information isn't stored in the data file, this is > + * because the old perf tool hasn't yet supported > + * CS_ETMV4_PID_FMT. Fixup the item to option "CTXTID". > + */ > + if (!metadata[j][CS_ETMV4_PID_FMT]) > + metadata[j][CS_ETMV4_PID_FMT] = BIT(ETM_OPT_CTXTID); > + > /* The traceID is our handle */ > idx = metadata[j][CS_ETMV4_TRCTRACEIDR]; > i += metadata_cpu_array_size; > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel