Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1363328ybt; Thu, 25 Jun 2020 04:23:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5iS0QOTqPNcpUSaR9kwWL2OAxO8RMdwnu2BDPERijWjZsR0DzpZgjIeVDh5QTH2258Jig X-Received: by 2002:aa7:c90a:: with SMTP id b10mr31668827edt.198.1593084214655; Thu, 25 Jun 2020 04:23:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593084214; cv=none; d=google.com; s=arc-20160816; b=RRAXL9bPI4fJhTRm5A6unfBHgTZ1HcNtJCv2T5cKZF4V6OrnEfSkqEokVGtobvG8sq ES4GB0/aTva2FeI1vyYlOMAWsp1JN5J/nTj/VluyWq+IiUHcHvCN6js2l21zqpeo81up NvlgkGtkSC7vE3GxWr+9cJNoirClZinVP6y61wzuiMKRTvkydnIsqgaKk0ia3Vgi6pyW jJr3kDOzAgo7DV+SCLgEJcDPdpFZG1HnstpQtMpzrOv/C5eM8UPvZEiWgOQOOO8smmpI AS+6/SqwYH2curo1qmzn8svC9GQyffWF+0BaYiCxqmBnxJqyyRNvzdX1XPRP8Kk7TeNr Qfdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=B+iYWxPbM605MmMCarfRXtG7OCCzOW/gCwuctRCZbcA=; b=GBzTC/g7HzOg61clhRkc31XlhFXYye5x9sCQOfiYo6+9tkPWb51mUsJQw1pYsRcIeq RmYChfIzWW8qAkLnFyNTIM2CMzLogxu4VCGgOdPA86hrZy8UfMQkpx1BS3nRlhOGYBD5 TMiarcsqJVSzL7mMFXX8nyufh2nk5isuAtEr7MtwUW7d1ZjlSvvMoSJO3rB2vZFdyJQ1 mE4gPG7yzkzwQU6aYXP30R2MBKkitfZyTCQI6ofUFNyEGUkXC0smXBU0z+iqafmRdmAy eBit+V+K13804H9JM2d9RqHS7+NTOhtnylmNcTKRUw24BOPuSapm9c7+Aw8HvuH+q8ht dmOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pD13Y4F8; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gg26si7983563ejb.128.2020.06.25.04.23.11; Thu, 25 Jun 2020 04:23:34 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pD13Y4F8; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404179AbgFYLVd (ORCPT + 99 others); Thu, 25 Jun 2020 07:21:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404042AbgFYLVc (ORCPT ); Thu, 25 Jun 2020 07:21:32 -0400 Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A50FC061573 for ; Thu, 25 Jun 2020 04:21:31 -0700 (PDT) Received: by mail-pl1-x641.google.com with SMTP id g17so2656017plq.12 for ; Thu, 25 Jun 2020 04:21:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=B+iYWxPbM605MmMCarfRXtG7OCCzOW/gCwuctRCZbcA=; b=pD13Y4F8y9OE8bUS+1powfFO28r0Ji45xEg0ie+y0/jILIAkc54ObCK1/8FXx7T7oY CTkOwHHJsnv+M5xitxgM2lskNxszk8lwOPiHZyb0G+e5ojB0czr2VZ1Ee5M6J4p0FRcO NadYG1tQ2MkkE/XVEDMdk2KpDGH9FCZFtDy0Yb5zqgRCAtyp2tObHrVo8c1pwuz1IWcF BkM58K/T1fTGYpEUwSPaqRa629e6HWfx7P1tC7iL61FCcdaPy5K8RjoeY4HJa9G1g6lp gmRnEnwtcwxJo3c9XBHuzPlZPtmlp03PBeX1G4e2CCRWrtAarveqSRzLfqX0w781Wp8u JWMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=B+iYWxPbM605MmMCarfRXtG7OCCzOW/gCwuctRCZbcA=; b=m9cTbmsiJNxSF9hxjzFTxBHIViZNmLko7wXA02GYJWoYxpRtdxsrwYv50nkdECrIW3 HSHoEUKS1J74l4ge4gkU3Ab35iHYN+ZVmE2lprepMLt+MIz52aOakyxEzNpy88AhUn50 VVVBGRArTL3mQrGFbS4td5MTWSSH8Yy9TF6VrNIR+Jn5Qcr/WxH02Yw0SdrydNW3i2k0 PdY/9TrmAwZ7DUM+BZyp9lzejldLA6DSLaepfscu3EJ10xuxdn1OtyGm8zgpFBlsXinT AP1xg2bMEt/xYEGSTc6K10/uBzej0Dpdev6jhviHgn1S7qzXLbQ//1L3kDlC4lyHgJoQ mYZg== X-Gm-Message-State: AOAM533rHK+sS9XlCImZJJh+gfgto04F5IMLKLAf7FmECZMFIAuWLLIb bEhDBcaHnSAzsUMUjfrlpGsYeCF2eEg= X-Received: by 2002:a17:90a:b781:: with SMTP id m1mr2593864pjr.14.1593084090755; Thu, 25 Jun 2020 04:21:30 -0700 (PDT) Received: from mail.google.com ([149.248.10.52]) by smtp.gmail.com with ESMTPSA id 191sm5167603pfw.150.2020.06.25.04.21.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jun 2020 04:21:29 -0700 (PDT) Date: Thu, 25 Jun 2020 19:21:22 +0800 From: Changbin Du To: Arnaldo Carvalho de Melo Cc: Changbin Du , Jiri Olsa , Peter Zijlstra , Ingo Molnar , Namhyung Kim , Steven Rostedt , linux-kernel@vger.kernel.org Subject: Re: [PATCH 10/19] perf ftrace: add support for trace option funcgraph-tail Message-ID: <20200625112122.v3gcd7xto7y4ste6@mail.google.com> References: <20200510150628.16610-1-changbin.du@gmail.com> <20200510150628.16610-11-changbin.du@gmail.com> <20200520210509.GY32678@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200520210509.GY32678@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Arnaldo, First appologize for so long dealy! Maybe you have forgot the context of this serias ;) On Wed, May 20, 2020 at 06:05:09PM -0300, Arnaldo Carvalho de Melo wrote: > Em Sun, May 10, 2020 at 11:06:19PM +0800, Changbin Du escreveu: > > This adds an option '--funcgraph-tail' for function graph tracer. > > And I think we should make these available in a compact way, as Intel PT > has, i.e. instead of doing something like: > > --function-graph-options nosleep_time,noirqs,no_tail,long_info > > We could have: > > -G ns,ni,nt,li > > To save on typing, or something like that. > I just noticed that there is an existing graph tracer option: --graph-depth Then our new option would be: --graph-options depth=,nosleep_time,noirqs,no_tail,long_info This makes it a little complex to parse such options (need to parse key-vale pairs). So can we follow the existing style instead? I mean we can have below options: -D --graph-depth -G --graph-funcs --graph-nosleep-time --graph-noirqs --graph-notail --graph-longinfo All graph tracer options are prefixed with '--graph-'. > - Arnaldo > > > Signed-off-by: Changbin Du > > --- > > tools/perf/builtin-ftrace.c | 20 ++++++++++++++++++++ > > 1 file changed, 20 insertions(+) > > > > diff --git a/tools/perf/builtin-ftrace.c b/tools/perf/builtin-ftrace.c > > index 20bc14d6c5fb..2ef5d1c4b23c 100644 > > --- a/tools/perf/builtin-ftrace.c > > +++ b/tools/perf/builtin-ftrace.c > > @@ -42,6 +42,7 @@ struct perf_ftrace { > > bool func_stack_trace; > > bool nosleep_time; > > bool nofuncgraph_irqs; > > + bool funcgraph_tail; > > bool long_info; > > unsigned tracing_thresh; > > }; > > @@ -192,6 +193,7 @@ static void reset_tracing_options(struct perf_ftrace *ftrace __maybe_unused) > > write_tracing_option_file("func_stack_trace", "0"); > > write_tracing_option_file("sleep-time", "1"); > > write_tracing_option_file("funcgraph-irqs", "1"); > > + write_tracing_option_file("funcgraph-tail", "0"); > > write_tracing_option_file("funcgraph-proc", "0"); > > write_tracing_option_file("funcgraph-abstime", "0"); > > write_tracing_option_file("irq-info", "0"); > > @@ -411,6 +413,17 @@ static int set_tracing_thresh(struct perf_ftrace *ftrace) > > return 0; > > } > > > > +static int set_tracing_funcgraph_tail(struct perf_ftrace *ftrace) > > +{ > > + if (!ftrace->funcgraph_tail) > > + return 0; > > + > > + if (write_tracing_option_file("funcgraph-tail", "1") < 0) > > + return -1; > > + > > + return 0; > > +} > > + > > static int __cmd_ftrace(struct perf_ftrace *ftrace, int argc, const char **argv) > > { > > char *trace_file; > > @@ -499,6 +512,11 @@ static int __cmd_ftrace(struct perf_ftrace *ftrace, int argc, const char **argv) > > goto out_reset; > > } > > > > + if (set_tracing_funcgraph_tail(ftrace) < 0) { > > + pr_err("failed to set tracing option funcgraph-tail\n"); > > + goto out_reset; > > + } > > + > > if (write_tracing_file("current_tracer", ftrace->tracer) < 0) { > > pr_err("failed to set current_tracer to %s\n", ftrace->tracer); > > goto out_reset; > > @@ -638,6 +656,8 @@ int cmd_ftrace(int argc, const char **argv) > > "Measure on-CPU time only (function_graph only)"), > > OPT_BOOLEAN(0, "nofuncgraph-irqs", &ftrace.nofuncgraph_irqs, > > "Ignore functions that happen inside interrupt (function_graph only)"), > > + OPT_BOOLEAN(0, "funcgraph-tail", &ftrace.funcgraph_tail, > > + "Show function tails comment (function_graph only)"), > > OPT_BOOLEAN('l', "long-info", &ftrace.long_info, > > "Show process names, PIDs, timestamps, irq-info if available"), > > OPT_UINTEGER(0, "tracing-thresh", &ftrace.tracing_thresh, > > -- > > 2.25.1 > > > > -- > > - Arnaldo -- Cheers, Changbin Du