From patchwork Sat Apr 10 05:00:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 12195343 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=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, 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 775D5C433ED for ; Sat, 10 Apr 2021 05:04:48 +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 1F9E86115B for ; Sat, 10 Apr 2021 05:04:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1F9E86115B 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:References:In-Reply-To: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:List-Owner; bh=2U8qcdCj0KsVSJi77A9UhNVOS7oZ5GXZQ6hhRGN6H4Q=; b=ldOxAGqaLKhlRwpvrVmTXh7Yn cA44Je8xQjipvncdNu6Ti22qJbLIEQgtrbAd6whmabBVztjN6HSbaJ6poFj7DP8TGPyZLUujjp43H c5KSL9lFdkDJwmSmxqkI0i/vIaoQS2itiQjKB7GCSSAg6w8iFk3NDY/LMIh0cUuUo5NrWdY6HYc+y ObH+xb54soL0RimeXL2x2P0maOavTtyk2i/l2DJpRiGAkLnzQvKo2Bo+G8aAV+cY+aRiopoWQZGpU WqmK61HmHZUcN3HfwOnnSzhtCIPTRRbnG46EikLJGBcfN56bIoo2iDX9OnYTyVpuyP76At7T/PD6G 5aXgnZNEA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lV5lq-002APC-0P; Sat, 10 Apr 2021 05:02:58 +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 1lV5l4-002AJH-2g for linux-arm-kernel@desiato.infradead.org; Sat, 10 Apr 2021 05:02:10 +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:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=ldonlZ9vwUBTltfCI1GiIsYf2KMOuo8USr97TAcSYMM=; b=z4xftUIuD2S4TdFga9zVptd3MM NoXJUQefi2xiIPq5TSfcyV/UPsv8XRs3os8F+f8RrqseGnUfN6QStbFSCERWcRErpJbcIkA8zMcJY gka8Oywjudjq0WUTJRCmW1RVtJh3EOGuTyDukXW7oeH+KJ0LOxV0k9oj5spAgzr/bec4Clg29TVid xum/T0nwYCOywXZwh0t4K1z9IRqQILcipCJxsZ/by1pP4srAgW781KyuOzbgAeRUIaRYp/0D29mv6 i5q3UmEtsBif5wqsxnMbZiGJ2pUSHMyv7HCzhM4Mnw6e0hBoDcDKFcV7WP+NdeTtifU+QaF29bq6W DmNsmerw==; Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lV5l1-004w2v-Mw for linux-arm-kernel@lists.infradead.org; Sat, 10 Apr 2021 05:02:08 +0000 Received: by mail-pj1-x1033.google.com with SMTP id r13so102603pjf.2 for ; Fri, 09 Apr 2021 22:02:07 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=ldonlZ9vwUBTltfCI1GiIsYf2KMOuo8USr97TAcSYMM=; b=bjtDPNSTZO0aYZ6szvGPFul2u9l0UGtVTr0fsrIW0qLHl+vyvUt5AdgJ28cKf18QJD EZZGou8FY0gOzpgucSM2oSKCujcH8syC6a5HJqpQqIuVG1iCO8iK0ljVohnrxNpOajP3 +PYOpKVAegAAXLDyC/HENvHS55X1rzDRjMfZ2U2f0bPCXHD/ndNskdjaz4piHxFkfo8u J32FYP2PmyW/k3Szsi+puuRDB15/e+qXZle8J3yNXW068FcdBC+U3mYzLGqO8Uxi22ks nu4Qkf/NQGupFwDfpgFN0ILKL6nVHF0bo2+ufLPA8WOgZmS41YlESNmuNANYIcUkuJbl Y+rw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=ldonlZ9vwUBTltfCI1GiIsYf2KMOuo8USr97TAcSYMM=; b=fPB2DuPaHthauRZS/L2aYzPuMJiPE+W9N/03ZqTCvGSfGb1V4XN+vTnYwsN22qFNFp xIGRpgvWQ6kmSbuQyO8DrJt8zxlMpTkOrBpYX0yTWpZDY+tnK8IstELnvxv85Kk7RVjC HtjQA4JvS5gWBIRV1vpUHC6clSX+LV9QAI6o3KQWuLSIjjRPvDGwoAibYEnCXhEqrT47 jS3LTJ7rFm9Enk92fz8NDT8FBKjQgb/N9GHggkVnagva9z8DteMqvsypctQ74vyB31Zm zcutlpGysBcDYcaehusqmlW3ofS2WvuZdsJY9K5Yjm69205FUd2z6z2CmGwGiKbqRi++ jtxg== X-Gm-Message-State: AOAM532oJbYYg0EqYnr87Uh0DvEviAq43frAtEoucDCYXx8/Ae0e5Nno V0NFlMuEM9A2XSdZpB1lWO6ODw== X-Google-Smtp-Source: ABdhPJyyi5ok+gdSArX8iIPD5OsC8Noiegn+PZFOSCbd3tpHsLX04I5N3GHQ3deKmp6BSCQ7+hKL0w== X-Received: by 2002:a17:902:7594:b029:e8:c21b:76aa with SMTP id j20-20020a1709027594b02900e8c21b76aamr16120415pll.37.1618030927227; Fri, 09 Apr 2021 22:02:07 -0700 (PDT) Received: from localhost ([116.206.101.232]) by smtp.gmail.com with ESMTPSA id c15sm3608092pfi.207.2021.04.09.22.02.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Apr 2021 22:02:06 -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 , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, James Clark Cc: Leo Yan Subject: [PATCH v3 4/6] perf arm-spe: Assign kernel time to synthesized event Date: Sat, 10 Apr 2021 13:00:44 +0800 Message-Id: <20210410050046.5394-5-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210410050046.5394-1-leo.yan@linaro.org> References: <20210410050046.5394-1-leo.yan@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210409_220207_765365_BED699A5 X-CRM114-Status: GOOD ( 15.87 ) 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 In current code, it assigns the arch timer counter to the synthesized samples Arm SPE trace, thus the samples don't contain the kernel time but only contain the raw counter value. To fix the issue, this patch converts the timer counter to kernel time and assigns it to sample timestamp. Signed-off-by: Leo Yan --- tools/perf/util/arm-spe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/arm-spe.c b/tools/perf/util/arm-spe.c index f66e10c62473..ec7df83b50fd 100644 --- a/tools/perf/util/arm-spe.c +++ b/tools/perf/util/arm-spe.c @@ -234,7 +234,7 @@ static void arm_spe_prep_sample(struct arm_spe *spe, struct arm_spe_record *record = &speq->decoder->record; if (!spe->timeless_decoding) - sample->time = speq->timestamp; + sample->time = tsc_to_perf_time(record->timestamp, &spe->tc); sample->ip = record->from_ip; sample->cpumode = arm_spe_cpumode(spe, sample->ip);