Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1800484pxf; Sat, 3 Apr 2021 00:27:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8Mvm5o+Y50DeWKHii6LduN3dQIeIO+mmwgzSsGsQU6P4k+sVfF7aKrhFxzyVW3GESXy20 X-Received: by 2002:aa7:cf16:: with SMTP id a22mr2562687edy.267.1617434855341; Sat, 03 Apr 2021 00:27:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617434855; cv=none; d=google.com; s=arc-20160816; b=zf5AleQt0O2xbZyzOFph3RN/+jIg35tbbr0GJBuVKTSUjfnXGiWmYwOFEFxxh3npJ+ sJ/XJYNqlTBfrpxkQKS/gbgEOUIMNyQKQtbpMRcXbgcHFyS56bpNtMDdddlgbfOr9Ir+ G0wncN+km6DT+95738eiBvabbMaOJ8OztlZH8NQVvHlxIvTV7kInrH0511ky+O8t7lpJ DN+qFz8ljQboVUIj2Rd2qrYeVypUEeGWUZqyk2P/ze/6qrZ1lXKKpceHskHmmMxBrZAF 9XWkfsremNfUH+fm/vM4R73wKjm483dDal0mBLO50ST5EjioioC7kqFPCHyTuGDZs0g6 br0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=rvWLuPq6mG+ewzJDl0OTtXQFVQc7oQ72INsuecPbdF4=; b=ASUMgjYupar7buLlorAlgvWVjL1wKm812CgYx87wDn6JqqlJAqYXdxGR0g6tZ8nf+/ sPgj0saiJZC0BCnqlGIVhfTdLTXMb25qgFS3RPN784uo6+c61mY+k+Cs7uHc0XaN3lm0 V7+VG+3iQn8B/+/EO9nyq+WLoIlVregktbrWlgGpsGK+VQozTQrfcEKbl5cGflPE/mVu 5gClW13vjmvopiACwPUVA6KWQNRGr6aATVtSgL5Wnaab2/RYr/IpvawSOvMk72sCz+w1 VkkRvDsmyAl8G9s4IjazcChPvrlGyrdkSsN1xwIpC0urfR4JZdEDz8NbmyXHqH8mt8Si TJKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="tX7xn5/o"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dm24si1519910edb.297.2021.04.03.00.27.13; Sat, 03 Apr 2021 00:27:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="tX7xn5/o"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236568AbhDCHYS (ORCPT + 99 others); Sat, 3 Apr 2021 03:24:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236535AbhDCHYN (ORCPT ); Sat, 3 Apr 2021 03:24:13 -0400 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC5B2C061788 for ; Sat, 3 Apr 2021 00:24:10 -0700 (PDT) Received: by mail-pj1-x1031.google.com with SMTP id j6-20020a17090adc86b02900cbfe6f2c96so3513596pjv.1 for ; Sat, 03 Apr 2021 00:24:10 -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=rvWLuPq6mG+ewzJDl0OTtXQFVQc7oQ72INsuecPbdF4=; b=tX7xn5/oAVWZT8agnPIKhUsVwa+y5tH32C6rhMrC3xd5XV4Q+qt9S/LeU83NswWFnF BO17gDAwrOPBKEUweyzdJ/Kmx6wsuSIDwHNFkERh51AUuhm6cBLGxlIAlOFyHxN3RozS VqU6BSgchRjVwawbu2mq65GSXYHHb3neOiALkBx/rm5LCJsOeA4lgYleY+Co3J9GrKrf 4KY6rXVmBpNbigxZzGbMrKB8O7VhcPpwGMAaHv9Smw3sfDDQmTeqUyv/ZPWM+F4QGEqm /ObZH18FoGM7RkwXLVI6abs8JQxQC1Ioi5NqNgJVHGVIl98opZ/ZcXuxWM6tHFo+Tz1/ Iz0g== 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=rvWLuPq6mG+ewzJDl0OTtXQFVQc7oQ72INsuecPbdF4=; b=PpBzOKxP1g8+VMFI5nz6tpbvz0rojBJ2+dLj5M69SpyNRdaHODJUqdGV3toOZiPJSx F2bPV/osQU5reIruqnWvUlTAGi30mkBlP2UmhZ+iAPF3i/HKjQAPBL88F+LvyfRp+beX 4o3adtNqI5WVuP/VliSFs3fypYsb9NKYqsPN1j15ShrezbC+Bng+2s0hKiBWbo46ArEN iKKmiqQ0U9S3ibIPkG/bkbuw55Vp9DYGv+gm3sUK1cf2uMabRik6JpD+o5A5URLQDbaO nuJxx76efEBOJX3OHddZsKDQc2OAg9TuSrzSIoqlrfNxQ/gHsllUPWWVhb/lKh2jkpyD /6MA== X-Gm-Message-State: AOAM531rF77NzMfG1v6h0Zw5N6rQtjOFnoUa5BbRkKX1uo8n1Yz2yY5W MTSUn5XrULtQMUXeHwNb4X/iCA== X-Received: by 2002:a17:903:31ca:b029:e6:65f:ca87 with SMTP id v10-20020a17090331cab02900e6065fca87mr15860056ple.85.1617434650389; Sat, 03 Apr 2021 00:24:10 -0700 (PDT) Received: from localhost ([116.206.101.232]) by smtp.gmail.com with ESMTPSA id g12sm9964387pjd.57.2021.04.03.00.24.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Apr 2021 00:24:09 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , John Garry , Will Deacon , Mathieu Poirier , James Clark , Al Grant , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Adrian Hunter , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Leo Yan Subject: [PATCH v2 5/7] perf arm-spe: Assign kernel time to synthesized event Date: Sat, 3 Apr 2021 15:23:44 +0800 Message-Id: <20210403072346.30430-6-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210403072346.30430-1-leo.yan@linaro.org> References: <20210403072346.30430-1-leo.yan@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 4cf558b0218a..80f5659e7f7e 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); -- 2.25.1