From patchwork Wed May 4 15:02:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: German Gomez X-Patchwork-Id: 12838040 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 73CB6C433F5 for ; Wed, 4 May 2022 15:03:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; 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=4J/dGjUIT/nzMQGUDTuQNybKK+W8syIfOXUVYmFCvKA=; b=aShxh+or+MNWAG tZ1LzK4NreP+pBMDWy+Kkw2hE87gbSCEKvyAHKohLAS4MXmcS/zCqxmZzMpRxP48CAuMa3WEW9ko3 el4Pd7PRKWxOzgKa5koTqjiO+i/UaEZ5u12gdBeUa4jXvpJXRT0qfObu+uY4cXxVYv1xqqpR+Oqry iH+5Ay+YuXHXbSsC9kGjeFwkCSDD0dmbO6IKjnanhIgTbM5Ogko7d6eUhahOP/McN6prkBoutGvC0 MztHEV2W1EHRDI+3zCl4XLygyksEbhqkonKgW4rUOfFeMRXocif6YfweDrVWLK9zgg3bBSNCx6Ujx zIcb1MdZAWIp/4jLvfKw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nmGWT-00BKQF-3S; Wed, 04 May 2022 15:02:37 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nmGWP-00BKOF-F1 for linux-arm-kernel@lists.infradead.org; Wed, 04 May 2022 15:02:35 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 492B11042; Wed, 4 May 2022 08:02:29 -0700 (PDT) Received: from hype-n1-sdp.warwick.arm.com (hype-n1-sdp.warwick.arm.com [10.32.32.32]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 2A4E13F885; Wed, 4 May 2022 08:02:27 -0700 (PDT) From: German Gomez To: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, acme@kernel.org Cc: German Gomez , Mike Leach , Leo Yan , John Garry , Will Deacon , Mathieu Poirier , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 0/4] perf cs_etm: Basic support for virtual/kernel timestamps Date: Wed, 4 May 2022 16:02:11 +0100 Message-Id: <20220504150216.581281-1-german.gomez@arm.com> 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-20220504_080233_585896_0C1DC6E1 X-CRM114-Status: GOOD ( 10.23 ) 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 Hi, This change has a soft dependency on [1], but assuming the name/location of the new sysfs interface (ts_source) doesn't change, it should be safe to apply. The new 'ts_source' interface allows perf to detect if the timestamps in the trace correspond to the value of CNTVCT_EL0, which we can convert to a perf timestamp and store it in the instruction and branch samples. Due to the way the trace is compressed and decoded by OpenCSD, we only know the precise time of the first instruction in a range, but I think for now this is better than not having timestamps at all... Thanks, German [1] https://lore.kernel.org/all/20220503123537.1003035-1-german.gomez@arm.com/ German Gomez (4): perf pmu: Add function to check if a pmu file exists perf cs_etm: Keep separate symbols for ETMv4 and ETE parameters perf cs_etm: Record ts_source in AUXTRACE_INFO for ETMv4 and ETE perf cs_etm: Set the time field in the synthetic samples tools/perf/arch/arm/util/cs-etm.c | 89 +++++++++++++++++++-- tools/perf/util/cs-etm.c | 126 +++++++++++++++++++++++++----- tools/perf/util/cs-etm.h | 13 ++- tools/perf/util/pmu.c | 17 ++++ tools/perf/util/pmu.h | 2 + 5 files changed, 221 insertions(+), 26 deletions(-)