Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1479936pxa; Thu, 13 Aug 2020 09:19:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5KAnIhZvfcYsAc9MUWgfNuNC6tjKJmdRG4SAR8diJG8HuWxNU1v+jNkENBZ7RSmqP7bvP X-Received: by 2002:a50:e70e:: with SMTP id a14mr246641edn.93.1597335555788; Thu, 13 Aug 2020 09:19:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597335555; cv=none; d=google.com; s=arc-20160816; b=xz9XutNE/DmK5Pz9pIxO6uBHaWx+WFAqrmO4MdaHYbpZdU2dodp6AtFs3QZGoPGRSc 29GMc0duiTz1lH+szPEK0IgcnyGhzvSQ70hmz7aNopbdmtRhccUnL4jpdYi4s04DWQjZ fqekO0go/Ed3EqncFy1GdCnOHsYxaXX7xqGjZJ9NhmTr3EmIy+eXlMI486TaiKGeOqr2 OO61udKWnLtC+yzzGcqUlqXLz4BvjQCLlC3T5XGtY9gGj9AeRnNo8XTYgCa3LNWDMgNP rjIUvbtbxgxQkct75Oa00r5MJ4eHfGYrTrP5ld956wOYSl+4xr5JZ2cswtqN44LNAP3a RHag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=p7pJyanhH1tO91vA1YlND/mRfZB6nVNysM8FFOuLJ5k=; b=kVF8iOZzWcERbOf4EYxeAxdlbhSWKdATkYV5w2xNdGnAMODwdIPzSFfwMfBVCnapML YEclabwtqdxcAj4BDOMTcpZtG0bjmtb1gcUsJu8IQkQSoFXxHrOg0aQHaSPfH6S7QKhZ Z2Gvv5/X1Ars+8YxCsguz2LCA3VGkxdh1uK8K3PH+VRkMHWd84CLH4AUhtwrbzTolJpF FkPUVftcVg+nFAKU4oAWp1s4zXapyXVw5Q72DEEnVLxIGLrFhJE9SOp34T0edFyeqTX+ xO5wsRhmtha561Irm9fyKcjert3n6hhN5rqEuM7vYqDBLBVOxqpDkCQdI945VNs+z0UC SrZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OrpBvjuM; 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 cz6si3792775edb.350.2020.08.13.09.18.52; Thu, 13 Aug 2020 09:19:15 -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=OrpBvjuM; 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 S1726648AbgHMQSF (ORCPT + 99 others); Thu, 13 Aug 2020 12:18:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726192AbgHMQSB (ORCPT ); Thu, 13 Aug 2020 12:18:01 -0400 Received: from mail-il1-x142.google.com (mail-il1-x142.google.com [IPv6:2607:f8b0:4864:20::142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 781B1C061757 for ; Thu, 13 Aug 2020 09:18:01 -0700 (PDT) Received: by mail-il1-x142.google.com with SMTP id 77so6023320ilc.5 for ; Thu, 13 Aug 2020 09:18:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=p7pJyanhH1tO91vA1YlND/mRfZB6nVNysM8FFOuLJ5k=; b=OrpBvjuMBhIQcbMieNnyvz3hQPEY8Lq+Qom+Ny8VadQIzYnk9t6KDkSR1UTOBKwRd0 Ydeg54huoZOYnqE63AcqSROQH3J3bdWFFZ557tHk/bdL7LzXuWlJbND+FN0yjSRhoNSe 0+huvsrMt/xrDsmh99wTTFBXyrto40fvM+kUi2UMLN7XJUVP+eeMDkdy78QsG+mjcZ3d IikfIdEBxLcmsLJR1F8OMNAtecow0a7WSrAd0Sit9d+0FIJZ5iXzVBBciE8nTrp+M/Pd qnzxyBKynPE0Bzh3NUdHmkzsR/rloiTMc/hslL8ki+14kqc0HHv4aaTDPcF6xEYjvUeP 8KLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=p7pJyanhH1tO91vA1YlND/mRfZB6nVNysM8FFOuLJ5k=; b=YaxtIoY/Y3L4GXhOZBFZTsfNsy3mmfyafWrNboWzTajsP+uIQdKdQt0wglph4kShkK hAfUB1XZDSoVt1Uh+xdNhqOfYMjXfWrzOQILv2flWSNROmR+bZHoKlVynbCvtcymCp4h RjfrLzmO+b30LrbM27LELxouT5L5ccPkkzRlpzlF6PxDnogeX2fMZkeKbgDVeKNgxQZ9 mP3rG+LUCAWWxixCZmk/dd4zx5HsYxUAI45+rUl/gD80q5Pl79I877NIR1DwFMLX+AtU JGIQttwYDU7/Aujkbu9NeV73PRgBGdwxCFqFyn+ljJXTR6MPJzIyE0x5IYCGhg8s7IT6 kIPg== X-Gm-Message-State: AOAM533pY4DNoN6qkgSjA+bS1UvoQXBvp8POlRf/7XGIf17CKcToHmQS okNB4jFYok8wvohrD0Z8Hn+N97CUM1ObO8LOtR9VZA== X-Received: by 2002:a92:5209:: with SMTP id g9mr5558583ilb.72.1597335480586; Thu, 13 Aug 2020 09:18:00 -0700 (PDT) MIME-Version: 1.0 References: <20200807071620.11907-1-leo.yan@linaro.org> <20200812185334.GN13995@kernel.org> In-Reply-To: <20200812185334.GN13995@kernel.org> From: Mathieu Poirier Date: Thu, 13 Aug 2020 10:17:49 -0600 Message-ID: Subject: Re: [PATCH v2 0/4] Perf tool: Enable Arm arch timer counter and arm-spe's timestamp To: Arnaldo Carvalho de Melo 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 12 Aug 2020 at 12:53, Arnaldo Carvalho de Melo wrote: > > 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? > I agree, it is time to sort out this part. > 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? > Yes - I'll send you a patch for that once v5.9-rc1 comes out (unless you want it now). > 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. > Right, the same kind of arrangement you and I have for coresight. So far this has worked quite well and I don't see a need to proceed differently. > Please continue providing 'perf test' regression tests, etc, to help > with maintaining this code being checked. Those are quite useful. > > - 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