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=-13.8 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,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 3DA9EC433ED for ; Thu, 15 Apr 2021 15:25:36 +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 BD0E7611AB for ; Thu, 15 Apr 2021 15:25:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BD0E7611AB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Gt0czxjPwCqcHi1h8pJeB2QESnHwBGz30UYWZx9l9/I=; b=bSkNOaCbA92Z3iE/u+HesTANl CF7fFPfictHOaOgAtCIjpmhoqJ92DD8lYsgoLHx2pHYFnl1r6LMkNKqhtZx03uVovYnXtgURzFGKD ai3IvyKjuGXw4B9BNv0B9CQ53t6M0Ths9dSDR8lqiNGGXIB3exlneHHKHY8l3Eymh5ue/8EGFdGE1 GfRIrgtz6phmCz3HaEM4rjp2fmMObXFkUGsn5kQ29qdamMmjYODaIQYUBSzG8MABtXQDbnDPDDwe4 aJBiHc9J3rZ1pwv7JpxdS+1Bqhelb8gqYouL+XauR6vaNTJSL13vu8/MxeGrWY5yO/pimE/BmHzI0 9TBbgfKVA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lX3qh-00GbNz-7H; Thu, 15 Apr 2021 15:24:07 +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 1lX3qa-00GbMu-Tb for linux-arm-kernel@desiato.infradead.org; Thu, 15 Apr 2021 15:24:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=bXZxdjLr/YJtMGDnsZ/dq4aApS/Fn+Nhc7T69iiHUaY=; b=DlHnR4fi9E+i33o9set9wQ3eqX LPW5AjaeRYuacaOOcG+pkFSoXQiA0RoRp3WY6XwPRj67rTbB37KEGbbufCQmpqJQxeCb3XhDokFB8 Y7OqNLX9Z9Ms4T8G6xUOl0Ukh2vIExC9u+o3kOlccWwDy/pzEmbX4e62vqA06eKpIXHpuk0o1zt9e 6o89ozJq0jPSDpYtLzCIja973He2yzaTHrYqPyotJ3yUYopu4GMfojSsXVQCUE2wunhFrcddDXRFR zDwMC3mVbh34yGTkFIn2raEm7JKEX37Vbl5q7FCs4LSXb47E6lLLAKIbSz9iu/klwRLFbbsuz5JIb ME6Z5N9g==; Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lX3qY-008hml-6n for linux-arm-kernel@lists.infradead.org; Thu, 15 Apr 2021 15:23:59 +0000 Received: by mail-pj1-x1029.google.com with SMTP id r13so8497093pjf.2 for ; Thu, 15 Apr 2021 08:23:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=bXZxdjLr/YJtMGDnsZ/dq4aApS/Fn+Nhc7T69iiHUaY=; b=bF68ElFunrnYdZcOGR/8Q/rHowlvo7APAr7Hq5kadkOOxjPovxtI55ahBVF3U14bFp Gi/aV/EFpS3RE/4Up73hh5RIGSmUH0JSePXBXjLb4CFNw5ePV+LGVlJIH5eHqU5HeaWW gO8PAfrPtTKs7xXyNMRq7q5H5QFZoZXxZJKy8hzRqDKeMk1LSQ9aI03h49JgTfrPx293 GHkPBeXMh+JtG8NfERTLZ0x4RgfiC5oZdExx38Xr+lFKWT8aaOqvONS2+IExUlQpT6ND YojO+fXGbbhzlWT6kQMvm30scQYxH8gA/3La47WWCpDIOaaNlWSP4/jXbdwfZpr+A0PO rS2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=bXZxdjLr/YJtMGDnsZ/dq4aApS/Fn+Nhc7T69iiHUaY=; b=ROgbIlwwhxpzkvvHUmhT2zpst2WTwFjmROTRp1TmpKq0UYvwAgxBfkX84kSqJyV+UC J0fsX0AQ/EkEjqU4jTfHpP3C7NUzZNeYAUhNdstMKaVKUjSx17TuN2L7F4wTKLIJZxII VOcimT6IkAxx1ZU5FW92WMoNushPCCRZ/4OKGk5wQd5HEHddV5Y1ozuuIM//shmAVIGw 0+s1/PIWE64Yyoq6Awe5CmBsRxJvmXgxPbm+4PHvW+1PlwQJB49OVXfSnLx1COnp/i3p BYE45vTrgVwaej8XryvoCi4J42HbL45qJe1wVF+8BAQNIxANbP8IFBY5o4ip8ucH35Om nliA== X-Gm-Message-State: AOAM533NyicyU+Uze4Cb3jume6uynheZy5WAYoUMWvOLWN4DaT+ChKG3 PsJGcHhBvAdo51rQT9ivxZF1sA== X-Google-Smtp-Source: ABdhPJx+RCHZAhVrJd03I0vARqND3wOxI6Nuy9rGZAR7ngHF61YSr8tsfAUZ871yB8qtDNNBt7WASw== X-Received: by 2002:a17:902:7616:b029:e9:a757:b191 with SMTP id k22-20020a1709027616b02900e9a757b191mr4330017pll.74.1618500236906; Thu, 15 Apr 2021 08:23:56 -0700 (PDT) Received: from leoy-ThinkPad-X240s ([116.206.101.232]) by smtp.gmail.com with ESMTPSA id fa6sm2821169pjb.2.2021.04.15.08.23.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Apr 2021 08:23:56 -0700 (PDT) Date: Thu, 15 Apr 2021 23:23:48 +0800 From: Leo Yan To: James Clark 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 Subject: Re: [PATCH v4 4/6] perf arm-spe: Assign kernel time to synthesized event Message-ID: <20210415152348.GF1011890@leoy-ThinkPad-X240s> References: <20210412091006.468557-1-leo.yan@linaro.org> <20210412091006.468557-5-leo.yan@linaro.org> <9036368a-e824-3d63-da5b-54cf32a86aed@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <9036368a-e824-3d63-da5b-54cf32a86aed@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210415_082358_258523_732F18BF X-CRM114-Status: GOOD ( 29.94 ) 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 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. Thanks, Leo _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel