[PATCH] perf record: Enable PERF_SAMPLE_ID when sampling multipleevents

From: Anton Blanchard
Date: Wed Oct 21 2009 - 02:24:33 EST



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@xxxxxxxxx>
---

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;
--
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/