Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp871208pxb; Thu, 15 Apr 2021 08:27:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1yHYpuNHAcUaXWmxpTVg811PCrMwrdPF2PdGUiTXQChusB4MQnRvlXcooN6MiLyWxA/az X-Received: by 2002:aa7:d9cf:: with SMTP id v15mr4887612eds.358.1618500460928; Thu, 15 Apr 2021 08:27:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618500460; cv=none; d=google.com; s=arc-20160816; b=RHadEfFdKg2yTste4SiHHb1znVHY3IjvxQFsZKaYC0S+whY6AhFJR2ADSZal3mfkee V7KBXttn0Qq592qVnylXA9ZqvVhEds2EYDeSNQz+ZWbP3pFaP5k0d8bXchsEQHArBQaF b57kG8jmuPPsjv9ctbON6aJL4+bvibuYTeuW5kgy9R9OkWpIMzXQp5vcT6O2sNPGIUkn rS4AuyEGLdFzvf0AOupzp/f3rJ5aTSsVNtBtFdVNEXZ+DDLygYy5ufJolMaf97dpcmNU TH8AkTFfjNSLfVWfrDAmI8jy8dCNwZafZhJTfhDyTQ5qrgkdEPkRt6r73ZHeKhNbA4fK PVog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=bXZxdjLr/YJtMGDnsZ/dq4aApS/Fn+Nhc7T69iiHUaY=; b=J5C4tt4yYcq8+7sA9whfw1mZzvBHZzDFgLg4slO4Xu0iwOsLvaSneokG0Hy78sWEJa CFMunym9ZIDS0s4bEtzhgEz38U2f29V3uN/C+ggbxyibmAP9nuJ/T5U2qMYeytHOEsJs cJ3SCM9sk4j4vToFc/CjlSmwY/D9+z4QdvVTMkea03GXBBnydZTsOsmZRIbl16QUgVUz Plg1T4/oF9YTexy3MMzdW4BsWiyWoO9rtycdHaEdhB1rySlRM0BLJCFmG0pwOR8lcHLw QvtMCXg4X9oUOCw7o8y5S2lxS+J7I0K/2Y2B1WfUNTLSAcZkJF5quCINwsZOqYh6TZh1 BdOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bF68ElFu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z2si2405951edx.455.2021.04.15.08.27.16; Thu, 15 Apr 2021 08:27:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bF68ElFu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233367AbhDOPYj (ORCPT + 99 others); Thu, 15 Apr 2021 11:24:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234651AbhDOPYV (ORCPT ); Thu, 15 Apr 2021 11:24:21 -0400 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B4B0C061574 for ; Thu, 15 Apr 2021 08:23:57 -0700 (PDT) Received: by mail-pj1-x102b.google.com with SMTP id il9-20020a17090b1649b0290114bcb0d6c2so14627840pjb.0 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=fNqiSZeAYrOkSTcN5sJa4ZGOEQ5eeCbkAXTmrhd2czGK0Rbffiqe+HZMbprxu/nj12 FUU+GeW3TeF6eC6GsCMqejugYFqX4t9lW4w2w/JWrvUy6vp/k7XOFtVD430lJqc/ukw+ kzNQjb0yOtd392eO/CF+WVsbiqYC4I5QuHr6yRHjIvxVimmAzUhW++iJNTqtq9nRjXt2 a28pr4dd/+30JxjFV5J2s8Z1OiviidZewU+9Db5yNN2YRFyrL2bFijLgnKQt7XMkKjDx qDhTxqXnsBCRiGwTX5JvIFoSem6t1ygGz3MwWln4osfk1VGvs+S6XVFgoMXbSOUOTPTY JmcA== X-Gm-Message-State: AOAM530XHTZt6VjSfJ+WEo8QelY5sDqbAZedSk0+BkBTiGdGW5wcrfr9 w5J5FkPgXSNajtoJ6cKl5rv/VA== 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9036368a-e824-3d63-da5b-54cf32a86aed@arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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