Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp727962pxa; Wed, 12 Aug 2020 11:57:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2yJ4nsdAG/2PLtzNcBKQz+xjdqRzJdDXfg4JltaCTwZ97WcYFgUm37fLspm3fWtg7drMM X-Received: by 2002:a17:906:e46:: with SMTP id q6mr1274003eji.234.1597258631460; Wed, 12 Aug 2020 11:57:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597258631; cv=none; d=google.com; s=arc-20160816; b=ALLZG93L266xzU+aIKHjp+JirPD4GfTRm0OSfHzdgcjiLFPMAf1/DNhSmBAlS2r04z fjhWOcG7kOBNQkB61VTjjvR0cAG3yLWgkZtGRYpFTjUYsjA5LdVBG0oHD/iZBZqBwqmD DN/XGtfmQnzEVTihtuNzw5/WLNe8d8p6mh365wgDyp0oFbrlkMXOzEh8NOTo67btnoB8 GWnlnKAu4HecxZjmdV0VWLeCw0EqCeRB+vNgB3wRFBSvbZxDECtRjF0iE58WpOLdSCAY wuEV0fZhiE0LVf2Iy1/moF2FF44GzCtJzxAslS+TUOqBRJ6Xhl6b4NORf9sDQ1O6H4mS eTSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=GJoKk94Phs2j4DU8j17ObyKMX3ZZ27YFXCnSsoA1Kto=; b=OT1lr5vs+Y+k8w3nIvmLfMUeoA7iQsWxQJfCmEjNXRWL/qKOCQ9tcPYY66ydWqltvn NQinSZI8ZegL94oM+EYvVLXs88pV+dHGSruDeWHs5caUtNoKsntC/wFvUA2S0GHaVJfR QT9InZ8OoLsUHg1m0Gk3UzDhBNfIyR6T4AN4UwYWUcxXVCAt9gd4p/Yo/tsxzSKQzISA sY8tSE6E9aNZLlVP+Ij9OHs41UUEPPkdJyRgtaKNlC6K6QnTDHLXHpFCDMeuwKlw3XcE eOf4PNPJC+7avnuKhDzpRwlPoJB4mYiTBNIuChoQaqKwdr1cBKeRD1xF70upRd4PDX1S En9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nsQ3aIi0; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s15si1839928edy.237.2020.08.12.11.56.48; Wed, 12 Aug 2020 11:57:11 -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=@kernel.org header.s=default header.b=nsQ3aIi0; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726640AbgHLSxi (ORCPT + 99 others); Wed, 12 Aug 2020 14:53:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:37676 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726447AbgHLSxh (ORCPT ); Wed, 12 Aug 2020 14:53:37 -0400 Received: from quaco.ghostprotocols.net (unknown [177.158.180.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C5EAF20774; Wed, 12 Aug 2020 18:53:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597258417; bh=ob0YNPXTTHZfIK1XdcvKuT/oboSKu10JmM4vnIxq/6o=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nsQ3aIi0mwCDiIEVxGfuQzhed3zoRC0TG//2lkCHxuQI8/z6hs+PBx7YC+U+cauOU Jqi7/e/6ooGMMn97m88xS/h1AspMJ29YNKKGd/fF5QT0GwpOyjcSBP/TdFMalm3bpR zpg91P3xLyWELyY3Up0vmAG+B+7cw0EPG6gLCcag= Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 805644097F; Wed, 12 Aug 2020 15:53:34 -0300 (-03) Date: Wed, 12 Aug 2020 15:53:34 -0300 From: Arnaldo Carvalho de Melo To: Mathieu Poirier Cc: Leo Yan , Ian Rogers , Will Deacon , Mark Rutland , Peter Zijlstra , Ingo Molnar , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Kemeng Shi , "Naveen N. Rao" , Adrian Hunter , Igor Lubashev , Andi Kleen , Jin Yao , Stephane Eranian , James Clark , Linux Kernel Mailing List Subject: Re: [PATCH v2 0/4] Perf tool: Enable Arm arch timer counter and arm-spe's timestamp Message-ID: <20200812185334.GN13995@kernel.org> References: <20200807071620.11907-1-leo.yan@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: http://acmel.wordpress.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Wed, Aug 12, 2020 at 10:06:53AM -0600, Mathieu Poirier escreveu: > Hi Arnaldo, > > On Fri, 7 Aug 2020 at 01:16, Leo Yan wrote: > > > > This patch set is to enable Arm arch timer counter and Arm SPE is the > > first customer to use arch timer counter for its timestamp. > > > > Patches 01 ~ 03 enables Arm arch timer counter in Perf tool; patch 01 is > > to retrieve arch timer's parameters from mmaped page; patch 02 provides > > APIs for the conversion between arch timer's counter and time; patch 03 > > adds a test for patches 01 and 02. > > > > As the first customer to use Arm arch timer counter in perf tool, patch > > 04 is to generate sample's timestamp for ARM SPE AUX trace data. > > > > This patch set has been rebased on perf/core branch with the latest > > commit c4735d990268 ("perf evsel: Don't set > > sample_regs_intr/sample_regs_user for dummy event"). > > The ARM SPE perf tools code is orphan and I don't have the cycles to > pick it up. Leo has spent a lot of time in that code and as such I > suggest that he starts maintaining it, probably following the same > kind of arrangement you and I have for coresight. Thats ok with me, I think we should reflect that on the MAINTAINERS file, right? We have this already: PERFORMANCE EVENTS SUBSYSTEM ARM64 PMU EVENTS R: John Garry R: Will Deacon L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) S: Supported F: tools/perf/pmu-events/arch/arm64/ I think we should have entries for CoreSight and ARM SPE, one listing you as the maintainer and the other listing Leo, right? Leo, it would be good for you to try and find someone at your organization or elsewhere that could help with this, this way I would wait a bit, see if someone else Acks it, and collect those, processing it from you after a while if nobody chimes in. Please continue providing 'perf test' regression tests, etc, to help with maintaining this code being checked. - Arnaldo > Thanks, > Mathieu > > > > > After changes: > > > > # perf test 67 -v > > 67: Convert perf time to arch timer counter > > --- start --- > > test child forked, pid 5463 > > mmap size 528384B > > 1st event perf time 2231755083020 arch timer cnt 113097053477 > > test time 2231755087460 arch timer cnt 113097053699 > > 2nd event perf time 2231755090680 arch timer cnt 113097053860 > > test child finished with 0 > > ---- end ---- > > > > Reports the SPE sample with timestamp: > > > > $ perf script -F,+time > > dd 6799 [034] 25496.733475: 1 l1d-access: ffff87f37b88 _dl_start+0x288 (/usr/lib/aarch64-linux-gnu/ld-2.28.so) > > dd 6799 [034] 25496.733475: 1 tlb-access: ffff87f37b88 _dl_start+0x288 (/usr/lib/aarch64-linux-gnu/ld-2.28.so) > > dd 6799 [034] 25496.733479: 1 l1d-access: ffff87f37c74 _dl_start+0x374 (/usr/lib/aarch64-linux-gnu/ld-2.28.so) > > dd 6799 [034] 25496.733479: 1 tlb-access: ffff87f37c74 _dl_start+0x374 (/usr/lib/aarch64-linux-gnu/ld-2.28.so) > > dd 6799 [034] 25496.733485: 1 l1d-access: ffff87f49af4 __GI___tunables_init+0x3c (/usr/lib/aarch64-linux-gnu/ld-2.28.so) > > dd 6799 [034] 25496.733485: 1 tlb-access: ffff87f49af4 __GI___tunables_init+0x3c (/usr/lib/aarch64-linux-gnu/ld-2.28.so) > > > > Changes from v1: > > * Rebased on the latest perf/core branch; > > * Added a testing for Arm timer counter conversion (Ian Rogers). > > > > > > Leo Yan (4): > > perf tools: Support Arm arch timer counter > > perf arm_arch_timer: Convert between counter and timestamp > > perf arm_arch_timer: Test conversion between counter and timestamp > > perf arm-spe: Enable timestamp with arch timer counter > > > > tools/perf/arch/arm64/include/arch-tests.h | 6 + > > tools/perf/arch/arm64/tests/Build | 1 + > > tools/perf/arch/arm64/tests/arch-tests.c | 4 + > > .../tests/perf-time-to-arch-timer-counter.c | 189 ++++++++++++++++++ > > tools/perf/arch/arm64/util/Build | 1 + > > tools/perf/arch/arm64/util/arch_timer.c | 50 +++++ > > tools/perf/arch/arm64/util/arm-spe.c | 17 ++ > > tools/perf/util/Build | 1 + > > tools/perf/util/arm-spe.c | 16 +- > > tools/perf/util/arm-spe.h | 5 + > > tools/perf/util/arm_arch_timer.c | 28 +++ > > tools/perf/util/arm_arch_timer.h | 23 +++ > > 12 files changed, 339 insertions(+), 2 deletions(-) > > create mode 100644 tools/perf/arch/arm64/tests/perf-time-to-arch-timer-counter.c > > create mode 100644 tools/perf/arch/arm64/util/arch_timer.c > > create mode 100644 tools/perf/util/arm_arch_timer.c > > create mode 100644 tools/perf/util/arm_arch_timer.h > > > > -- > > 2.17.1 > > -- - Arnaldo