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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20111006230246.GA5944@ghostprotocols.net>
Date:	Thu, 6 Oct 2011 20:02:46 -0300
From:	Arnaldo Carvalho de Melo <acme@...stprotocols.net>
To:	David Ahern <dsahern@...il.com>
Cc:	Ingo Molnar <mingo@...e.hu>, linux-kernel@...r.kernel.org,
	Frederic Weisbecker <fweisbec@...il.com>,
	Mike Galbraith <efault@....de>,
	Paul Mackerras <paulus@...ba.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH 07/15] perf top: Add callgraph support

Em Thu, Oct 06, 2011 at 03:47:02PM -0600, David Ahern escreveu:
> On 10/06/2011 11:22 AM, Arnaldo Carvalho de Melo wrote:
> > From: Arnaldo Carvalho de Melo <acme@...hat.com>
> > +-G [type,min,order]::
> > +--call-graph::
> > +        Display call chains using type, min percent threshold and order.
> > +	type can be either:
> > +	- flat: single column, linear exposure of call chains.
> > +	- graph: use a graph tree, displaying absolute overhead rates.
> > +	- fractal: like graph, but displays relative rates. Each branch of
> > +		 the tree is considered as a new profiled object.
> > +
> > +	order can be either:
> > +	- callee: callee based call graph.
> > +	- caller: inverted caller based call graph.
> > +
> > +	Default: fractal,0.5,callee.

> yuk. perf-report has -g for this. How about moving the current -g to -G
> and let -g be consistent across commands?

Yup, but top has -g for --group... This is something we need to improve
ASAP. 

I think changing top to use 0 for group, i.e. just --group and -g for
callchains is the way to go, right?

The "record" command has 'G' for --cgroup, -g for --call-graph... So
topuse 'G' for --cgroup too, I guess.
 
> > @@ -748,13 +756,29 @@ static void perf_event__process_sample(const union perf_event *event,
> >  		evsel = perf_evlist__id2evsel(top.evlist, sample->id);
> >  		assert(evsel != NULL);
> >  
> > +		if ((sort__has_parent || symbol_conf.use_callchain) &&
> > +		    sample->callchain) {
> > +			err = perf_session__resolve_callchain(session, al.thread,
> > +							      sample->callchain, &parent);
> > +			if (err)
> > +				return;
> > +		}
> > +
> >  		he = perf_session__add_hist_entry(session, &al, sample, evsel);
> >  		if (he == NULL) {
> >  			pr_err("Problem incrementing symbol period, skipping event\n");
> >  			return;
> >  		}
> >  
> > -		record_precise_ip(he, evsel->idx, ip);
> > +		if (symbol_conf.use_callchain) {
> > +			err = callchain_append(he->callchain, &session->callchain_cursor,
> > +					       sample->period);
> > +			if (err)
> > +				return;
> > +		}
> > +
> > +		if (sort_has_symbols)
> > +			record_precise_ip(he, evsel->idx, ip);
> >  	}
> 
> A fair amount of code duplication with builtin-report now.

Yeah, eventually all this will be in the evlist class.
 
> > +	/* get the call chain order */
> > +	if (!strcmp(tok2, "caller"))
> > +		callchain_param.order = ORDER_CALLER;
> > +	else if (!strcmp(tok2, "callee"))
> > +		callchain_param.order = ORDER_CALLEE;
> > +	else
> > +		return -1;
> > +setup:
> > +	if (callchain_register_param(&callchain_param) < 0) {
> > +		fprintf(stderr, "Can't register callchain params\n");
> > +		return -1;
> > +	}
> 
> ditto for the parse_callchain_opt() -- seems to be a copy from report.

It is, I'll get that refactored. Just wanted to get this thing out now
as I found it to be an improvement to the current 'perf top' tool :)
 
> David
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ