perf record,report,annotate,diff: Process events in order
[linux-flexiantxendom0-natty.git] / tools / perf / builtin-record.c
index efd1b3c..5149e3d 100644 (file)
@@ -285,7 +285,7 @@ static void create_counter(int counter, int cpu)
        if (system_wide)
                attr->sample_type       |= PERF_SAMPLE_CPU;
 
-       if (sample_time)
+       if (sample_time || system_wide || !no_inherit || cpu_list)
                attr->sample_type       |= PERF_SAMPLE_TIME;
 
        if (raw_samples) {
@@ -327,6 +327,9 @@ try_again:
                                 * Old kernel, no attr->sample_id_type_all field
                                 */
                                sample_id_all_avail = false;
+                               if (!sample_time && !raw_samples)
+                                       attr->sample_type &= ~PERF_SAMPLE_TIME;
+
                                goto retry_sample_id;
                        }