diff options
Diffstat (limited to 'tools/perf/builtin-record.c')
-rw-r--r-- | tools/perf/builtin-record.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index e9be6ae87a27..5149e3deb7bc 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c | |||
@@ -285,7 +285,7 @@ static void create_counter(int counter, int cpu) | |||
285 | if (system_wide) | 285 | if (system_wide) |
286 | attr->sample_type |= PERF_SAMPLE_CPU; | 286 | attr->sample_type |= PERF_SAMPLE_CPU; |
287 | 287 | ||
288 | if (sample_time) | 288 | if (sample_time || system_wide || !no_inherit || cpu_list) |
289 | attr->sample_type |= PERF_SAMPLE_TIME; | 289 | attr->sample_type |= PERF_SAMPLE_TIME; |
290 | 290 | ||
291 | if (raw_samples) { | 291 | if (raw_samples) { |
@@ -327,6 +327,9 @@ try_again: | |||
327 | * Old kernel, no attr->sample_id_type_all field | 327 | * Old kernel, no attr->sample_id_type_all field |
328 | */ | 328 | */ |
329 | sample_id_all_avail = false; | 329 | sample_id_all_avail = false; |
330 | if (!sample_time && !raw_samples) | ||
331 | attr->sample_type &= ~PERF_SAMPLE_TIME; | ||
332 | |||
330 | goto retry_sample_id; | 333 | goto retry_sample_id; |
331 | } | 334 | } |
332 | 335 | ||
@@ -572,7 +575,7 @@ static int __cmd_record(int argc, const char **argv) | |||
572 | } | 575 | } |
573 | 576 | ||
574 | session = perf_session__new(output_name, O_WRONLY, | 577 | session = perf_session__new(output_name, O_WRONLY, |
575 | write_mode == WRITE_FORCE, false); | 578 | write_mode == WRITE_FORCE, false, NULL); |
576 | if (session == NULL) { | 579 | if (session == NULL) { |
577 | pr_err("Not enough memory for reading perf file header\n"); | 580 | pr_err("Not enough memory for reading perf file header\n"); |
578 | return -1; | 581 | return -1; |