Messages in this thread Patch in this message | | | Date | Wed, 21 Oct 2009 17:19:25 +1100 | From | Anton Blanchard <> | Subject | [PATCH] perf record: Enable PERF_SAMPLE_ID when sampling multiple events |
| |
If we are sampling multiple events we need the id in each sample so we can differentiate between them in a perf data file.
Signed-off-by: Anton Blanchard <anton@samba.org> ---
Index: linux.trees.git/tools/perf/builtin-record.c =================================================================== --- linux.trees.git.orig/tools/perf/builtin-record.c 2009-10-21 14:58:33.000000000 +1100 +++ linux.trees.git/tools/perf/builtin-record.c 2009-10-21 17:12:33.000000000 +1100 @@ -413,6 +413,9 @@ static void create_counter(int counter, attr->sample_type |= PERF_SAMPLE_CPU; } + if (nr_counters > 1) + attr->sample_type |= PERF_SAMPLE_ID; + attr->mmap = track; attr->comm = track; attr->inherit = (cpu < 0) && inherit;
| |