From patchwork Mon Apr 12 09:10:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 12197321 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.7 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_NONE,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 6E428C43616 for ; Mon, 12 Apr 2021 09:12:56 +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 0E6ED611F0 for ; Mon, 12 Apr 2021 09:12:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0E6ED611F0 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=zo1Rb90wOgzJ3lqC6/trZa4RHpIcgX2Qk//GiAaoUKQ=; b=EF+j4ZEUlSVmV+ClCYNBtNaj+ ipleCSlspdhAfhPAzTy2ivSpY7PbOiS9zOuFF4M7eO6Ar4IRJa4tWrfTstJIkf7uHdmtgaWJCfLaC YdYCYl8PZ1I9HsyiglRhS9ETSyVpTNdZNUsXS7bitKAMVZhq4sE4fyP9iX8/An32FPhlzribV6Mww Z06h4QdkZ6n2c5FfoLdAYojrxrTlZlIJtsRfVbuChWJjuoJDZEOsyqukxGscP0DtRCYdSFQFDqTAN vjzfA/27M1q4C9/hdz7QgdLgBNj/Al5DpX0nNCtOwMVPjZ6HDJjltpgHEWWmr+oRz3ZpEuqZXTVcw fbIOgoHHg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lVsbF-006Dk4-Cg; Mon, 12 Apr 2021 09:11:17 +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 1lVsaa-006Dd8-Ot for linux-arm-kernel@desiato.infradead.org; Mon, 12 Apr 2021 09:10:37 +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=zseEPnoUr9ivu9L6FxmsLFtiTUN3E67cPG71UQDkec0=; b=NsPuIXn/BKQ1A9w4bkzGy8MZdE fBID6mDl0OG5irQTK2f/QSxmL3kzb21Pi/zQHHALl3mg2Rgy1NXg7z1mJHqnVp66vbwPUq14BUXKE mzm+ypeE6bPUYvMK2L6Lv1fgxLZOTHSzBH519lMgKO5KVHor6dQ/2Kp87ZucY3K0Nz4lTHc+qxJtH 4Ge9SAQlmkh+KPZOBucnvMfuOO1F+Xe6LrOsevxaBNQBtOOw1zoEv5ZJ3NvbLShFIvcDNyGf++P3E j9/J9q48ppf/R8bsRkr6ZFFq96AiQJlgLLXoMIN5FiPUKR9+FzbHiRzwI2a6HL+igyqDi0O0WT38V /aEc17jQ==; Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lVsaY-0061xY-D9 for linux-arm-kernel@lists.infradead.org; Mon, 12 Apr 2021 09:10:35 +0000 Received: by mail-pj1-x102b.google.com with SMTP id t23so6301752pjy.3 for ; Mon, 12 Apr 2021 02:10:34 -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=zseEPnoUr9ivu9L6FxmsLFtiTUN3E67cPG71UQDkec0=; b=kZfP6rjyHgMWhhRNazBI/9RKNQZdRwp8nK8lC95bIf4FpXRQfoQSyXGUIl0Sd8rB3t Ipd0ytq59oqBvZ4XxXjLlD9LKcTJ/aU5AQUdaenYpVmiufcEaA/IUZcijD+dPB6TFdNe cNbh5xXPUxBSaTxlGTqFVMMzOo1oEHOQu3D0XvxbnhpjirTFQRt5aI8KLmf4bjlYyz8E 7GG4zghzwU3vcaFkNtIz9/EEirAkblRh9y72ZfmthwjJgoW0S2+x6+NI2vtUgEhlxiAA ib6izNmX0aNJxiN3b3v98Nu49iVftG5uRij2DHDcqsIjNV3KkPoJo9b3FhlCA7otzZSJ Hirw== 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=zseEPnoUr9ivu9L6FxmsLFtiTUN3E67cPG71UQDkec0=; b=Bs4KU9WKQoitWq72///1TiLlPvRyE/srIwAbrqlKKS5vSIgyvIhCNbL8zkrXNOINRa S/xe37NLbQLLoBWZ4c4x4TMAHbs1mToZixNX3Lhb/3yexwehM4RDtJGQVuSEsDIlm1pk SsH924GLSkqWbDT3dkYwxQzdwqhcR4zQRJyB0gBuMwMnLJQXYTN4XybVMhfw+FaFAJ0S OQ5WSJtpPYxEBN9cy3MNrTbtQ0ucYCR1jbQWb+IxElp8fi6WjyINMQwEVm7NAqJ/BAKX 3Z7jWCrC3g/a9xbfcXNYhZSiXqH2/750XZ7yF8RumYm44WA8j1YRbwVDEHC3wmUbHNdA UbXA== X-Gm-Message-State: AOAM531xkpHPrXRydv6paZqsweuYtKvZmaGEPqdGsN4QzuLj9mKC6aQy hScBK0dvbhQWadMrCodLOpvmng== X-Google-Smtp-Source: ABdhPJzZWnu4/cFrP8wRNIZ4ptmoUt5/TxqUA/lg4X5nmYbGhoMmSBkscDQ2fPhKcQaMM5DwOGZjNg== X-Received: by 2002:a17:902:6946:b029:e9:4dcc:9966 with SMTP id k6-20020a1709026946b02900e94dcc9966mr25591582plt.6.1618218633589; Mon, 12 Apr 2021 02:10:33 -0700 (PDT) Received: from localhost ([116.206.101.232]) by smtp.gmail.com with ESMTPSA id n16sm9211548pff.119.2021.04.12.02.10.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Apr 2021 02:10:32 -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 4/6] perf arm-spe: Assign kernel time to synthesized event Date: Mon, 12 Apr 2021 17:10:04 +0800 Message-Id: <20210412091006.468557-5-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210412091006.468557-1-leo.yan@linaro.org> References: <20210412091006.468557-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-20210412_021034_449792_A927AAD7 X-CRM114-Status: GOOD ( 16.22 ) 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 23714cf0380e..c13a89f06ab8 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);