From patchwork Mon Apr 12 09:10:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 12197229 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=-11.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 718B5C433ED for ; Mon, 12 Apr 2021 09:12:08 +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 D444A6137A for ; Mon, 12 Apr 2021 09:12:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D444A6137A 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:MIME-Version:Message-Id:Date:Subject:Cc: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=PRLPM1PKEtTujh7CSnrZG+Pw/ZNg0guIlGwX2+22FoA=; b=VT9cZXCzSJ3nf7xpYfrenms3Sb RE+ntqNTzLjCMAsUyn8SZOxaGNQbwweo9skiYhUAg5TpTHOtLrFdkzNq/pTKsqUYH0aI5QLTBO/0m 5PLoiwJKzDLlYh53j6P53UXUThXVXJouIiAYjY9nF0SarcmDvTsSvbWJTWM6fO72oVhqtaGuSPjuG KTf9lZGVlUEPv950WEDd5GepDcSUJ/HUDrAX17ZJdYW6/u4zg373QGW539dEZ/FiXkxfHy9GP+r8Q b4qHF5Ior+yyMk66J8A35MpAs/wrQiW1n0NAYVMvkB93e+URFuLAoi4oDvy86T37VTktjGkdUgU3B McTRzEhQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lVsaT-006DcZ-IB; Mon, 12 Apr 2021 09:10:29 +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 1lVsaP-006Dbk-1L for linux-arm-kernel@desiato.infradead.org; Mon, 12 Apr 2021 09:10:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=3QeA4bIK5GaZsi48yUhmbO7fOznvzIDvWJ10aqKKUg0=; b=ZKkrcRjepif8Q2eRG+6WEjk3Yt 9Q52XBMYZb6dmj3D6CoN6INVRoZNAMJQJZ31wktM7UwLg0H8OftCAO64aC+l78i35BM/3fte1Go8Q sJrLVS0oyPtUIKrdzQb3HvrLQ1LiO+ed/XSE6inHELC7coyHW+RDmjYCNUK0mY7LekTdrwHxqWVVt qB1PQVGAmLitf/PlEXomcOXdRDTukhYKScT1+sESiLfXWgMqmL3co0yC9uuvHJwFE9GPeTKgbVcMo TFgMr5yR/4uy0R+kNzPM8nBQU7cmxqzITWvNYwTDs0rD5Gfn10YVXPaDA0rWnV1wDBp+S+hBVcYYe gbsXU6gA==; Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lVsaM-0061v8-4P for linux-arm-kernel@lists.infradead.org; Mon, 12 Apr 2021 09:10:23 +0000 Received: by mail-pg1-x534.google.com with SMTP id d10so8862039pgf.12 for ; Mon, 12 Apr 2021 02:10:21 -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:mime-version :content-transfer-encoding; bh=3QeA4bIK5GaZsi48yUhmbO7fOznvzIDvWJ10aqKKUg0=; b=vt2TktJL6sP6xFjdFxGR7uglI/UC0Owncgl8oyIgcTZouxROhQ4JVSQBQ4nDOL/4Qj I8slMZbYCulDkKW2d+RvBuWslqB0rQ9oQ0Q3uOyhPTlaw6kaNamGmyqxKFmp79aZJtWH 0HwAxCww3+LRgwE4Y3/RdPoNUHfydxxQzUxPlMF8C0C1l5OArPdsi5zWFbgUv+SZbPMV GhBS2qouSqcjPaz3ed9eeIROs6d/FECR31NybBYArkfO9Ffr9OkTD/bUE6rGGvQbhToH WKmoOYCrtdKmQgpkacR5WWXXkZrdi5v5uS4w3fk3XaUvAa1gqSy6ExTgfugTODb7dxbH xJXg== 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:mime-version :content-transfer-encoding; bh=3QeA4bIK5GaZsi48yUhmbO7fOznvzIDvWJ10aqKKUg0=; b=lLvqNWm2HspmgMpKx6qP6rCymlnAlBags2h0t4ktpibt89cKV2mGqrYx40AdoNGKtv 0TxJrK5GMXfwNuT7jfzSPcu40dGdOxb9U/AJgKZIFtbf9sXupcL5bdnc+jyGXyBUFhJK FGa8B0DNMe58fzRClrM48P2YftH1nlIyC+amFTlP5ZmVU61VB/thfQT3TnAzpf410vN8 X14R85q1H4JYHTFtStQzzeRdfld6qd8GmG8f+kXQsy2CWuqthulooc6SnpoCiV6ORUKP V6o9HgaZN51EPyzX+1xtoqU8kW34bk9pZ0TFyZbDJLoNttj1QaoDDa17RvU12/Yzjt+i uKjg== X-Gm-Message-State: AOAM530HdymaWcotpmM7LvVq8GhKz+63b4vG/yLrJ1y9EiXVyYEJN7Ig 3PlY7zqCHjvtoYVFvpbvcYLun4SgUBR1Dt1n X-Google-Smtp-Source: ABdhPJx0D8tER8JD0nOmci8alet46I5dGHvx0NScfJNBsS9ElKisGVU5VVvwo9X10yefzRdfZOZiaA== X-Received: by 2002:a63:77cf:: with SMTP id s198mr25996394pgc.252.1618218621208; Mon, 12 Apr 2021 02:10:21 -0700 (PDT) Received: from localhost ([116.206.101.232]) by smtp.gmail.com with ESMTPSA id l10sm9231324pfc.125.2021.04.12.02.10.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Apr 2021 02:10:20 -0700 (PDT) From: Leo Yan To: 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 , James Clark , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Leo Yan Subject: [PATCH v4 0/6] perf arm-spe: Enable timestamp Date: Mon, 12 Apr 2021 17:10:00 +0800 Message-Id: <20210412091006.468557-1-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210412_021022_229496_E139FBB2 X-CRM114-Status: GOOD ( 14.71 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This patch set is to enable timestamp for Arm SPE trace. It reads out TSC parameters from the TIME_CONV event, the parameters are used for conversion between timer counter and kernel time and which is applied for Arm SPE samples. This version dropped the change for adding hardware clock parameters into auxtrace info, alternatively, it utilizes the TIME_CONV event to extract the clock parameters which is used for timestamp calculation. This patch set can be clearly applied on perf/core branch with: commit 2c0cb9f56020 ("perf test: Add a shell test for 'perf stat --bpf-counters' new option") Ths patch series has been tested on Hisilicon D06 platform. Changes from v3: * Let to be backwards-compatible for TIME_CONV event (Adrian). Changes from v2: * Changed to use TIME_CONV event for extracting clock parameters (Al). Changes from v1: * Rebased patch series on the latest perf/core branch; * Fixed the patch for dumping TSC parameters to support both the older and new auxtrace info format. Leo Yan (6): perf arm-spe: Remove unused enum value ARM_SPE_PER_CPU_MMAPS perf arm-spe: Save clock parameters from TIME_CONV event perf arm-spe: Convert event kernel time to counter value perf arm-spe: Assign kernel time to synthesized event perf arm-spe: Bail out if the trace is later than perf event perf arm-spe: Don't wait for PERF_RECORD_EXIT event tools/perf/util/arm-spe.c | 74 +++++++++++++++++++++++++++++++++------ tools/perf/util/arm-spe.h | 1 - 2 files changed, 64 insertions(+), 11 deletions(-)