Re: [PATCH 34/40] perf report: Parallelize perf report using multi-thread

From: Jiri Olsa
Date: Tue May 19 2015 - 06:21:05 EST


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?

thanks,
jirka
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/