Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf tools: Fix buildid processing

After recording, 'perf record' post-processes the data to determine
which buildids are needed.

That processing must process the data in time order, if possible,
because otherwise dependent events, like forks and mmaps, will not make
sense.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Tested-by: Jiri Olsa <jolsa@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/1439994561-27436-4-git-send-email-adrian.hunter@intel.com
[ Moved the sample_id_add to after trying to open the events, use pr_warning ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Adrian Hunter and committed by
Arnaldo Carvalho de Melo
cca8482c 5cb73340

+11
+11
tools/perf/builtin-record.c
··· 521 521 goto out_child; 522 522 } 523 523 524 + /* 525 + * Normally perf_session__new would do this, but it doesn't have the 526 + * evlist. 527 + */ 528 + if (rec->tool.ordered_events && !perf_evlist__sample_id_all(rec->evlist)) { 529 + pr_warning("WARNING: No sample_id_all support, falling back to unordered processing\n"); 530 + rec->tool.ordered_events = false; 531 + } 532 + 524 533 if (!rec->evlist->nr_groups) 525 534 perf_header__clear_feat(&session->header, HEADER_GROUP_DESC); 526 535 ··· 974 965 .tool = { 975 966 .sample = process_sample_event, 976 967 .fork = perf_event__process_fork, 968 + .exit = perf_event__process_exit, 977 969 .comm = perf_event__process_comm, 978 970 .mmap = perf_event__process_mmap, 979 971 .mmap2 = perf_event__process_mmap2, 972 + .ordered_events = true, 980 973 }, 981 974 }; 982 975