lkml.org 
[lkml]   [2015]   [May]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 34/40] perf report: Parallelize perf report using multi-thread
On Tue, May 19, 2015 at 12:12:30PM +0200, Jiri Olsa wrote:
> On Mon, May 18, 2015 at 09:30:49AM +0900, Namhyung Kim wrote:
>
> SNIP
>
> > +
> > +int perf_session__process_events_mt(struct perf_session *session, void *arg)
> > +{
> > + struct perf_data_file *file = session->file;
> > + struct perf_evlist *evlist = session->evlist;
> > + struct perf_evsel *evsel;
> > + u64 nr_entries = 0;
> > + struct perf_tool *tool = session->tool;
> > + struct perf_session *mt_sessions = NULL;
> > + struct perf_tool_mt *mt_tools = NULL;
> > + struct perf_session *ms;
> > + struct perf_tool_mt *mt;
> > + pthread_t *th_id;
> > + int err, i, k;
> > + int nr_index = session->header.nr_index;
> > + u64 size = perf_data_file__size(file);
> > +
>
> SNIP
>
> > +
> > + for (i = 1; i < nr_index; i++) {
> > + mt = &mt_tools[i];
> > +
> > + evlist__for_each(evlist, evsel) {
> > + struct hists *hists = evsel__hists(evsel);
> > +
> > + if (perf_evsel__is_dummy_tracking(evsel))
> > + continue;
> > +
> > + hists__mt_resort(hists, &mt->hists[evsel->idx]);
> > +
> > + /* Non-group events are considered as leader */
> > + if (symbol_conf.event_group &&
> > + !perf_evsel__is_group_leader(evsel)) {
> > + struct hists *leader_hists;
> > +
> > + leader_hists = evsel__hists(evsel->leader);
> > + hists__match(leader_hists, hists);
> > + hists__link(leader_hists, hists);
>
> hum, could you please describe/comment on why is this needed?

This is because it skips report__collapse_hists() when multi-thread
processing is enabled. For multi-thread, it needs to collect
per-thread hists into a global hists. This step is very similar to
hists__collapse_resort() and called regardless of sort keys, so it
skips to call the report__collapse_hists().

But I think it should be called after collapsing all per-thread hists.
I'll move it out of the loop.

Thanks,
Namhyung


\
 
 \ /
  Last update: 2015-05-19 17:21    [W:1.341 / U:0.408 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site