Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp256033rdb; Thu, 19 Oct 2023 03:47:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEc0I2r3x9J1LqMHkDr2QoE1EGDifbF/bMizFItCqFO0mFDhT4VQXmHFdWz3Sf4FAjDUem4 X-Received: by 2002:a17:903:27c3:b0:1c7:755d:ccc8 with SMTP id km3-20020a17090327c300b001c7755dccc8mr1838453plb.29.1697712447491; Thu, 19 Oct 2023 03:47:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697712447; cv=none; d=google.com; s=arc-20160816; b=NInZYlvDhWoyi5OC71S8IIVcOf68BtHQIXufJGkC+cKXsr5ohWaF4efRcA993RuGW5 CyANHH3/uONcgHvCR/GUCMu/Kz66pO0nYkPDpVNCYw35EbtCXPXIhq5rt5IoJsUm4Kn8 itk7pqUEecf4AUP3cEmjThUqIdQpXuor+Wro4b/80qOnac3/qwEaGG+Q+5ZKXmJOnSIR d3x8IShz7bY8AssKTkohXZKMAosYYEf+tGweUIwxBPxWMx3cP0c0mYGw9qtC7V/ukMAs NuemoY88+OuMxQpGRLJjcdZjVNTPJFLnWVdW72gyrR0jrAlNGXAU7SQOswTiNUBa3kzn +pQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=L6nJAdAWLXv+f9JpE/84oEOCz/qlbrw8FE8Qdht6xeE=; fh=GkWRLEOOGrsLjFbmY4JkRHEJGOA8UAsgEBtfZi9DP08=; b=k2HPrsZq1eaZRwfgkfBTpjkN5ekc7mKJevslvEfswDHZtwUUzXMzaQCOjIvn0zKCKO C//UKkOmgoAm5ErtVCTxZxsLz6Ej04GDAl+ejU+ucBUDhlxi/mwEsooiEOnw5HaHrBJo Y/pOHpLCrOBgiP858DGlUhfG2jv5MNvnyv+K7F5VSHYCcwihwcEH01/9gcDuIdFyZR+5 37aRrzFORaYSSavTczyBmjjdFdgqmoVEVWD6Z9XKI5YIQX4Io9T9trYXIeLBqKTR+Nwv FA8OM/uEBCTpkAcKdBPCYbGTW186GkLNkV8RaYOle6vWWYCPOYMJojaANSAWOV9YmG3p AXsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XjkD9CRO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id y10-20020a1709029b8a00b001c722b269b4si1770683plp.620.2023.10.19.03.47.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 03:47:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XjkD9CRO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 8AFD7822CCC4; Thu, 19 Oct 2023 03:47:26 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344662AbjJSKrZ (ORCPT + 99 others); Thu, 19 Oct 2023 06:47:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232000AbjJSKrY (ORCPT ); Thu, 19 Oct 2023 06:47:24 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 881A5119; Thu, 19 Oct 2023 03:47:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697712442; x=1729248442; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=Qz0qCHWdU2DO8LEEMx8unupi23tCgui51q2IYAY/sYQ=; b=XjkD9CROdo90T7uBXSdiCkt8uCVronaZZz9sttNg2GIzcEXATTEShLXw tsRZFe6TJv/D/gtkDCQYu/JUfdJPUkRrCcFImb6LCxofWwjUEjeFASZnD 8PaNLqaEWqUodgJJ1qRfUjW2ad3rIdOrSvPR0sDpsOpQep8o3qJC8GUJE OBU39ih2drsvXfZc4xIoYpz9qDhiiNTvV2oKyz52Ny0VpGHCgrfK7c/QE b37FwZzxEtQA5Tivx1mKvtXcTtyqeteJfHcf2cmirn450ennLKAbSGrIN VY8v90ywAsFDvARkPq5bDQvbT+f1K3K5Bxs1+tr/5uw1UKN9AFuk7APOP w==; X-IronPort-AV: E=McAfee;i="6600,9927,10867"; a="385095787" X-IronPort-AV: E=Sophos;i="6.03,237,1694761200"; d="scan'208";a="385095787" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Oct 2023 03:47:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10867"; a="847636117" X-IronPort-AV: E=Sophos;i="6.03,237,1694761200"; d="scan'208";a="847636117" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO [10.0.2.15]) ([10.249.39.14]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Oct 2023 03:47:17 -0700 Message-ID: <8a2ea58f-f835-4d1a-8bd6-3a63b3b0db94@intel.com> Date: Thu, 19 Oct 2023 13:47:15 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 1/2] perf auxtrace: Add 'T' itrace option for timestamp trace Content-Language: en-US To: Leo Yan , Arnaldo Carvalho de Melo , James Clark , Suzuki K Poulose , Mike Leach Cc: John Garry , Will Deacon , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org References: <20231014074513.1668000-1-leo.yan@linaro.org> <20231014074513.1668000-2-leo.yan@linaro.org> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki In-Reply-To: <20231014074513.1668000-2-leo.yan@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 19 Oct 2023 03:47:26 -0700 (PDT) On 14/10/23 10:45, Leo Yan wrote: > An AUX trace can contain timestamp, but in some situations, the hardware > trace module (e.g. Arm CoreSight) cannot decide the traced timestamp is > the same source with CPU's time, thus the decoder can not use the > timestamp trace for samples. > > This patch introduces 'T' itrace option. If users know the platforms "If users know" <- how would users know? Could the kernel or tools also figure it out? > they are working on have the same time counter with CPUs, users can > use this new option to tell a decoder for using timestamp trace as > kernel time. > > Signed-off-by: Leo Yan > --- > tools/perf/Documentation/itrace.txt | 1 + > tools/perf/util/auxtrace.c | 3 +++ > tools/perf/util/auxtrace.h | 3 +++ > 3 files changed, 7 insertions(+) > > diff --git a/tools/perf/Documentation/itrace.txt b/tools/perf/Documentation/itrace.txt > index a97f95825b14..19cc179be9a7 100644 > --- a/tools/perf/Documentation/itrace.txt > +++ b/tools/perf/Documentation/itrace.txt > @@ -25,6 +25,7 @@ > q quicker (less detailed) decoding > A approximate IPC > Z prefer to ignore timestamps (so-called "timeless" decoding) > + T use the timestamp trace as kernel time > > The default is all events i.e. the same as --itrace=iybxwpe, > except for perf script where it is --itrace=ce > diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c > index a0368202a746..f528c4364d23 100644 > --- a/tools/perf/util/auxtrace.c > +++ b/tools/perf/util/auxtrace.c > @@ -1638,6 +1638,9 @@ int itrace_do_parse_synth_opts(struct itrace_synth_opts *synth_opts, > case 'Z': > synth_opts->timeless_decoding = true; > break; > + case 'T': > + synth_opts->use_timestamp = true; > + break; > case ' ': > case ',': > break; > diff --git a/tools/perf/util/auxtrace.h b/tools/perf/util/auxtrace.h > index 29eb82dff574..55702215a82d 100644 > --- a/tools/perf/util/auxtrace.h > +++ b/tools/perf/util/auxtrace.h > @@ -99,6 +99,7 @@ enum itrace_period_type { > * @remote_access: whether to synthesize remote access events > * @mem: whether to synthesize memory events > * @timeless_decoding: prefer "timeless" decoding i.e. ignore timestamps > + * @use_timestamp: use the timestamp trace as kernel time > * @vm_time_correlation: perform VM Time Correlation > * @vm_tm_corr_dry_run: VM Time Correlation dry-run > * @vm_tm_corr_args: VM Time Correlation implementation-specific arguments > @@ -146,6 +147,7 @@ struct itrace_synth_opts { > bool remote_access; > bool mem; > bool timeless_decoding; > + bool use_timestamp; > bool vm_time_correlation; > bool vm_tm_corr_dry_run; > char *vm_tm_corr_args; > @@ -678,6 +680,7 @@ bool auxtrace__evsel_is_auxtrace(struct perf_session *session, > " q: quicker (less detailed) decoding\n" \ > " A: approximate IPC\n" \ > " Z: prefer to ignore timestamps (so-called \"timeless\" decoding)\n" \ > +" T: use the timestamp trace as kernel time\n" \ > " PERIOD[ns|us|ms|i|t]: specify period to sample stream\n" \ > " concatenate multiple options. Default is iybxwpe or cewp\n" >