diff options
Diffstat (limited to 'tools/perf/builtin-record.c')
-rw-r--r-- | tools/perf/builtin-record.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 7069bd3e90b3..df6064ad9bf2 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c | |||
@@ -49,6 +49,7 @@ static int pipe_output = 0; | |||
49 | static const char *output_name = "perf.data"; | 49 | static const char *output_name = "perf.data"; |
50 | static int group = 0; | 50 | static int group = 0; |
51 | static int realtime_prio = 0; | 51 | static int realtime_prio = 0; |
52 | static bool nodelay = false; | ||
52 | static bool raw_samples = false; | 53 | static bool raw_samples = false; |
53 | static bool sample_id_all_avail = true; | 54 | static bool sample_id_all_avail = true; |
54 | static bool system_wide = false; | 55 | static bool system_wide = false; |
@@ -307,6 +308,11 @@ static void create_counter(struct perf_evsel *evsel, int cpu) | |||
307 | attr->sample_type |= PERF_SAMPLE_CPU; | 308 | attr->sample_type |= PERF_SAMPLE_CPU; |
308 | } | 309 | } |
309 | 310 | ||
311 | if (nodelay) { | ||
312 | attr->watermark = 0; | ||
313 | attr->wakeup_events = 1; | ||
314 | } | ||
315 | |||
310 | attr->mmap = track; | 316 | attr->mmap = track; |
311 | attr->comm = track; | 317 | attr->comm = track; |
312 | attr->inherit = !no_inherit; | 318 | attr->inherit = !no_inherit; |
@@ -331,9 +337,6 @@ try_again: | |||
331 | else if (err == ENODEV && cpu_list) { | 337 | else if (err == ENODEV && cpu_list) { |
332 | die("No such device - did you specify" | 338 | die("No such device - did you specify" |
333 | " an out-of-range profile CPU?\n"); | 339 | " an out-of-range profile CPU?\n"); |
334 | } else if (err == ENOENT) { | ||
335 | die("%s event is not supported. ", | ||
336 | event_name(evsel)); | ||
337 | } else if (err == EINVAL && sample_id_all_avail) { | 340 | } else if (err == EINVAL && sample_id_all_avail) { |
338 | /* | 341 | /* |
339 | * Old kernel, no attr->sample_id_type_all field | 342 | * Old kernel, no attr->sample_id_type_all field |
@@ -480,6 +483,7 @@ static void atexit_header(void) | |||
480 | process_buildids(); | 483 | process_buildids(); |
481 | perf_header__write(&session->header, output, true); | 484 | perf_header__write(&session->header, output, true); |
482 | perf_session__delete(session); | 485 | perf_session__delete(session); |
486 | perf_evsel_list__delete(); | ||
483 | symbol__exit(); | 487 | symbol__exit(); |
484 | } | 488 | } |
485 | } | 489 | } |
@@ -845,6 +849,8 @@ const struct option record_options[] = { | |||
845 | "record events on existing thread id"), | 849 | "record events on existing thread id"), |
846 | OPT_INTEGER('r', "realtime", &realtime_prio, | 850 | OPT_INTEGER('r', "realtime", &realtime_prio, |
847 | "collect data with this RT SCHED_FIFO priority"), | 851 | "collect data with this RT SCHED_FIFO priority"), |
852 | OPT_BOOLEAN('D', "no-delay", &nodelay, | ||
853 | "collect data without buffering"), | ||
848 | OPT_BOOLEAN('R', "raw-samples", &raw_samples, | 854 | OPT_BOOLEAN('R', "raw-samples", &raw_samples, |
849 | "collect raw sample records from all opened counters"), | 855 | "collect raw sample records from all opened counters"), |
850 | OPT_BOOLEAN('a', "all-cpus", &system_wide, | 856 | OPT_BOOLEAN('a', "all-cpus", &system_wide, |