Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp289861rdb; Thu, 19 Oct 2023 04:52:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IExyZpRKFTPB6USfYZP/yjDmook6PINdHrdBxQ+lxXdCWsaDMzPhXtXwP9CpY7DjDONuhKn X-Received: by 2002:aca:230e:0:b0:3ae:5bf5:4ad1 with SMTP id e14-20020aca230e000000b003ae5bf54ad1mr1758845oie.33.1697716371514; Thu, 19 Oct 2023 04:52:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697716371; cv=none; d=google.com; s=arc-20160816; b=LmzD+xArGTysD20KEzC0m1Gw7fkrXalI5eZyhy8u0b5ruNP9y3Dy/RxQNeNX1um48p 9OiI6+Eaa8rfaxp9Q5zf6epU2t0F9BX0rLJENIMQr7976DRyFi2zfeBDn0I8KVHz1+DI IObYpGMS5LObCNV5krtYdpqGglu2Je6uQFzTmK+WdmpL8h89YBfMjmZ34w2WLUu85YV+ jjJo2ayXY9d+6VwkD3FewllB4WNGRK7DHEXjgLBMS7VFfw9Eu0V588GeW+C0nyNPcSUC csVqoTehWeN6QD64hUJFoC7fFyPXEi4G56kYTmllsYxJvwFiVCKk5Bd9pN6+qA1hpDIM x/kQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=22LmJCxRhqy3YPjbMbUNcX4eco2+QIS+2sFMQqk3YxU=; fh=OxtuTPsSiKbt7isyhW+KOr3/EhOZMHI9Vx5at4I/PyA=; b=no88dzzsJk5JcQjxyncH5wQFp03mFhekmrWKF/tAWm+vbD6DGXs7CYzR5KJQPb4hl6 Qx5VPYwC79YQLkH2Blf2itIq4LLzTbfEiE3vSkFBwTmSAr0Wl1I5cHHEqA6CuR5+uD0/ EmO6rMLdMvwMqiRQCWl8YnHVNJP7qrU08qcfETBPIhd6E2mMKWe8Z95ueatx55eCetyk +hjukQTaW1DtlG6Xyigs95OQSvid7iBKwOv0j9BtVnEWJSH7tmELQUSsXoLXGPbGT6wp ym9ieI0o80CYQvPPDUObi0HIWBdrOyZn0w3qIhd4vzjxWbASRnphGH8VDcp8LTjzZ+IK Hjdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="qbmetv/n"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id x4-20020a63db44000000b005b3bacf428dsi4540543pgi.491.2023.10.19.04.52.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 04:52:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="qbmetv/n"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 8898E818CCA1; Thu, 19 Oct 2023 04:52:48 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345372AbjJSLwm (ORCPT + 99 others); Thu, 19 Oct 2023 07:52:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235255AbjJSLwl (ORCPT ); Thu, 19 Oct 2023 07:52:41 -0400 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7128E12F for ; Thu, 19 Oct 2023 04:52:38 -0700 (PDT) Received: by mail-pj1-x1032.google.com with SMTP id 98e67ed59e1d1-27d18475ed4so6022458a91.0 for ; Thu, 19 Oct 2023 04:52:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697716358; x=1698321158; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=22LmJCxRhqy3YPjbMbUNcX4eco2+QIS+2sFMQqk3YxU=; b=qbmetv/nlvVlX2pUDW1dGsCrZ0mEugwH7/JZCKnki90PP1NmSLoGDxecXEzBix48oY G1/3tVrGeQHtLbN2mVbtLaN1W/doPJBkbhh+PEnd5xx8rK1UiWrODADxq/6gyBQwCKzx cfSAsvkuOflMloQu00OTo80x55XKcoBdsV2a1grU4kCM9xQdqaNuNB90A45bMjxM/xwO 8PCB0MhmtC9EM77+ReWN8w2CuXyGQHUrzZ3ZoL7ceAZ2zN1yAoL0qDC0+S+INaOEUnnQ blJRXdEAge6ytN3iGCe68OiT0G9pAAJzVuHB41FrBxIIqN7NJODq94jrzMv4AyCibapy KHgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697716358; x=1698321158; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=22LmJCxRhqy3YPjbMbUNcX4eco2+QIS+2sFMQqk3YxU=; b=ZenyDo4r2DzOebjU3YXqAgmSwC0Y7l0WyCrU9VEVWeqyd1ZufuovmGvJQUdXzE698M tN/smJwX5zeV/vsdv86kqlemFZeJtJDrsvKg5MCzPG9aMYFK8HyyLObVOGSavYqSbPZ6 zrteJdDHbYdNjOwS/XOqEP3PD5ii4WjiGquqX2b+SAAcAgmolOM7/6/KXx4TywUIMl0p X+htDajoYMV96RmeiHGbyOk8SJUPGaUlyTdMwtIqqrHS50goswKQZrHz58P5xNzCcMY/ TBQhaQ2AcO03vaao+5evXOw5r/IdUps0OFkHlKj7wNmfrJAjUfXh1rjxwGlhr9rBT6PH oYng== X-Gm-Message-State: AOJu0YxzPIIFy/GW6UJKjUsK9j2DB/HG1A0hAiZnAWswXWKmZaT9v9QX OMUem3sv+Swi2oNdzeyftfx9aw== X-Received: by 2002:a17:90b:1e06:b0:27d:3260:9142 with SMTP id pg6-20020a17090b1e0600b0027d32609142mr1732419pjb.45.1697716357854; Thu, 19 Oct 2023 04:52:37 -0700 (PDT) Received: from leoy-huanghe.lan ([98.98.49.160]) by smtp.gmail.com with ESMTPSA id c91-20020a17090a496400b0027dc483be23sm1595781pjh.26.2023.10.19.04.52.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 04:52:37 -0700 (PDT) Date: Thu, 19 Oct 2023 19:52:31 +0800 From: Leo Yan To: James Clark Cc: John Garry , Will Deacon , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Arnaldo Carvalho de Melo , Suzuki K Poulose , Mike Leach Subject: Re: [PATCH v1 1/2] perf auxtrace: Add 'T' itrace option for timestamp trace Message-ID: <20231019115231.GF105208@leoy-huanghe.lan> References: <20231014074513.1668000-1-leo.yan@linaro.org> <20231014074513.1668000-2-leo.yan@linaro.org> <1bef7744-78ef-f673-a33b-6f8fb00e033b@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1bef7744-78ef-f673-a33b-6f8fb00e033b@arm.com> X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email 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 (agentk.vger.email [0.0.0.0]); Thu, 19 Oct 2023 04:52:48 -0700 (PDT) On Thu, Oct 19, 2023 at 11:31:16AM +0100, James Clark wrote: [...] > > --- 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 > > > > Maybe "Treat hardware timestamps as kernel time (trace and CPU time use > same clock source)" would be clearer. Agreed. > And another point, although this isn't really related to this patch, but > why do we have the single letter arguments for itrace? It seems like it > massively restricts the available options and makes the command lines > hard to read because they don't have long forms. Why not just have them > as normal arguments? TBH, I tried a bit for adding a normal argument, but I found it's not nature like itrace option for passing the normal argument into the decoder. And if we add a normal argument, we need to consider adding into perf commands for 'perf report', 'perf script', etc; itrace options can be shared by perf output commands. I understand an advantage of using normal argument is the 'perf report' command (e.g. perf report --aux-trace-kernel-time) doesn't need to specify any extra itrace option. If anyone still has concern for adding itrace optiona and prefer to add normal argument, I am happy to rework for adding normal argument. > If it's a backwards compatibility thing, would there be any objection to > adding this new option as a normal one rather than an itrace one? backward compatibility would not a problem - we add a new feature and at meantime we don't break anything. > > 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; > > And then this one could be like "hw_time_is_kernel_time", but I'm > stuggling to think of something shorter. Maybe your one is fine along > with the comment. It's fine for me to rename as "hw_time_is_kernel_time" for more readable. Will do in next spin. Thanks, Leo