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=-14.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 544D7C433B4 for ; Thu, 29 Apr 2021 15:25:16 +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 AA468613F8 for ; Thu, 29 Apr 2021 15:25:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AA468613F8 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=kYlcEdTQS6mbiX0xNx8M7mvgJoGJACLvMjTppur7iSk=; b=ngfvJvHaKSidYFUEIb1JA6dxy hGVf5pnfnVEELUz14+2YITUvZsYM50O7O60yYpfWeWfJVLz7pBabkdtRJL6GSOPnf5TbqVIiqjRZD EaK368/onmojX5VPtdUDIyuLpp9DvA8y/mVw8e+fg9rw461fKC5xdY7saa6nR/rfxEY9VPm3wd9y2 hOANHa1vULBZ4UoML2yj/MUCSi8LVIqbesNvfqjXqV4qzdvyKS88d6NKJXNqkBIU3KU6LRll2B7hS Vw3Lwzo2FqV04c/GkJsK7uxC4bSkyiLaKZZJDBdMDfVD4813a+J2xqj2LraHSqw2LytM8KxSQi4q5 Ik6MgX9CA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lc8W3-005wkk-NP; Thu, 29 Apr 2021 15:23:48 +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 1lc8Vy-005wkY-Lp for linux-arm-kernel@desiato.infradead.org; Thu, 29 Apr 2021 15:23:43 +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=wMYiQrMMxp1KAmD6rBJdeD74Yv1gPkBbA4QnPdt6Sj0=; b=kM1fVKlgQOi+71c4KoLdVe1f9R om7putPfaqo45dAClL9zG79ijr20hqWKU0pnP/ZMlHyuZx2nOKAf4UXAKsKiTtTEp6cTi7Q9sh2kR 8izKbUwIZ592OwK3uWGe8XCRVhGPPdoIfUwqmib0G4krE8wXgmSNmtja4hUe9jIafbDvcrm4rPbZ4 lSZSR5uRHjP1+vf/4gsxWdNLKOv/W2HaJ6FtTAxWUvwVUUbnHClqT7vbchdxw7tfccrFohqWsmHMW 23YdMh8lFC6jNZhwrlnHBqY88meydgVjkB4CcuNt6sAHYZtiW45lpsBuTEvwRLLXhcuo2q+jjfISW q5lUFeWw==; Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lc8Vv-000iqq-TR for linux-arm-kernel@lists.infradead.org; Thu, 29 Apr 2021 15:23:41 +0000 Received: by mail-pg1-x530.google.com with SMTP id z16so6467417pga.1 for ; Thu, 29 Apr 2021 08:23:36 -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=wMYiQrMMxp1KAmD6rBJdeD74Yv1gPkBbA4QnPdt6Sj0=; b=BZkBythIdb/rLxPtJRW74b5TcaCa08gTAkZWc8/9jHfFgsEiXDRIAszwC4rSnq86Pk jzYbhlf+6BC9gjbrc/fBycvqqy05YA2//rZKNGPw2WrVNJAmbLE0UWnZuXI2GEcobo0u ey9AbkwKBqMX10ojHFgD2Vx3bECe97TE9Y1cB350VKDiutV+RtpCdVqntn8uHjOiBZgM EW2eefHRwbcm87xt1k/Td/Z+LL8SwQqNhRlWdiXlnfn9X2udXBtIByvK14w4FG/ZXVV8 NAMcr4vq+EIlZnrmWGeCN0C7TIdQgtVNAYgB4ru2x2lxKsZ0jlo63iTuz/y9PGmKIWdo Lt1A== 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=wMYiQrMMxp1KAmD6rBJdeD74Yv1gPkBbA4QnPdt6Sj0=; b=oDq6/obXpRHzxr8CKkzBzBtQgtY3g1uow6XX8qQ7whvn80RO4F4HP3SFgD6PbE+KM0 Ju2Vr8/bQ/irSwYuP+lUut1E6ACLBprBImykhpALZJarDD+bVvVPQBHjtaIK5zvh7nLU ksPdNNnrkGJ0LiuPqelItgY4NdLvD0/903mpHwKQv2WMA7buBEEQh0lEV9PUPI4hhw6A fpI+gD9RfHRnB6KxKHqEtK0jHnqUSOgSAxFGIkWLfzN6Ys1d7raR5c62X9HkrqcyCNMP X1yn+thiHUG40wijhjuA2YstNaKiAMeGMw8p7GMGLUv9HyvrktzjN3z1s2IwQkDvct7f mNlg== X-Gm-Message-State: AOAM531wTchw1BWbgE/geMOH86oIcTIcy522AcaKylLpLXXStAqU+ib/ v+m0RcdL0ltNbIcGIS1KPPuPJA== X-Google-Smtp-Source: ABdhPJwat9n5OdJZby1DncnAT3k7z26/jxcDLk33gW9Eu8s4zfB/OraVURfsrF+29NdrkuMTMyekWA== X-Received: by 2002:a65:42c3:: with SMTP id l3mr233498pgp.258.1619709816249; Thu, 29 Apr 2021 08:23:36 -0700 (PDT) Received: from leoy-ThinkPad-X240s ([204.124.180.30]) by smtp.gmail.com with ESMTPSA id h8sm2633662pjt.17.2021.04.29.08.23.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Apr 2021 08:23:35 -0700 (PDT) Date: Thu, 29 Apr 2021 23:23:26 +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: <20210429152326.GA282348@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> <20210415152348.GF1011890@leoy-ThinkPad-X240s> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210429_082339_982198_C3970BCF X-CRM114-Status: GOOD ( 29.74 ) 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 Hi James, On Fri, Apr 16, 2021 at 03:51:25PM +0300, James Clark wrote: [...] > >>> 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. Just now I sent another patch series "perf arm-spe: Correct recording configurations", which is the following up for the issue you found at here. After correcting sample flags, and combining with current patch series "perf arm-spe: Enable timestamp", I verified the Arm SPE decoding flows for "timeless" decoding, which can work as expected. So I think we can move forward for this patch series, for easier review, I have uploaded my testing branch wiht the complete patches [1]. Could you help confirm if this works for you? Thanks! Leo [1] https://github.com/Leo-Yan/linux/tree/perf_arm_spe_timestamp_v4_with_correcting_sample_flags _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel