diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-14 02:56:32 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-14 02:56:32 -0500 |
| commit | fcd7476f9e03a36e709e0807198d47a826cc4e3a (patch) | |
| tree | 1a9017988a864fae9ec62fd9e08e18cdc42d06cf /tools | |
| parent | d320e203bad4cfcef3613e83a52f8c70a77e8a60 (diff) | |
| parent | d969135aae1434547f41853f0e8eaa622e8b8816 (diff) | |
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf updates from Ingo Molnar:
"A number of fixes:
- Fix segfault on perf trace -i perf.data, from Namhyung Kim.
- Fix segfault with --no-mmap-pages, from David Ahern.
- Don't force a refresh during progress update in the TUI, greatly
reducing startup costs, fix from Patrick Palka.
- Fix sw clock event period test wrt not checking if using >
max_sample_freq.
- Handle throttle events in 'object code reading' test, fix from
Adrian Hunter.
- Prevent condition that all sort keys are elided, fix from Namhyung
Kim.
- Round mmap pages to power 2, from David Ahern.
And a number of late arrival changes:
- Add summary only option to 'perf trace', suppressing the decoding
of events, from David Ahern
- 'perf trace --summary' formatting simplifications, from Pekka
Enberg.
- Beautify fifth argument of mmap() as fd, in 'perf trace', from
Namhyung Kim.
- Add direct access to dynamic arrays in libtraceevent, from Steven
Rostedt.
- Synthesize non-exec MMAP records when --data used, allowing the
resolution of data addresses to symbols (global variables, etc), by
Arnaldo Carvalho de Melo.
- Code cleanups by David Ahern and Adrian Hunter"
* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (23 commits)
tools lib traceevent: Add direct access to dynamic arrays
perf target: Shorten perf_target__ to target__
perf tests: Handle throttle events in 'object code reading' test
perf evlist: Refactor mmap_pages parsing
perf evlist: Round mmap pages to power 2 - v2
perf record: Fix segfault with --no-mmap-pages
perf trace: Add summary only option
perf trace: Simplify '--summary' output
perf trace: Change syscall summary duration order
perf tests: Compensate lower sample freq with longer test loop
perf trace: Fix segfault on perf trace -i perf.data
perf trace: Separate tp syscall field caching into init routine to be reused
perf trace: Beautify fifth argument of mmap() as fd
perf tests: Use lower sample_freq in sw clock event period test
perf tests: Check return of perf_evlist__open sw clock event period test
perf record: Move existing write_output into helper function
perf record: Use correct return type for write()
perf tools: Prevent condition that all sort keys are elided
perf machine: Simplify synthesize_threads method
perf machine: Introduce synthesize_threads method out of open coded equivalent
...
Diffstat (limited to 'tools')
31 files changed, 363 insertions, 264 deletions
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c index 8f450adaa9c2..0362d575de7d 100644 --- a/tools/lib/traceevent/event-parse.c +++ b/tools/lib/traceevent/event-parse.c | |||
| @@ -3435,6 +3435,19 @@ eval_num_arg(void *data, int size, struct event_format *event, struct print_arg | |||
| 3435 | goto out_warning_op; | 3435 | goto out_warning_op; |
| 3436 | } | 3436 | } |
| 3437 | break; | 3437 | break; |
| 3438 | case PRINT_DYNAMIC_ARRAY: | ||
| 3439 | /* Without [], we pass the address to the dynamic data */ | ||
| 3440 | offset = pevent_read_number(pevent, | ||
| 3441 | data + arg->dynarray.field->offset, | ||
| 3442 | arg->dynarray.field->size); | ||
| 3443 | /* | ||
| 3444 | * The actual length of the dynamic array is stored | ||
| 3445 | * in the top half of the field, and the offset | ||
| 3446 | * is in the bottom half of the 32 bit field. | ||
| 3447 | */ | ||
| 3448 | offset &= 0xffff; | ||
| 3449 | val = (unsigned long long)(data + offset); | ||
| 3450 | break; | ||
| 3438 | default: /* not sure what to do there */ | 3451 | default: /* not sure what to do there */ |
| 3439 | return 0; | 3452 | return 0; |
| 3440 | } | 3453 | } |
diff --git a/tools/perf/Documentation/perf-trace.txt b/tools/perf/Documentation/perf-trace.txt index 7b0497f95a75..fae38d9a44a4 100644 --- a/tools/perf/Documentation/perf-trace.txt +++ b/tools/perf/Documentation/perf-trace.txt | |||
| @@ -93,9 +93,15 @@ the thread executes on the designated CPUs. Default is to monitor all CPUs. | |||
| 93 | --comm:: | 93 | --comm:: |
| 94 | Show process COMM right beside its ID, on by default, disable with --no-comm. | 94 | Show process COMM right beside its ID, on by default, disable with --no-comm. |
| 95 | 95 | ||
| 96 | -s:: | ||
| 96 | --summary:: | 97 | --summary:: |
| 97 | Show a summary of syscalls by thread with min, max, and average times (in | 98 | Show only a summary of syscalls by thread with min, max, and average times |
| 98 | msec) and relative stddev. | 99 | (in msec) and relative stddev. |
| 100 | |||
| 101 | -S:: | ||
| 102 | --with-summary:: | ||
| 103 | Show all syscalls followed by a summary by thread with min, max, and | ||
| 104 | average times (in msec) and relative stddev. | ||
| 99 | 105 | ||
| 100 | --tool_stats:: | 106 | --tool_stats:: |
| 101 | Show tool stats such as number of times fd->pathname was discovered thru | 107 | Show tool stats such as number of times fd->pathname was discovered thru |
diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c index cd9f92078aba..f8bf5f244d77 100644 --- a/tools/perf/builtin-kvm.c +++ b/tools/perf/builtin-kvm.c | |||
| @@ -1510,13 +1510,13 @@ static int kvm_events_live(struct perf_kvm_stat *kvm, | |||
| 1510 | /* | 1510 | /* |
| 1511 | * target related setups | 1511 | * target related setups |
| 1512 | */ | 1512 | */ |
| 1513 | err = perf_target__validate(&kvm->opts.target); | 1513 | err = target__validate(&kvm->opts.target); |
| 1514 | if (err) { | 1514 | if (err) { |
| 1515 | perf_target__strerror(&kvm->opts.target, err, errbuf, BUFSIZ); | 1515 | target__strerror(&kvm->opts.target, err, errbuf, BUFSIZ); |
| 1516 | ui__warning("%s", errbuf); | 1516 | ui__warning("%s", errbuf); |
| 1517 | } | 1517 | } |
| 1518 | 1518 | ||
| 1519 | if (perf_target__none(&kvm->opts.target)) | 1519 | if (target__none(&kvm->opts.target)) |
| 1520 | kvm->opts.target.system_wide = true; | 1520 | kvm->opts.target.system_wide = true; |
| 1521 | 1521 | ||
| 1522 | 1522 | ||
| @@ -1544,18 +1544,8 @@ static int kvm_events_live(struct perf_kvm_stat *kvm, | |||
| 1544 | } | 1544 | } |
| 1545 | kvm->session->evlist = kvm->evlist; | 1545 | kvm->session->evlist = kvm->evlist; |
| 1546 | perf_session__set_id_hdr_size(kvm->session); | 1546 | perf_session__set_id_hdr_size(kvm->session); |
| 1547 | 1547 | machine__synthesize_threads(&kvm->session->machines.host, &kvm->opts.target, | |
| 1548 | 1548 | kvm->evlist->threads, false); | |
| 1549 | if (perf_target__has_task(&kvm->opts.target)) | ||
| 1550 | perf_event__synthesize_thread_map(&kvm->tool, | ||
| 1551 | kvm->evlist->threads, | ||
| 1552 | perf_event__process, | ||
| 1553 | &kvm->session->machines.host); | ||
| 1554 | else | ||
| 1555 | perf_event__synthesize_threads(&kvm->tool, perf_event__process, | ||
| 1556 | &kvm->session->machines.host); | ||
| 1557 | |||
| 1558 | |||
| 1559 | err = kvm_live_open_events(kvm); | 1549 | err = kvm_live_open_events(kvm); |
| 1560 | if (err) | 1550 | if (err) |
| 1561 | goto out; | 1551 | goto out; |
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 15280b5e5574..4d644fe2d5b7 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c | |||
| @@ -76,12 +76,12 @@ struct perf_record { | |||
| 76 | long samples; | 76 | long samples; |
| 77 | }; | 77 | }; |
| 78 | 78 | ||
| 79 | static int write_output(struct perf_record *rec, void *buf, size_t size) | 79 | static int do_write_output(struct perf_record *rec, void *buf, size_t size) |
| 80 | { | 80 | { |
| 81 | struct perf_data_file *file = &rec->file; | 81 | struct perf_data_file *file = &rec->file; |
| 82 | 82 | ||
| 83 | while (size) { | 83 | while (size) { |
| 84 | int ret = write(file->fd, buf, size); | 84 | ssize_t ret = write(file->fd, buf, size); |
| 85 | 85 | ||
| 86 | if (ret < 0) { | 86 | if (ret < 0) { |
| 87 | pr_err("failed to write perf data, error: %m\n"); | 87 | pr_err("failed to write perf data, error: %m\n"); |
| @@ -97,6 +97,11 @@ static int write_output(struct perf_record *rec, void *buf, size_t size) | |||
| 97 | return 0; | 97 | return 0; |
| 98 | } | 98 | } |
| 99 | 99 | ||
| 100 | static int write_output(struct perf_record *rec, void *buf, size_t size) | ||
| 101 | { | ||
| 102 | return do_write_output(rec, buf, size); | ||
| 103 | } | ||
| 104 | |||
| 100 | static int process_synthesized_event(struct perf_tool *tool, | 105 | static int process_synthesized_event(struct perf_tool *tool, |
| 101 | union perf_event *event, | 106 | union perf_event *event, |
| 102 | struct perf_sample *sample __maybe_unused, | 107 | struct perf_sample *sample __maybe_unused, |
| @@ -480,16 +485,8 @@ static int __cmd_record(struct perf_record *rec, int argc, const char **argv) | |||
| 480 | perf_event__synthesize_guest_os, tool); | 485 | perf_event__synthesize_guest_os, tool); |
| 481 | } | ||
