lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200625112122.v3gcd7xto7y4ste6@mail.google.com>
Date:   Thu, 25 Jun 2020 19:21:22 +0800
From:   Changbin Du <changbin.du@...il.com>
To:     Arnaldo Carvalho de Melo <arnaldo.melo@...il.com>
Cc:     Changbin Du <changbin.du@...il.com>, Jiri Olsa <jolsa@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Namhyung Kim <namhyung@...nel.org>,
        Steven Rostedt <rostedt@...dmis.org>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 10/19] perf ftrace: add support for trace option
 funcgraph-tail


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 <n>

Then our new option would be:
	--graph-options depth=<n>,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 <n>
	-G --graph-funcs <func>

	--graph-nosleep-time
	--graph-noirqs
	--graph-notail
	--graph-longinfo

All graph tracer options are prefixed with '--graph-'.

> - Arnaldo
>  
> > Signed-off-by: Changbin Du <changbin.du@...il.com>
> > ---
> >  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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ