diff options
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/Documentation/perf-record.txt | 3 | ||||
-rw-r--r-- | tools/perf/builtin-record.c | 12 | ||||
-rw-r--r-- | tools/perf/builtin-sched.c | 18 | ||||
-rw-r--r-- | tools/perf/builtin-stat.c | 1 | ||||
-rw-r--r-- | tools/perf/builtin-top.c | 5 | ||||
-rw-r--r-- | tools/perf/perf.c | 2 |
6 files changed, 25 insertions, 16 deletions
diff --git a/tools/perf/Documentation/perf-record.txt b/tools/perf/Documentation/perf-record.txt index 52462ae26455..e032716c839b 100644 --- a/tools/perf/Documentation/perf-record.txt +++ b/tools/perf/Documentation/perf-record.txt | |||
@@ -61,6 +61,9 @@ OPTIONS | |||
61 | -r:: | 61 | -r:: |
62 | --realtime=:: | 62 | --realtime=:: |
63 | Collect data with this RT SCHED_FIFO priority. | 63 | Collect data with this RT SCHED_FIFO priority. |
64 | -D:: | ||
65 | --no-delay:: | ||
66 | Collect data without buffering. | ||
64 | -A:: | 67 | -A:: |
65 | --append:: | 68 | --append:: |
66 | Append to the output file to do incremental profiling. | 69 | Append to the output file to do incremental profiling. |
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, |
diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c index abd4b8497bc4..29e7ffd85690 100644 --- a/tools/perf/builtin-sched.c +++ b/tools/perf/builtin-sched.c | |||
@@ -1843,15 +1843,15 @@ static const char *record_args[] = { | |||
1843 | "-f", | 1843 | "-f", |
1844 | "-m", "1024", | 1844 | "-m", "1024", |
1845 | "-c", "1", | 1845 | "-c", "1", |
1846 | "-e", "sched:sched_switch:r", | 1846 | "-e", "sched:sched_switch", |
1847 | "-e", "sched:sched_stat_wait:r", | 1847 | "-e", "sched:sched_stat_wait", |
1848 | "-e", "sched:sched_stat_sleep:r", | 1848 | "-e", "sched:sched_stat_sleep", |
1849 | "-e", "sched:sched_stat_iowait:r", | 1849 | "-e", "sched:sched_stat_iowait", |
1850 | "-e", "sched:sched_stat_runtime:r", | 1850 | "-e", "sched:sched_stat_runtime", |
1851 | "-e", "sched:sched_process_exit:r", | 1851 | "-e", "sched:sched_process_exit", |
1852 | "-e", "sched:sched_process_fork:r", | 1852 | "-e", "sched:sched_process_fork", |
1853 | "-e", "sched:sched_wakeup:r", | 1853 | "-e", "sched:sched_wakeup", |
1854 | "-e", "sched:sched_migrate_task:r", | 1854 | "-e", "sched:sched_migrate_task", |
1855 | }; | 1855 | }; |
1856 | 1856 | ||
1857 | static int __cmd_record(int argc, const char **argv) | 1857 | static int __cmd_record(int argc, const char **argv) |
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index c385a63ebfd1..0ff11d9b13be 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c | |||
@@ -743,6 +743,7 @@ int cmd_stat(int argc, const char **argv, const char *prefix __used) | |||
743 | out_free_fd: | 743 | out_free_fd: |
744 | list_for_each_entry(pos, &evsel_list, node) | 744 | list_for_each_entry(pos, &evsel_list, node) |
745 | perf_evsel__free_stat_priv(pos); | 745 | perf_evsel__free_stat_priv(pos); |
746 | perf_evsel_list__delete(); | ||
746 | out: | 747 | out: |
747 | thread_map__delete(threads); | 748 | thread_map__delete(threads); |
748 | threads = NULL; | 749 | threads = NULL; |
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 6ce4042421bd..05344c6210ac 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c | |||
@@ -1247,8 +1247,6 @@ try_again: | |||
1247 | die("Permission error - are you root?\n" | 1247 | die("Permission error - are you root?\n" |
1248 | "\t Consider tweaking" | 1248 | "\t Consider tweaking" |
1249 | " /proc/sys/kernel/perf_event_paranoid.\n"); | 1249 | " /proc/sys/kernel/perf_event_paranoid.\n"); |
1250 | if (err == ENOENT) | ||
1251 | die("%s event is not supported. ", event_name(evsel)); | ||
1252 | /* | 1250 | /* |
1253 | * If it's cycles then fall back to hrtimer | 1251 | * If it's cycles then fall back to hrtimer |
1254 | * based cpu-clock-tick sw counter, which | 1252 | * based cpu-clock-tick sw counter, which |
@@ -1473,6 +1471,8 @@ int cmd_top(int argc, const char **argv, const char *prefix __used) | |||
1473 | pos->attr.sample_period = default_interval; | 1471 | pos->attr.sample_period = default_interval; |
1474 | } | 1472 | } |
1475 | 1473 | ||
1474 | sym_evsel = list_entry(evsel_list.next, struct perf_evsel, node); | ||
1475 | |||
1476 | symbol_conf.priv_size = (sizeof(struct sym_entry) + | 1476 | symbol_conf.priv_size = (sizeof(struct sym_entry) + |
1477 | (nr_counters + 1) * sizeof(unsigned long)); | 1477 | (nr_counters + 1) * sizeof(unsigned long)); |
1478 | 1478 | ||
@@ -1490,6 +1490,7 @@ int cmd_top(int argc, const char **argv, const char *prefix __used) | |||
1490 | out_free_fd: | 1490 | out_free_fd: |
1491 | list_for_each_entry(pos, &evsel_list, node) | 1491 | list_for_each_entry(pos, &evsel_list, node) |
1492 | perf_evsel__free_mmap(pos); | 1492 | perf_evsel__free_mmap(pos); |
1493 | perf_evsel_list__delete(); | ||
1493 | 1494 | ||
1494 | return status; | 1495 | return status; |
1495 | } | 1496 | } |
diff --git a/tools/perf/perf.c b/tools/perf/perf.c index 5b1ecd66bb36..595d0f4a7103 100644 --- a/tools/perf/perf.c +++ b/tools/perf/perf.c | |||
@@ -286,8 +286,6 @@ static int run_builtin(struct cmd_struct *p, int argc, const char **argv) | |||
286 | status = p->fn(argc, argv, prefix); | 286 | status = p->fn(argc, argv, prefix); |
287 | exit_browser(status); | 287 | exit_browser(status); |
288 | 288 | ||
289 | perf_evsel_list__delete(); | ||
290 | |||
291 | if (status) | 289 | if (status) |
292 | return status & 0xff; | 290 | return status & 0xff; |
293 | 291 | ||