diff options
| author | Ingo Molnar <mingo@elte.hu> | 2011-03-16 08:42:48 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2011-03-16 08:44:06 -0400 |
| commit | 8b7cdd08fe304b41a2399eaaa5225159ac6db0d8 (patch) | |
| tree | 77aecdeaf0a9127717211d27c0fdff6e357846e4 /tools | |
| parent | d10902812c9cd5583130a4ebb9ad19c60b68149d (diff) | |
| parent | 43adec955edd116c3e98c6e2f85fbd63281f5221 (diff) | |
Merge branch 'perf/core' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux-2.6 into perf/urgent
Diffstat (limited to 'tools')
24 files changed, 580 insertions, 200 deletions
diff --git a/tools/perf/Documentation/perf-evlist.txt b/tools/perf/Documentation/perf-evlist.txt new file mode 100644 index 000000000000..0cada9e053dc --- /dev/null +++ b/tools/perf/Documentation/perf-evlist.txt | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | perf-evlist(1) | ||
| 2 | ============== | ||
| 3 | |||
| 4 | NAME | ||
| 5 | ---- | ||
| 6 | perf-evlist - List the event names in a perf.data file | ||
| 7 | |||
| 8 | SYNOPSIS | ||
| 9 | -------- | ||
| 10 | [verse] | ||
| 11 | 'perf evlist <options>' | ||
| 12 | |||
| 13 | DESCRIPTION | ||
| 14 | ----------- | ||
| 15 | This command displays the names of events sampled in a perf.data file. | ||
| 16 | |||
| 17 | OPTIONS | ||
| 18 | ------- | ||
| 19 | -i:: | ||
| 20 | --input=:: | ||
| 21 | Input file name. (default: perf.data) | ||
| 22 | |||
| 23 | SEE ALSO | ||
| 24 | -------- | ||
| 25 | linkperf:perf-record[1], linkperf:perf-list[1], | ||
| 26 | linkperf:perf-report[1] | ||
diff --git a/tools/perf/Documentation/perf-script.txt b/tools/perf/Documentation/perf-script.txt index 29ad94293cd2..66f040b30729 100644 --- a/tools/perf/Documentation/perf-script.txt +++ b/tools/perf/Documentation/perf-script.txt | |||
| @@ -112,6 +112,28 @@ OPTIONS | |||
| 112 | --debug-mode:: | 112 | --debug-mode:: |
| 113 | Do various checks like samples ordering and lost events. | 113 | Do various checks like samples ordering and lost events. |
| 114 | 114 | ||
| 115 | -f:: | ||
| 116 | --fields | ||
| 117 | Comma separated list of fields to print. Options are: | ||
| 118 | comm, tid, pid, time, cpu, event, trace, sym. Field | ||
| 119 | list must be prepended with the type, trace, sw or hw, | ||
| 120 | to indicate to which event type the field list applies. | ||
| 121 | e.g., -f sw:comm,tid,time,sym and -f trace:time,cpu,trace | ||
| 122 | |||
| 123 | -k:: | ||
| 124 | --vmlinux=<file>:: | ||
| 125 | vmlinux pathname | ||
| 126 | |||
| 127 | --kallsyms=<file>:: | ||
| 128 | kallsyms pathname | ||
| 129 | |||
| 130 | --symfs=<directory>:: | ||
| 131 | Look for files with symbols relative to this directory. | ||
| 132 | |||
| 133 | -G:: | ||
| 134 | --hide-call-graph:: | ||
| 135 | When printing symbols do not display call chain. | ||
| 136 | |||
| 115 | SEE ALSO | 137 | SEE ALSO |
| 116 | -------- | 138 | -------- |
| 117 | linkperf:perf-record[1], linkperf:perf-script-perl[1], | 139 | linkperf:perf-record[1], linkperf:perf-script-perl[1], |
diff --git a/tools/perf/Makefile b/tools/perf/Makefile index 9b8421805c5c..158c30e8210c 100644 --- a/tools/perf/Makefile +++ b/tools/perf/Makefile | |||
| @@ -338,6 +338,7 @@ endif | |||
| 338 | BUILTIN_OBJS += $(OUTPUT)bench/mem-memcpy.o | 338 | BUILTIN_OBJS += $(OUTPUT)bench/mem-memcpy.o |
| 339 | 339 | ||
| 340 | BUILTIN_OBJS += $(OUTPUT)builtin-diff.o | 340 | BUILTIN_OBJS += $(OUTPUT)builtin-diff.o |
| 341 | BUILTIN_OBJS += $(OUTPUT)builtin-evlist.o | ||
| 341 | BUILTIN_OBJS += $(OUTPUT)builtin-help.o | 342 | BUILTIN_OBJS += $(OUTPUT)builtin-help.o |
| 342 | BUILTIN_OBJS += $(OUTPUT)builtin-sched.o | 343 | BUILTIN_OBJS += $(OUTPUT)builtin-sched.o |
| 343 | BUILTIN_OBJS += $(OUTPUT)builtin-buildid-list.o | 344 | BUILTIN_OBJS += $(OUTPUT)builtin-buildid-list.o |
diff --git a/tools/perf/builtin-evlist.c b/tools/perf/builtin-evlist.c new file mode 100644 index 000000000000..4c5e9e04a41f --- /dev/null +++ b/tools/perf/builtin-evlist.c | |||
| @@ -0,0 +1,54 @@ | |||
| 1 | /* | ||
| 2 | * Builtin evlist command: Show the list of event selectors present | ||
| 3 | * in a perf.data file. | ||
| 4 | */ | ||
| 5 | #include "builtin.h" | ||
| 6 | |||
| 7 | #include "util/util.h" | ||
| 8 | |||
| 9 | #include <linux/list.h> | ||
| 10 | |||
| 11 | #include "perf.h" | ||
| 12 | #include "util/evlist.h" | ||
| 13 | #include "util/evsel.h" | ||
| 14 | #include "util/parse-events.h" | ||
| 15 | #include "util/parse-options.h" | ||
| 16 | #include "util/session.h" | ||
| 17 | |||
| 18 | static char const *input_name = "perf.data"; | ||
| 19 | |||
| 20 | static int __cmd_evlist(void) | ||
| 21 | { | ||
| 22 | struct perf_session *session; | ||
| 23 | struct perf_evsel *pos; | ||
| 24 | |||
| 25 | session = perf_session__new(input_name, O_RDONLY, 0, false, NULL); | ||
| 26 | if (session == NULL) | ||
| 27 | return -ENOMEM; | ||
| 28 | |||
| 29 | list_for_each_entry(pos, &session->evlist->entries, node) | ||
| 30 | printf("%s\n", event_name(pos)); | ||
| 31 | |||
| 32 | perf_session__delete(session); | ||
| 33 | return 0; | ||
| 34 | } | ||
| 35 | |||
| 36 | static const char * const evlist_usage[] = { | ||
| 37 | "perf evlist [<options>]", | ||
| 38 | NULL | ||
| 39 | }; | ||
| 40 | |||
| 41 | static const struct option options[] = { | ||
| 42 | OPT_STRING('i', "input", &input_name, "file", | ||
| 43 | "input file name"), | ||
| 44 | OPT_END() | ||
| 45 | }; | ||
| 46 | |||
| 47 | int cmd_evlist(int argc, const char **argv, const char *prefix __used) | ||
| 48 | { | ||
| 49 | argc = parse_options(argc, argv, options, evlist_usage, 0); | ||
| 50 | if (argc) | ||
| 51 | usage_with_options(evlist_usage, options); | ||
| 52 | |||
| 53 | return __cmd_evlist(); | ||
| 54 | } | ||
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index 5f40df635dcb..9f5fc5492141 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c | |||
| @@ -12,6 +12,8 @@ | |||
| 12 | #include "util/trace-event.h" | 12 | #include "util/trace-event.h" |
| 13 | #include "util/parse-options.h" | 13 | #include "util/parse-options.h" |
| 14 | #include "util/util.h" | 14 | #include "util/util.h" |
| 15 | #include "util/evlist.h" | ||
| 16 | #include "util/evsel.h" | ||
| 15 | 17 | ||
| 16 | static char const *script_name; | 18 | static char const *script_name; |
| 17 | static char const *generate_script_lang; | 19 | static char const *generate_script_lang; |
| @@ -19,6 +21,183 @@ static bool debug_mode; | |||
| 19 | static u64 last_timestamp; | 21 | static u64 last_timestamp; |
| 20 | static u64 nr_unordered; | 22 | static u64 nr_unordered; |
| 21 | extern const struct option record_options[]; | 23 | extern const struct option record_options[]; |
| 24 | static bool no_callchain; | ||
| 25 | |||
| 26 | enum perf_output_field { | ||
| 27 | PERF_OUTPUT_COMM = 1U << 0, | ||
| 28 | PERF_OUTPUT_TID = 1U << 1, | ||
| 29 | PERF_OUTPUT_PID = 1U << 2, | ||
| 30 | PERF_OUTPUT_TIME = 1U << 3, | ||
| 31 | PERF_OUTPUT_CPU = 1U << 4, | ||
| 32 | PERF_OUTPUT_EVNAME = 1U << 5, | ||
| 33 | PERF_OUTPUT_TRACE = 1U << 6, | ||
| 34 | PERF_OUTPUT_SYM = 1U << 7, | ||
