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=-8.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 DC5BDC43461 for ; Mon, 14 Sep 2020 11:56:24 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 8CFAF2222E for ; Mon, 14 Sep 2020 11:56:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="pCOFxk+J"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="vITVmm8k" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8CFAF2222E 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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Owner; bh=X6G8SZg6cfHeMjEnel39UutKm76ue4oFFQr8m2h8XpM=; b=pCOFxk+Jnzs3w8L7XC9IyW46Ti 1Pqz8572RijEZWN+a1astJHnCFqZxBpfeCH7xJ0fPHb7Wh1TAiYzYb0aRvrTvYRj+PuYnOB+N1Hkf N2qH1YLWiuE0DJepUtLpcKmpn3wLxthaYR6SfE8g1f455ZECFbxwfr/FhNd2jXfkSI6lqiIri/xPO ek1qcLvnsQpnaQQNDtt7zLq1+k1lONnQlCt9esGYeDq4BjJdrdwa3PLFLbX0LVOISfL/fT22MOA6K 4+W8LUrv1rMLt1Hb7FC8Kob/FYQS6LZXxBPuaF6/oBvgbAJgE80CX7kAOm2MtPd0lkAAUcXkVm0ge JKJcRQyQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kHn4a-0007vZ-EX; Mon, 14 Sep 2020 11:55:04 +0000 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kHn4X-0007uX-62 for linux-arm-kernel@lists.infradead.org; Mon, 14 Sep 2020 11:55:02 +0000 Received: by mail-pf1-x442.google.com with SMTP id f18so12415320pfa.10 for ; Mon, 14 Sep 2020 04:54:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=Q23N1TOucc/ZEqxZTf6rnZyxpHwEyiRp1vp3lvFnC78=; b=vITVmm8kJizd444PDe3E8+UH7q3lTG7Znw5SAbXHotbSLqVh4qAJvoAmZkXOzsvS65 xkAK+aQ1L5/qZhNqfeYmlLYxGcTVvrpvr3XcQw4hEzTBU8fuytzaP5EzL1IbRTKKWmwO FmfBO1y0COxhKyTQ+fiXz+8kZMboE75xDquYmNqscuU81XwcVgxV4L6owAIfM9yZNc3x EBwNjILz70k541PUtPVEG4Y94EqwJ958fWASypuidNz9+ZRi5XWujASsVZAYASOula/M 7/4Yq7M/RStZFClyDSBUeOApVxbeDFJoVr82RqtWnYVZeKJfW/8uKk5CtcNwWat2M16v fDUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Q23N1TOucc/ZEqxZTf6rnZyxpHwEyiRp1vp3lvFnC78=; b=efB4PQ1Zuh70G1GP2oSFWTxpCeW6G1FMYtcfkWQ5QIPT4WZtMyY5UyodGYYZGvIZZ5 XUxPCqCBStQ0QsFLbjPUXPCc7Er9Hpcimk1mEj2pSFHvi20Z2KmWtEZfYv/MQ7uJJlNc XrVZuEvgc0SVprK1WyVY5Nbf0SJoffGCb/CP7tWfGdmejaUQ87Xj8cJfwXMG8eYVqA7R ze8J0tnSokSbklJqxjD+kRO7qhDLHWoxT0xvwYenfaC2scMJwx0+ZEXG0D3lXHol0J+s UnxO+R21G34klOe1UwmsTV/VZgMmoNVjhkuKdJehFvjXRZD7gCEDAkqw62MKoOXsyRaj K0IQ== X-Gm-Message-State: AOAM530UJ3szRhhwJ8XQLfPlZpw/oObgPlSxAdoxVPtUpy3UMn4knFsf IEzIVBWeuaY66tLHcX70VBblDQ== X-Google-Smtp-Source: ABdhPJzInXcOR8cfrDUoA75xVqAPvLKogwE4HlVoVmEvnWPVnjb/9o00lIHq3RxZ+dKL36R28iXX+w== X-Received: by 2002:a63:c80b:: with SMTP id z11mr10047599pgg.298.1600084497023; Mon, 14 Sep 2020 04:54:57 -0700 (PDT) Received: from localhost ([2600:3c01::f03c:91ff:fe8a:bb03]) by smtp.gmail.com with ESMTPSA id q4sm5910898pjl.28.2020.09.14.04.54.55 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 14 Sep 2020 04:54:56 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Peter Zijlstra , Will Deacon , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , John Garry , Mathieu Poirier , Adrian Hunter , Kemeng Shi , Ian Rogers , Remi Bernon , Nick Gasson , Stephane Eranian , Andi Kleen , Steve MacLean , "Gustavo A. R. Silva" , Zou Wei , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v4 0/6] Perf tool: Support TSC for Arm64 Date: Mon, 14 Sep 2020 19:53:05 +0800 Message-Id: <20200914115311.2201-1-leo.yan@linaro.org> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200914_075501_493233_DCBBD9DB X-CRM114-Status: GOOD ( 15.65 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leo Yan MIME-Version: 1.0 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 This patch set is to refactor TSC implementation and move TSC code from x86 folder to util/tsc.c, this allows all archs to reuse the code. And alse move the TSC testing from x86 folder to tests so can work as a common testing. So far, for x86 it needs to support cap_user_time_zero and for Arm64 it needs to support cap_user_time_short. For architecture specific code, every arch only needs to implement its own rdtsc() to read out timer's counter. This patch set has been rebased on the perf/core branch with latest commit b1f815c479c1 ("perf vendor events power9: Add hv_24x7 core level metric events") and tested on Arm64 DB410c. $ perf test list [...] 68: Convert perf time to TSC [...] $ perf test 68 -v 68: Convert perf time to TSC --- start --- test child forked, pid 10961 mmap size 528384B 1st event perf time 35715036563417 tsc 686221770989 rdtsc time 35715036649719 tsc 686221772647 2nd event perf time 35715036660448 tsc 686221772852 test child finished with 0 ---- end ---- Convert perf time to TSC: Ok Changes from v3: * Added comments for Arm64's rdtsc() for short counter (PeterZ); * Rebased on latest acme/perf/core branch. Changes from v2: * Refactored patch set to move TSC common code to util/tsc.c (Wei/Al); * Moved TSC testing to perf/tests (Wei); * Dropped Arm SPE timestamp patch so can have clear purpose and easier reviewing; will send Arm SPE timestamp as separate patch. Leo Yan (6): perf tsc: Move out common functions from x86 perf tsc: Add rdtsc() for Arm64 perf tsc: Calculate timestamp with cap_user_time_short perf tsc: Support cap_user_time_short for event TIME_CONV perf tests tsc: Make tsc testing as a common testing perf tests tsc: Add checking helper is_supported() tools/lib/perf/include/perf/event.h | 4 + tools/perf/arch/arm64/util/Build | 1 + tools/perf/arch/arm64/util/tsc.c | 21 +++++ tools/perf/arch/x86/include/arch-tests.h | 1 - tools/perf/arch/x86/tests/Build | 1 - tools/perf/arch/x86/tests/arch-tests.c | 4 - tools/perf/arch/x86/util/tsc.c | 73 +---------------- tools/perf/tests/Build | 1 + tools/perf/tests/builtin-test.c | 5 ++ .../{arch/x86 => }/tests/perf-time-to-tsc.c | 13 +++ tools/perf/tests/tests.h | 2 + tools/perf/util/jitdump.c | 14 ++-- tools/perf/util/synthetic-events.c | 8 -- tools/perf/util/tsc.c | 81 +++++++++++++++++++ tools/perf/util/tsc.h | 5 ++ 15 files changed, 143 insertions(+), 91 deletions(-) create mode 100644 tools/perf/arch/arm64/util/tsc.c rename tools/perf/{arch/x86 => }/tests/perf-time-to-tsc.c (93%) -- 2.17.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel