perf record: Add ID and to recorded event data when recording multiple events
[safe/jmp/linux-2.6] / tools / perf / builtin-record.c
index 771533c..f573bbb 100644 (file)
@@ -244,6 +244,9 @@ static void create_counter(int counter, int cpu, pid_t pid)
 
        attr->sample_type       |= PERF_SAMPLE_IP | PERF_SAMPLE_TID;
 
+       if (nr_counters > 1)
+               attr->sample_type |= PERF_SAMPLE_ID;
+
        if (freq) {
                attr->sample_type       |= PERF_SAMPLE_PERIOD;
                attr->freq              = 1;