diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-04-20 09:52:29 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-04-20 11:36:49 -0400 |
commit | 1d8c8b209e9351a7de1307d7b9b6df4222b8d742 (patch) | |
tree | 43acf25217e2760bac99ced7575ad809d641f75f /Documentation | |
parent | ddcacfa0febff6454dba6cea1931f3020a9f6c24 (diff) |
perf_counter tools: add help texts
Add Documentation/perf-stat.txt and Documentation/perf-top.txt.
The template that was used for it: Documentation/git-add.txt from Git.
Fix up small bugs to make these help texts show up both in the 'perf'
common-command summary output screen, and on the individual help screens.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/perf_counter/Documentation/perf-stat.txt | 76 | ||||
-rw-r--r-- | Documentation/perf_counter/Documentation/perf-top.txt | 61 | ||||
-rw-r--r-- | Documentation/perf_counter/builtin.h | 4 | ||||
-rwxr-xr-x | Documentation/perf_counter/generate-cmdlist.sh | 8 |
4 files changed, 143 insertions, 6 deletions
diff --git a/Documentation/perf_counter/Documentation/perf-stat.txt b/Documentation/perf_counter/Documentation/perf-stat.txt new file mode 100644 index 000000000000..7fcab271e570 --- /dev/null +++ b/Documentation/perf_counter/Documentation/perf-stat.txt | |||
@@ -0,0 +1,76 @@ | |||
1 | perf-stat(1) | ||
2 | ========== | ||
3 | |||
4 | NAME | ||
5 | ---- | ||
6 | perf-stat - Run a command and gather performance counter statistics | ||
7 | |||
8 | SYNOPSIS | ||
9 | -------- | ||
10 | [verse] | ||
11 | 'perf stat' [-e <EVENT> | --event=EVENT] [-l] [-a] <command> | ||
12 | |||
13 | DESCRIPTION | ||
14 | ----------- | ||
15 | This command runs a command and gathers performance counter statistics | ||
16 | from it. | ||
17 | |||
18 | |||
19 | OPTIONS | ||
20 | ------- | ||
21 | <command>...:: | ||
22 | Any command you can specify in a shell. | ||
23 | |||
24 | -e:: | ||
25 | --event=:: | ||
26 | 0:0: cpu-cycles | ||
27 | 0:0: cycles | ||
28 | 0:1: instructions | ||
29 | 0:2: cache-references | ||
30 | 0:3: cache-misses | ||
31 | 0:4: branch-instructions | ||
32 | 0:4: branches | ||
33 | 0:5: branch-misses | ||
34 | 0:6: bus-cycles | ||
35 | 1:0: cpu-clock | ||
36 | 1:1: task-clock | ||
37 | 1:2: page-faults | ||
38 | 1:2: faults | ||
39 | 1:5: minor-faults | ||
40 | 1:6: major-faults | ||
41 | 1:3: context-switches | ||
42 | 1:3: cs | ||
43 | 1:4: cpu-migrations | ||
44 | 1:4: migrations | ||
45 | rNNN: raw PMU events (eventsel+umask) | ||
46 | |||
47 | -a:: | ||
48 | system-wide collection | ||
49 | |||
50 | -l:: | ||
51 | scale counter values | ||
52 | |||
53 | Configuration | ||
54 | ------------- | ||
55 | |||
56 | EXAMPLES | ||
57 | -------- | ||
58 | |||
59 | $ perf stat sleep 1 | ||
60 | |||
61 | Performance counter stats for 'sleep': | ||
62 | |||
63 | 0.678356 task clock ticks (msecs) | ||
64 | 7 context switches (events) | ||
65 | 4 CPU migrations (events) | ||
66 | 232 pagefaults (events) | ||
67 | 1810403 CPU cycles (events) | ||
68 | 946759 instructions (events) | ||
69 | 18952 cache references (events) | ||
70 | 4885 cache misses (events) | ||
71 | |||
72 | Wall-clock time elapsed: 1001.252894 msecs | ||
73 | |||
74 | SEE ALSO | ||
75 | -------- | ||
76 | linkperf:git-tops[1] | ||
diff --git a/Documentation/perf_counter/Documentation/perf-top.txt b/Documentation/perf_counter/Documentation/perf-top.txt new file mode 100644 index 000000000000..057333b72534 --- /dev/null +++ b/Documentation/perf_counter/Documentation/perf-top.txt | |||
@@ -0,0 +1,61 @@ | |||
1 | perf-top(1) | ||
2 | ========== | ||
3 | |||
4 | NAME | ||
5 | ---- | ||
6 | perf-top - Run a command and profile it | ||
7 | |||
8 | SYNOPSIS | ||
9 | -------- | ||
10 | [verse] | ||
11 | 'perf top' [-e <EVENT> | --event=EVENT] [-l] [-a] <command> | ||
12 | |||
13 | DESCRIPTION | ||
14 | ----------- | ||
15 | This command runs a command and gathers a performance counter profile | ||
16 | from it. | ||
17 | |||
18 | |||
19 | OPTIONS | ||
20 | ------- | ||
21 | <command>...:: | ||
22 | Any command you can specify in a shell. | ||
23 | |||
24 | -e:: | ||
25 | --event=:: | ||
26 | 0:0: cpu-cycles | ||
27 | 0:0: cycles | ||
28 | 0:1: instructions | ||
29 | 0:2: cache-references | ||
30 | 0:3: cache-misses | ||
31 | 0:4: branch-instructions | ||
32 | 0:4: branches | ||
33 | 0:5: branch-misses | ||
34 | 0:6: bus-cycles | ||
35 | 1:0: cpu-clock | ||
36 | 1:1: task-clock | ||
37 | 1:2: page-faults | ||
38 | 1:2: faults | ||
39 | 1:5: minor-faults | ||
40 | 1:6: major-faults | ||
41 | 1:3: context-switches | ||
42 | 1:3: cs | ||
43 | 1:4: cpu-migrations | ||
44 | 1:4: migrations | ||
45 | rNNN: raw PMU events (eventsel+umask) | ||
46 | |||
47 | -a:: | ||
48 | system-wide collection | ||
49 | |||
50 | -l:: | ||
51 | scale counter values | ||
52 | |||
53 | Configuration | ||
54 | ------------- | ||
55 | |||
56 | EXAMPLES | ||
57 | -------- | ||
58 | |||
59 | SEE ALSO | ||
60 | -------- | ||
61 | linkperf:git-stat[1] | ||
diff --git a/Documentation/perf_counter/builtin.h b/Documentation/perf_counter/builtin.h index a3bb6cd6bed3..605323c691f1 100644 --- a/Documentation/perf_counter/builtin.h +++ b/Documentation/perf_counter/builtin.h | |||
@@ -14,6 +14,6 @@ extern void prune_packed_objects(int); | |||
14 | extern int read_line_with_nul(char *buf, int size, FILE *file); | 14 | extern int read_line_with_nul(char *buf, int size, FILE *file); |
15 | extern int check_pager_config(const char *cmd); | 15 | extern int check_pager_config(const char *cmd); |
16 | 16 | ||
17 | extern int cmd_top(int argc, char **argv, const char *prefix); | 17 | extern int cmd_top(int argc, const char **argv, const char *prefix); |
18 | extern int cmd_stat(int argc, char **argv, const char *prefix); | 18 | extern int cmd_stat(int argc, const char **argv, const char *prefix); |
19 | #endif | 19 | #endif |
diff --git a/Documentation/perf_counter/generate-cmdlist.sh b/Documentation/perf_counter/generate-cmdlist.sh index 75c68d948fd3..f06f6fd148f8 100755 --- a/Documentation/perf_counter/generate-cmdlist.sh +++ b/Documentation/perf_counter/generate-cmdlist.sh | |||
@@ -9,16 +9,16 @@ struct cmdname_help | |||
9 | 9 | ||
10 | static struct cmdname_help common_cmds[] = {" | 10 | static struct cmdname_help common_cmds[] = {" |
11 | 11 | ||
12 | sed -n -e 's/^git-\([^ ]*\)[ ].* common.*/\1/p' command-list.txt | | 12 | sed -n -e 's/^perf-\([^ ]*\)[ ].* common.*/\1/p' command-list.txt | |
13 | sort | | 13 | sort | |
14 | while read cmd | 14 | while read cmd |
15 | do | 15 | do |
16 | sed -n ' | 16 | sed -n ' |
17 | /^NAME/,/git-'"$cmd"'/H | 17 | /^NAME/,/perf-'"$cmd"'/H |
18 | ${ | 18 | ${ |
19 | x | 19 | x |
20 | s/.*git-'"$cmd"' - \(.*\)/ {"'"$cmd"'", "\1"},/ | 20 | s/.*perf-'"$cmd"' - \(.*\)/ {"'"$cmd"'", "\1"},/ |
21 | p | 21 | p |
22 | }' "Documentation/git-$cmd.txt" | 22 | }' "Documentation/perf-$cmd.txt" |
23 | done | 23 | done |
24 | echo "};" | 24 | echo "};" |