From patchwork Mon Dec 21 08:35:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 11984347 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,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 02CE2C433E0 for ; Mon, 21 Dec 2020 08:38:43 +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 B833A22BF5 for ; Mon, 21 Dec 2020 08:38:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B833A22BF5 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:References:In-Reply-To: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:List-Owner; bh=slvIN7kuC0QBP2TaTZky0Bb3oqMKR5zcU+8x7Xi6nEg=; b=X+rydKUVl5s6TVNFPCKOEwOczG Q+kHS7xX3UBcTpXOiJlnWWwmt/LwW13SZlITOQMd+TLCkYhjP+4Xi7rds8B3pRzxsqueG44GIhEIM T0OHmdG9+2F41rt39nwvCnYve/4lPUpH2wOorn7h/GoymXZljUanCyoIqPcZ3XVwwigBNHs94aiv6 6P/n8a/qDekXWMJkBgZDErNKkYPsy1WXQF2BAeYhBd1XZfYG3ANV+ND26HjIdOYCqpRXTqmSn5RLL n6JLlGBpt7tspwq2b0Ayw4CE7IXLgGHDXM2xEXdSvih3+qD3KG1PMCZZmP2yqIOsWq9ppxeA5mEf5 v6Au2SBQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1krGhC-0008Vd-VI; Mon, 21 Dec 2020 08:37:35 +0000 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1krGgu-0008Po-4d for linux-arm-kernel@lists.infradead.org; Mon, 21 Dec 2020 08:37:19 +0000 Received: by mail-pj1-x1032.google.com with SMTP id lb18so5755634pjb.5 for ; Mon, 21 Dec 2020 00:37:15 -0800 (PST) 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; bh=cQl+8W7T7tTQ1cOiJvQBRsmZmi9EppC/6vnqtfyVSUo=; b=CoQJxfdSlQKurIlH4UcSoiA0bl+E2TeAHgja/GCSohC2Y8Pp/5OTOb2fPizlZc78o4 2U2CaJIyLiWURMjNj6xP+OV7ro3I9YtWF1uSo/8oqSm2LB+/FIVixeHdDWWyikkMzjUP hTYBcQC6bZxD2NAtaypG18U9Nvo4DlpEQuDsAuAyvcnLXGdULZe+51NVO1LtMW1qZvrv AaR5/+bqDZ8lsGEQLsu9c9eP/inCQ8T2q1jVFlSGv+oau2yWV43ZG0WvBFobby/+HDDK zIJRss9AQCDDSCs4ztNPsyhTKcyWwSoP7h2+QWjwFYlYitJPYAvxabaMdcmyXUUBg0Uu ushA== 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; bh=cQl+8W7T7tTQ1cOiJvQBRsmZmi9EppC/6vnqtfyVSUo=; b=cxgZSWvvbaqp8yXyCdl0Nwo0WrhJ0yvOBGXBChk3LTGA7eapRD2h/z5ohBBgHt2tk0 Ym1VusME+EcYzV9Uc6AnBlsvKMEiJrqR3aOT4IBMCTYHE1yguPVL37gCATNwCzNsB75x IdS7xF9EHp/wQJTYZo8LJrJF7MRg7D/7K10YQeJ/KflJcGDJQEQmghITQg23MHsOu2Nd +nDkVI4DvdgoX9AQq5mrSUlslRLageZVYa7sXJGzmF4Q7GsUQfHpX/vigqydERbUhQB8 Dth5gwID24Nb6RBQnJG+2NQW1swpDKa3LaQppMCD+MZh0ixzTYUbA12hWBLm5NOanSPF db8w== X-Gm-Message-State: AOAM532sKWUAs1W1y9z0zxvgVeZQindI8aADcczo+uayZDu7NxM3E3xo TgYDROw5x1MY1mzcOipfI2U3IQ== X-Google-Smtp-Source: ABdhPJzBx2ixz0DbLN07bvvSew+iXdyFTT5mNnybYL6qzxpsITIhlTqZJErQWoYJwH9yj998yoGvYg== X-Received: by 2002:a17:90a:c203:: with SMTP id e3mr16360060pjt.8.1608539834196; Mon, 21 Dec 2020 00:37:14 -0800 (PST) Received: from localhost ([45.137.216.7]) by smtp.gmail.com with ESMTPSA id gb9sm1002019pjb.40.2020.12.21.00.37.13 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Dec 2020 00:37:13 -0800 (PST) From: Leo Yan To: Arnaldo Carvalho de Melo , John Garry , Will Deacon , Mathieu Poirier , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Adrian Hunter , Ian Rogers , James Clark , Dave Martin , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 5/7] perf arm-spe: Assign kernel time to synthesized event Date: Mon, 21 Dec 2020 16:35:55 +0800 Message-Id: <20201221083557.27642-6-leo.yan@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201221083557.27642-1-leo.yan@linaro.org> References: <20201221083557.27642-1-leo.yan@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201221_033716_315413_ED8E4868 X-CRM114-Status: GOOD ( 17.60 ) 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 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 bc512c3479f7..2b008b973387 100644 --- a/tools/perf/util/arm-spe.c +++ b/tools/perf/util/arm-spe.c @@ -232,7 +232,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);