Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp3219552rwl; Mon, 27 Mar 2023 10:49:40 -0700 (PDT) X-Google-Smtp-Source: AKy350ZtlZiyoz3O1LYAQdHV0pllxyZ4E+1cLk6RwuR2G5AGAEyCiJqsVmlO01JSZheyauQoMwfw X-Received: by 2002:a62:848f:0:b0:627:ec37:1e69 with SMTP id k137-20020a62848f000000b00627ec371e69mr13374046pfd.8.1679939380290; Mon, 27 Mar 2023 10:49:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679939380; cv=none; d=google.com; s=arc-20160816; b=d+4VN374CGMUhv3qSMfvqZlrLkATKW7dJChPlhKwe63wDMGISbthFwMN6eICbiXpaS LTZW5IjBuVnsPvtBj2CGCvZzKeckQDOeFH4wQDcXs/jDOxsYfc3xPxxcgMtcnaAGpSch S7ADw0m5eCeG+yKFT93t9byipUfWLxaFFYuJaoaHX9uogoCKA/JjELFCUduGEdVLh+ej 0+B+lWtklZ/fx7l1dMF5W5wxTmY1l+qA1HZfARAqyBcROWVlbkJnp5REA3ZH4lj9Scqo I/Xz4/2zMw0zSzPrxKgdXUkEDZAsk0CVSacPAQaKGuiyyOVQ5bLS6qHZEfzDWz6Gxx4z BqHQ== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=4i/cgAHheBAG7PtmKCPpzHBziq34XJ+nw81P8KUNIQw=; b=ktNNnp+4wNOTsgM2C30KmQWZ2WrWLnWzxm/zY4dfcsx1+26LPgxIRoFVWSrmAvegzr e312sd6mGtJ+N28qzck/A6kBFgjzPpfI0xFy8LQGJ8/tdkeQUlgTyc0B7nUjUWj+LI6s YA+eNDC/koK/1FbF8+ahmhPowCQyIjAJAa2qw7CkeFAeEae6IhnyK+TUhj6RkOIS0ZBy Y79J8ZD/YAr/iNLD56VuRPyX4NG3+qF2M/u2kKJkpr3OLLB8nx7sZJLLO3xN0kb4SdQi QGBlHFTDdTq5rvjG91KaCFZAqOXOS46eBmpxSPwvr8/miiaetks+8a4UXVfTjG8tphmQ bVcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=d3vDMKJy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n127-20020a632785000000b0050c17321319si26611069pgn.799.2023.03.27.10.49.28; Mon, 27 Mar 2023 10:49:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=d3vDMKJy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230095AbjC0Rpt (ORCPT + 99 others); Mon, 27 Mar 2023 13:45:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229946AbjC0Rps (ORCPT ); Mon, 27 Mar 2023 13:45:48 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53813170C; Mon, 27 Mar 2023 10:45:47 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 18574B8109B; Mon, 27 Mar 2023 17:45:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A3A98C433D2; Mon, 27 Mar 2023 17:45:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679939144; bh=cyZ+bQsooNT2C9+/yJMyzJjN1tpdYgklkVvmtv/WE00=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=d3vDMKJyd3PK3DDKdkbIIdTdNPJ/gKLGpehQ5qL33feNtXjat60ZGN0uL6booaCz6 Wp258B2103qGDwj5kZn6igCBkpuRjbDW2nu0c7C7JCjkP+PCtrclmkEIR6QXuhLf9j fPCKRXT6OxLTe8OcM+HTe6x+IpRvZEw3b1HE7mTHIJvO84JozxTHwrF2rJ7o3x52qr 4VKWKOH5cvy4KQ8wIsoHZw6jiwHw2wyP7Da7AA3v0/pJKZrgZrgvNfAKkC7L8//pbV tWxzux1FoQHXzrAKTYp1zTpsil9BYbSShT8OzTkG+b3t/I+oBJKjzgFa0/vlzcbEp4 OM5mMtS42b89A== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 2016C4052D; Mon, 27 Mar 2023 14:45:42 -0300 (-03) Date: Mon, 27 Mar 2023 14:45:42 -0300 From: Arnaldo Carvalho de Melo To: Namhyung Kim Cc: Yang Jihong , peterz@infradead.org, mingo@redhat.com, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@kernel.org, irogers@google.com, adrian.hunter@intel.com, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] perf ftrace: Make system wide the default target for latency subcommand Message-ID: References: <20230324032702.109964-1-yangjihong1@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Url: http://acmel.wordpress.com X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Mon, Mar 27, 2023 at 07:58:43AM -0700, Namhyung Kim escreveu: > On Mon, Mar 27, 2023 at 4:34 AM Arnaldo Carvalho de Melo > wrote: > > > > Em Fri, Mar 24, 2023 at 06:39:25PM -0700, Namhyung Kim escreveu: > > > Hello, > > > > > > On Thu, Mar 23, 2023 at 8:29 PM Yang Jihong wrote: > > > > > > > > If no target is specified for 'latency' subcommand, the execution fails > > > > because - 1 (invalid value) is written to set_ftrace_pid tracefs file. > > > > Make system wide the default target, which is the same as the default > > > > behavior of 'trace' subcommand. > > > > > > I followed the convention to use -a for system-wide profiling. > > > Not sure if it's ok to make it default, but I don't object. :) > > > > I'll make that an Acked-by, ok? > > Sure. > > Acked-by: Namhyung Kim Thanks! - Arnaldo > Thanks, > Namhyung > > > > > > > > > > Before the fix: > > > > > > > > # perf ftrace latency -T schedule > > > > failed to set ftrace pid > > > > > > > > After the fix: > > > > > > > > # perf ftrace latency -T schedule > > > > ^C# DURATION | COUNT | GRAPH | > > > > 0 - 1 us | 0 | | > > > > 1 - 2 us | 0 | | > > > > 2 - 4 us | 0 | | > > > > 4 - 8 us | 2828 | #### | > > > > 8 - 16 us | 23953 | ######################################## | > > > > 16 - 32 us | 408 | | > > > > 32 - 64 us | 318 | | > > > > 64 - 128 us | 4 | | > > > > 128 - 256 us | 3 | | > > > > 256 - 512 us | 0 | | > > > > 512 - 1024 us | 1 | | > > > > 1 - 2 ms | 4 | | > > > > 2 - 4 ms | 0 | | > > > > 4 - 8 ms | 0 | | > > > > 8 - 16 ms | 0 | | > > > > 16 - 32 ms | 0 | | > > > > 32 - 64 ms | 0 | | > > > > 64 - 128 ms | 0 | | > > > > 128 - 256 ms | 4 | | > > > > 256 - 512 ms | 2 | | > > > > 512 - 1024 ms | 0 | | > > > > 1 - ... s | 0 | | > > > > > > > > Fixes: 53be50282269 ("perf ftrace: Add 'latency' subcommand") > > > > Signed-off-by: Yang Jihong > > > > --- > > > > tools/perf/builtin-ftrace.c | 6 ++++-- > > > > 1 file changed, 4 insertions(+), 2 deletions(-) > > > > > > > > diff --git a/tools/perf/builtin-ftrace.c b/tools/perf/builtin-ftrace.c > > > > index d7fe00f66b83..fb1b66ef2e16 100644 > > > > --- a/tools/perf/builtin-ftrace.c > > > > +++ b/tools/perf/builtin-ftrace.c > > > > @@ -1228,10 +1228,12 @@ int cmd_ftrace(int argc, const char **argv) > > > > goto out_delete_filters; > > > > } > > > > > > > > + /* Make system wide (-a) the default target. */ > > > > + if (!argc && target__none(&ftrace.target)) > > > > + ftrace.target.system_wide = true; > > > > + > > > > switch (subcmd) { > > > > case PERF_FTRACE_TRACE: > > > > - if (!argc && target__none(&ftrace.target)) > > > > - ftrace.target.system_wide = true; > > > > cmd_func = __cmd_ftrace; > > > > break; > > > > case PERF_FTRACE_LATENCY: > > > > -- > > > > 2.30.GIT > > > > > > > > -- > > > > - Arnaldo -- - Arnaldo