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.3 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 1859BC433ED for ; Fri, 16 Apr 2021 12:54:01 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 9698661107 for ; Fri, 16 Apr 2021 12:54:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9698661107 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=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=9TMnywTW/N9csd4/fq+pkcBucX6tMeAgeDtzSIJ2/rI=; b=YImH5HUQ6zoCD7u9/oVTMCShZ 6Piz8KLeLG90eIBWBIyXbuWJn1rTM3S072eRI8NgV3X/CxrKVDcaI0tdPkNC8ZRBptReYbCBhE433 vzxTdyGNGreLOpSbEk7tc4U9IskALJERl0oJcDkBhXjMkh5eHWOfXepMc45YuBU5yNuVvWtQwyC4K 5OKOFz789Kp9m/JfKR6yFmSq2Qp8d7OHA0GaISm6/SxlHDnAzsG/sBe8LXDQtbAdQ0UgMqL8f5Byl NsZGYPhWwT7DmCGCEk4N0YPdrN9YKn6f39/IbupD5wlHJMx032C/useqXt2etmsuJ7gHABeeDZWI+ q3TeW4U0w==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lXNx8-0027a6-Lb; Fri, 16 Apr 2021 12:52:06 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lXNwf-0027Q1-51 for linux-arm-kernel@desiato.infradead.org; Fri, 16 Apr 2021 12:51:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To: Subject:Sender:Reply-To:Content-ID:Content-Description; bh=8BhQDSwJbqkUr2RiSfoKazL1/8OCB4Gwp76wS1n/33U=; b=xRqGaFTjFGTEztIbfrKVkl2x/z 4sKJtTOp+ULPrXbBqmdFqFMOgMurVvW6pGrarVuKmBDpTWrQ4XL4du7hu5oPjyTmt//JQEW9LuAoR 8G+9LAcm6CSo360Zxbj4UVOIQREqQ7E20dI+bgFSfE8ZTocrldElx+UDgGqyS3qdsHvjoP3Bdd/dV ktMTfLRtSabl/7D75u6wzYVkJELngCIL8e7X+TFUsEcsIe/rA2HBPvT+jbD3lokwM3hvTp/5uaWxH 9ubCmFEVPwwwX8gWaC2SXRBYfYXLciatqUkc9UIJIvDEV01hAyJ/iUCJh8BKGcOOfkDNsF7LMPz5d o4so97tg==; Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lXNwZ-009N6y-A4 for linux-arm-kernel@lists.infradead.org; Fri, 16 Apr 2021 12:51:35 +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 AAD8411B3; Fri, 16 Apr 2021 05:51:28 -0700 (PDT) Received: from [10.57.57.112] (unknown [10.57.57.112]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 99AA23F85F; Fri, 16 Apr 2021 05:51:26 -0700 (PDT) Subject: Re: [PATCH v4 4/6] perf arm-spe: Assign kernel time to synthesized event To: Leo Yan Cc: Arnaldo Carvalho de Melo , Al Grant , John Garry , Will Deacon , Mathieu Poirier , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Adrian Hunter , Dave Martin , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20210412091006.468557-1-leo.yan@linaro.org> <20210412091006.468557-5-leo.yan@linaro.org> <9036368a-e824-3d63-da5b-54cf32a86aed@arm.com> <20210415152348.GF1011890@leoy-ThinkPad-X240s> From: James Clark Message-ID: Date: Fri, 16 Apr 2021 15:51:25 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210415152348.GF1011890@leoy-ThinkPad-X240s> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210416_055131_430402_5000F1A0 X-CRM114-Status: GOOD ( 27.31 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 15/04/2021 18:23, Leo Yan wrote: > On Thu, Apr 15, 2021 at 05:46:31PM +0300, James Clark wrote: >> >> >> On 12/04/2021 12:10, Leo Yan wrote: >>> In current code, it assigns the arch timer counter to the synthesized >>> samples Arm SPE trace, thus the samples don't contain the kernel time >>> but only contain the raw counter value. >>> >>> To fix the issue, this patch converts the timer counter to kernel time >>> and assigns it to sample timestamp. >>> >>> Signed-off-by: Leo Yan >>> --- >>> tools/perf/util/arm-spe.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/tools/perf/util/arm-spe.c b/tools/perf/util/arm-spe.c >>> index 23714cf0380e..c13a89f06ab8 100644 >>> --- a/tools/perf/util/arm-spe.c >>> +++ b/tools/perf/util/arm-spe.c >>> @@ -234,7 +234,7 @@ static void arm_spe_prep_sample(struct arm_spe *spe, >>> struct arm_spe_record *record = &speq->decoder->record; >>> >>> if (!spe->timeless_decoding) >>> - sample->time = speq->timestamp; >>> + sample->time = tsc_to_perf_time(record->timestamp, &spe->tc); >> >> >> I noticed that in arm_spe_recording_options() the TIME sample bit is set regardless of any options. >> I don't know of a way to remove this, and if there isn't, does that mean that all the code in this >> file that looks at spe->timeless_decoding is untested and has never been hit? >> >> Unless there is a way to get a perf file with only the AUXTRACE event and no others? I think that one >> might have no timestamp set. Otherwise other events will always have timestamps so spe->timeless_decoding >> is always false. > > Good point. To be honest, I never noticed this issue until you > mentioned this. > > We should fix for the "timeless" flow; and it's questionable for the > function arm_spe_recording_options(), except for setting > PERF_SAMPLE_TIME, it also hard codes for setting > PERF_SAMPLE_CPU and PERF_SAMPLE_TID. Might need to carefully go > through this function. > Yeah, it's not strictly related to your change, which is definitely an improvement. But maybe we should have a look at the SPE implementation relating to timestamps as a whole. > Thanks, > Leo > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel