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=unavailable 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 E9D1CC433ED for ; Wed, 19 May 2021 07:19:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C23B161040 for ; Wed, 19 May 2021 07:19:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239754AbhESHVR (ORCPT ); Wed, 19 May 2021 03:21:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239522AbhESHVO (ORCPT ); Wed, 19 May 2021 03:21:14 -0400 Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13333C061761 for ; Wed, 19 May 2021 00:19:54 -0700 (PDT) Received: by mail-pg1-x52e.google.com with SMTP id k15so8798068pgb.10 for ; Wed, 19 May 2021 00:19:54 -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=VF7HOk9FnOo7p3niyuc/ZeydcOUyPtyVd5u7rDmQFT0=; b=EM5liwyzntU9Cj0R9VZ/vTntNwcOgx+IqSmnrR+4qu+Wk0p0ypqYuTODL2r5OW+9jq FiHKDrnpQ2Nv5WEbqX7D8qHVtUg7h0qQRT7ja4Or4opgEGILz6r1Ih1tSn12ORGd3tjP mNVBoF4yHFUcANpACuFQXyA6jafxUCIpMPrNXBr8+alRZymbhzvD9gzGswmajl7qDhwG dIXe5+nLkP5ej/gxj08Nnl+oEayMo/dg0ZCDrqQyTksVlb/RudCXIztuNU+SUcFe12uX D6dueLH6R+wV8lCI93Z0nxFTWM5UMYEdvR5NdW4bc4GdhmQqeuSmoWy75TnB25WsD+C2 o/iA== 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=VF7HOk9FnOo7p3niyuc/ZeydcOUyPtyVd5u7rDmQFT0=; b=Zx2woJ/3bu3F3Std4rcWw2jiW4F4aZ1qHd0qdvoOpzpAihK1aR1AsjYu6pS+yKWFtZ Rpg+U17T7/mqsLAPg8NUhyXvV4u5wrpe/zYknnr7FQjq7iDU1zonh2NxsAAMlQt/PgaQ uweFDhdvtIE+hEpV+AjUCb+LtHdYrH1hPybxBjT1ABvy5ABWoSsBO+bsLIeyE7oPNHDg 4jOCxpwaQhigQma92zZWoB25qHf6JP7fJIWFdmnnFxL7TJJeYPlg7ei3R5BsJ3fcOStJ al5wWV2Dpj3637Bvxcu1VW5Kcg4Bc/iOvCE6Ky1vGKJpH8hsfvdZ4L56gySpnLXK6vSx rmAw== X-Gm-Message-State: AOAM530oWDA0ty3Y4wweFJny9hgBQxoBGwUAMoOQFhOQA/Q0Q0x1YWpa C7wczePAtsZHW/ncK+FrU9c1Pw== X-Google-Smtp-Source: ABdhPJyWwwksCQZO2Hl+jN5SqYaQRszYdtaCccXCpevrwOSiRCdoiwIkINF5nLlC1dZqjTyS6nd9hQ== X-Received: by 2002:a63:2218:: with SMTP id i24mr9373392pgi.335.1621408793596; Wed, 19 May 2021 00:19:53 -0700 (PDT) Received: from localhost ([103.207.71.35]) by smtp.gmail.com with ESMTPSA id 14sm13469638pfj.29.2021.05.19.00.19.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 May 2021 00:19:53 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , James Clark , John Garry , Will Deacon , Mathieu Poirier , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Dave Martin , Al Grant , linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Leo Yan Subject: [PATCH v5 2/5] perf arm-spe: Convert event kernel time to counter value Date: Wed, 19 May 2021 15:19:36 +0800 Message-Id: <20210519071939.1598923-3-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210519071939.1598923-1-leo.yan@linaro.org> References: <20210519071939.1598923-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 When handle a perf event, Arm SPE decoder needs to decide if this perf event is earlier or later than the samples from Arm SPE trace data; to do comparision, it needs to use the same unit for the time. This patch converts the event kernel time to arch timer's counter value, thus it can be used to compare with counter value contained in Arm SPE Timestamp packet. 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 d2ae5a5c13ee..ff8b52e6d475 100644 --- a/tools/perf/util/arm-spe.c +++ b/tools/perf/util/arm-spe.c @@ -669,7 +669,7 @@ static int arm_spe_process_event(struct perf_session *session, } if (sample->time && (sample->time != (u64) -1)) - timestamp = sample->time; + timestamp = perf_time_to_tsc(sample->time, &spe->tc); else timestamp = 0; -- 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=-17.1 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 26472C433B4 for ; Wed, 19 May 2021 07:22:35 +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 AE6CC60725 for ; Wed, 19 May 2021 07:22:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AE6CC60725 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=s6MjdVIQ5edfYtW5GIVcSLTnuECMhLW4Boz2fY7vVQQ=; b=TLG84wPV7zTD9Cfk1uILAZ77L qWPal44R+8qcNaZcgawrzWsYnblZUBVcgMkP9Cy9B3sAD0eyrk6L1waOfBi05RvizM5wHowSkafVv uTADCf6f2VArs09AScjFv8IbGAzc80j3mL2auFXtVFbv8FDEj1V9bnx/s7XytbLuk+4MsjGsrtYzn HCpzn9nn/1DTOYum6+F6T+xnouz8k9u6G6KxIHr7aSm5RklkKF3OwZv32YE0Gm2fD+1D2M8/zFUbl jfCu2d6ICC1qbcIoKcTs5PHplXBxQF3KuXExwRdTiT3+POs5xHEEBm9k67XlJJMnAZlz+M398/1yS UJV7Eqg2g==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1ljGV9-0038fg-9c; Wed, 19 May 2021 07:20:19 +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 1ljGUm-0038a5-SV for linux-arm-kernel@desiato.infradead.org; Wed, 19 May 2021 07:19:59 +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=VF7HOk9FnOo7p3niyuc/ZeydcOUyPtyVd5u7rDmQFT0=; b=ZADFyT2ryErt0fdqV5qVxGdchR sTsk2yoS4wVqMbXvH3iiWgl0Sa5X+zrbJDQRRzwdEsg1j+6UXczSOEzc60fspAn7+XMkw2P200dDR GehBktzWuw4BhOhRM9b4kz2aDVVmtx6zc5n4eiCB5sE1a2j9joMPGHrrqMehzTAc19gAXI1z3X4HT Ub4dY5ZqCzi36oLcV0xd14BOPxj7VLXNAaVAkvFusLdQ6lee+NTjOc9X0dHsY0QvgW4zzCWC7ZNAD MhGD6sNkqWu4akAoSDXvLqYvbOeJfuLu6wlkWnmV/qINcbxwYjMiz+5rhynUYSByiB17aP11y3itT hHoi5PMw==; Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1ljGUk-00FDIS-Dk for linux-arm-kernel@lists.infradead.org; Wed, 19 May 2021 07:19:55 +0000 Received: by mail-pg1-x529.google.com with SMTP id q15so8796844pgg.12 for ; Wed, 19 May 2021 00:19:54 -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=VF7HOk9FnOo7p3niyuc/ZeydcOUyPtyVd5u7rDmQFT0=; b=EM5liwyzntU9Cj0R9VZ/vTntNwcOgx+IqSmnrR+4qu+Wk0p0ypqYuTODL2r5OW+9jq FiHKDrnpQ2Nv5WEbqX7D8qHVtUg7h0qQRT7ja4Or4opgEGILz6r1Ih1tSn12ORGd3tjP mNVBoF4yHFUcANpACuFQXyA6jafxUCIpMPrNXBr8+alRZymbhzvD9gzGswmajl7qDhwG dIXe5+nLkP5ej/gxj08Nnl+oEayMo/dg0ZCDrqQyTksVlb/RudCXIztuNU+SUcFe12uX D6dueLH6R+wV8lCI93Z0nxFTWM5UMYEdvR5NdW4bc4GdhmQqeuSmoWy75TnB25WsD+C2 o/iA== 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=VF7HOk9FnOo7p3niyuc/ZeydcOUyPtyVd5u7rDmQFT0=; b=TOmYlUyvkbQseQclyi5SocwJwqdi0XN41MKNkZnoo3r56RMm6fvrp/lkyfzhcEmaLe gJOsFx8/YK6GrMhE/scrZddgtSkOCTA3sAldrg4QiISNbBKt4SDsJecoY7CfTmJJsOUu o40YDaKVqpBHN06HE3rH0tQXlJ6R/qLFP9wYaClfJcAoHGeN0Vms2quT2UUbO61pW6Zw Ft0djcPGV6sUXoaJAaPpX7Vb5HI6ut+sPu/q1kP1TDalmR8TFZGcvTyBxoRk4Xz7NUcW p8hqEfbx8YR6TcS8+fPHu0dyblEBc+djX7GIsk6wI4B7ct3avpPuSpD4wpJMHNX+BxUj Bn7w== X-Gm-Message-State: AOAM533xi0SpV5IC4XpZvd0NUE4cjj/Ap+Z/mcYWXRNtOz+6tlXRAdDl JC8/Wr6V4T5y6/4KKHg04yM3qw== X-Google-Smtp-Source: ABdhPJyWwwksCQZO2Hl+jN5SqYaQRszYdtaCccXCpevrwOSiRCdoiwIkINF5nLlC1dZqjTyS6nd9hQ== X-Received: by 2002:a63:2218:: with SMTP id i24mr9373392pgi.335.1621408793596; Wed, 19 May 2021 00:19:53 -0700 (PDT) Received: from localhost ([103.207.71.35]) by smtp.gmail.com with ESMTPSA id 14sm13469638pfj.29.2021.05.19.00.19.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 May 2021 00:19:53 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , James Clark , John Garry , Will Deacon , Mathieu Poirier , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Dave Martin , Al Grant , linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Leo Yan Subject: [PATCH v5 2/5] perf arm-spe: Convert event kernel time to counter value Date: Wed, 19 May 2021 15:19:36 +0800 Message-Id: <20210519071939.1598923-3-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210519071939.1598923-1-leo.yan@linaro.org> References: <20210519071939.1598923-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-20210519_001954_481117_8BED56DA X-CRM114-Status: GOOD ( 16.68 ) 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 When handle a perf event, Arm SPE decoder needs to decide if this perf event is earlier or later than the samples from Arm SPE trace data; to do comparision, it needs to use the same unit for the time. This patch converts the event kernel time to arch timer's counter value, thus it can be used to compare with counter value contained in Arm SPE Timestamp packet. 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 d2ae5a5c13ee..ff8b52e6d475 100644 --- a/tools/perf/util/arm-spe.c +++ b/tools/perf/util/arm-spe.c @@ -669,7 +669,7 @@ static int arm_spe_process_event(struct perf_session *session, } if (sample->time && (sample->time != (u64) -1)) - timestamp = sample->time; + timestamp = perf_time_to_tsc(sample->time, &spe->tc); else timestamp = 0; -- 2.25.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel