From mboxrd@z Thu Jan 1 00:00:00 1970 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 C8D76C43462 for ; Sat, 3 Apr 2021 07:24:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A3BCD6120D for ; Sat, 3 Apr 2021 07:24:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236574AbhDCHYT (ORCPT ); Sat, 3 Apr 2021 03:24:19 -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-Google-Smtp-Source: ABdhPJxanVXpAQFgwaMGIhmdXHhEZKjGzhZ8f75RkjD1K6x2+w7vrg3X6o8b/y7VVUEy484jWX/IaA== 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 From mboxrd@z Thu Jan 1 00:00:00 1970 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 82703C43461 for ; Sat, 3 Apr 2021 07:26:17 +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 13ED861208 for ; Sat, 3 Apr 2021 07:26:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 13ED861208 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=dy7B2l6++WAHfypW0H7D6bOTn+1vCX1Wa7sScSPb2eU=; b=MO9U8IGhAgQXS/5pFb18qrIXH tyr6C42OmsseQXAxgZhRf124yIYSqpyzLG5BKPymT7+POQiKCdM9+ubad6EacOgUI/8nkrDXbfpQM Eq5MnxKx3VQrAOhgatwb+qyLMnjOe9QioPnf0BJy4NLWGnB0xvo81I/MlHH6IakGgG2XslqFsfbEV O2EcedLqrz1ISmBu3VElk9Vpr/5AQQ+3Nx3npFvhk7sIS+zlJT/Ljbg4rP4R1cr8Ir9Gh0tu7w61T QPEIjyYtVHnqly+bU2Wbd6O18dCQmbbGBS5kYFwuCqpCR6sw7EWr0EVh6or4yjddWMlVK+X6oMUIG FnSXDE+0A==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lSae6-00EPRD-Gz; Sat, 03 Apr 2021 07:24:38 +0000 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lSadf-00EPKd-QF for linux-arm-kernel@lists.infradead.org; Sat, 03 Apr 2021 07:24:13 +0000 Received: by mail-pj1-x1034.google.com with SMTP id q6-20020a17090a4306b02900c42a012202so3490786pjg.5 for ; Sat, 03 Apr 2021 00:24:11 -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=i+2EzxJhQvCd5hqPOt4pR1N6J6dYXaNnQqEp+SnkOlj1H0bd8WwL+1kwDPzoPXYZzF 4oy6f8Tgs918cu5PvrKWiMzVadkZpLIIffv17r1KF5gA2jiW23bSFn0UcHzoIc740bN0 +ldqfbpJY0qRIUem0770LxbRdcRrcQxbz2Ijd63Uf8K4omZA4N9AEkiRRdIMJkc5n/WW v8cEoS0Lhd94b0jz1oD9247oPSN20fDnwZg6xlDOGQRWwFGPFGKF/S6Bie9OIVmDqHRQ KI7ds09r9fHlYLJ0Ua4ia0Nv7EhTnv2NFUKTXf7ihSMKaIu8Z5NW+3d00IEpvNsJx9OC 7AjQ== X-Gm-Message-State: AOAM532V98aRJV4feDvmgqHF5RYyF1IIGkKc6VnLvkKo+QPLaEbYtGK9 ak81DTq8EtpnGtL9I6SdJ2QSYw== X-Google-Smtp-Source: ABdhPJxanVXpAQFgwaMGIhmdXHhEZKjGzhZ8f75RkjD1K6x2+w7vrg3X6o8b/y7VVUEy484jWX/IaA== 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210403_082411_903091_13A59029 X-CRM114-Status: GOOD ( 15.95 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel