Re: [PATCH 15/23] perf tools: Add perf data version 3 header read
From: Namhyung Kim
Date: Fri Jul 19 2013 - 08:11:46 EST
On Wed, 17 Jul 2013 19:49:55 +0200, Jiri Olsa wrote:
> Adding perf data version 3 header read code to load
> data for v3 format.
>
[SNIP]
> +
> + session = container_of(header, struct perf_session, header);
> + if (session->evlist)
> + return 0;
I guess we need version check here. The v2 format still needs to
process it even though it's session already has a evlist, right?
Thanks,
Namhyung
>
> evlist = read_event_desc(header, fd);
> if (!evlist)
> - return 0;
> + return -1;
>
> - session = container_of(header, struct perf_session, header);
> + ph = &session->header;
>
> - list_for_each_entry(evsel, &evlist->entries, node)
> - perf_evlist__set_event_name(session->evlist, evsel);
> + if (ph->version <= PERF_HEADER_VERSION_2) {
> + list_for_each_entry(evsel, &evlist->entries, node)
> + perf_evlist__set_event_name(session->evlist, evsel);
> +
> + perf_evlist__delete(evlist);
> + } else {
> + session->evlist = evlist;
> + symbol_conf.nr_events = evlist->nr_entries;
> + }
>
> - perf_evlist__delete(evlist);
> return 0;
> }
--
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/