Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3963910pxv; Mon, 28 Jun 2021 17:54:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWt6z1NHUPZ+4VYOlv6OM1W6FsCddH31HHTzXnjZDh7N3Cb2JgjdAQ+DXBvSWwNXs7LZV6 X-Received: by 2002:a92:3f01:: with SMTP id m1mr21089079ila.122.1624928088194; Mon, 28 Jun 2021 17:54:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624928088; cv=none; d=google.com; s=arc-20160816; b=0LbKcBWYTSu8uTfebJoDWt2v7xq808o+hpBZS1obs+PGIKtALOVnxn/8rYo6voNUsX bemtlFop/4NumOcZFucuocDFaO6tkwCSrgz729MeZsRlvtWD+LSSFELyyWe7ANAo+2wm uf5cZicArQSDQEHIRILQ2iSFdebaZWYaifuvwOkE04neAqD59Q6IAqgL5dSzxyAWtThk VrW+E0RPDE3qTooD7UuKmHNhQ1TlWRvB8AVIGMPLqiWhfQKww5z3D7PcrDLYkm0ixV+a cNFQyJNR6I4eb3JLJhEzwFoCEb0E7ZVTB2NgHywQ5nYSAxIubNNJZUnQsJ15x2iOj08I vjyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=yxJy8CX9rvBUMUdaVwarKO4oKvl0+xnyppMBI1FV01g=; b=otBwegADYyb8CNiHq/ipG4YIt+1aHozsKzgcLERfqv3W+9mpUapl5ecQxqph1H5DKY QRwaSQa61MxlY48Bk6DPNPbKW25s/JLP/pIsCjPXsNm7yAREeXThUe2KM4MrxaF3aghl +VFlBWwl3CJp5/lKJxwbbeEK3IVYjId9zXQwguFUk/ik/GurySXKU0EHCWgSgQfruLLI x9TC3DG7NxzhIbP8GdmtKbsWetics3RT+0a8S2BqlB0NMDPVFQs+DMN1XYnv8oSIc7mZ 8ud2RJXknB6O9uv7y8ZNSfIRObB6MMsqjCVuwf2mMmDWb2P6dChMAno+rZKvCoOvnrxF cEbA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u21si22346916jak.34.2021.06.28.17.54.35; Mon, 28 Jun 2021 17:54:48 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230283AbhF2A4f (ORCPT + 99 others); Mon, 28 Jun 2021 20:56:35 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:6017 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230090AbhF2A4f (ORCPT ); Mon, 28 Jun 2021 20:56:35 -0400 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4GDQp909VtzXmFc; Tue, 29 Jun 2021 08:48:49 +0800 (CST) Received: from dggpemm000003.china.huawei.com (7.185.36.128) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Tue, 29 Jun 2021 08:54:06 +0800 Received: from [10.67.102.248] (10.67.102.248) by dggpemm000003.china.huawei.com (7.185.36.128) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Tue, 29 Jun 2021 08:54:06 +0800 Subject: Re: [PATCH] perf arm-spe: Fix incorrect sample timestamp in perf script To: Leo Yan CC: , , , , , , , , , , , , , , References: <20210626032115.16742-1-yangjihong1@huawei.com> <20210628014953.GA163942@leoy-ThinkPad-X240s> <75dac5f8-9c82-0db1-d362-44289dcaa206@huawei.com> <20210628040716.GC163942@leoy-ThinkPad-X240s> <2af84c69-8528-9c4a-f666-2dd660bcd966@huawei.com> <20210628072905.GB200044@leoy-ThinkPad-X240s> From: Yang Jihong Message-ID: <1bc5b36c-8138-4d14-c106-964682bf44dd@huawei.com> Date: Tue, 29 Jun 2021 08:53:55 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <20210628072905.GB200044@leoy-ThinkPad-X240s> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.102.248] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpemm000003.china.huawei.com (7.185.36.128) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Leo, On 2021/6/28 15:29, Leo Yan wrote: > On Mon, Jun 28, 2021 at 02:30:56PM +0800, Yang Jihong wrote: >> Hello Leo, >> >> On 2021/6/28 12:07, Leo Yan wrote: >>> On Mon, Jun 28, 2021 at 11:45:07AM +0800, Yang Jihong wrote: >>> >>> [...] >>> >>>> The timestamp does not match. Each timestamp has a difference of >>>> 213.98296702 seconds. Is the command I executed wrong? >>> >>> I don't understand what's your meaning "a difference of 213.98296702 >>> seconds". >>> >>> But let me give an explaination with your below examples. You could >>> the command "perf script" outputs the timestamp 314938.859071370 which >>> is the kernel's timestamp, if using the command "perf script -D", it >>> outputs the value 31515284203839 which is the Arch timer's raw counter >>> value. >>> >>> In theory, the arch timer's counter is enabled at the very early >>> time before kernel's booting (e.g. bootloaders, UEFI, etc...). So for >>> the kernel's timestamp, it should calibrate the timestamp and reduce >>> the offset prior to the kernel's booting. I think this is the reason >>> why you observed 213.98296702 seconds difference (if compared with >>> your own patch?) >>> >>> If still see any issue, please let me know. Thanks a lot for the >>> testing! >>> >> Thanks for the very detailed explanation. >> To keep the correct relative time sequence between events in SPE and other >> events, we should use kernel timestamp instead of arch time. Therefore, we >> need to calibrate the time. Is this correct? > > Yes, correct! I see. Thank you for your answer.:) Jihong > . >