aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-04-20 09:52:29 -0400
committerIngo Molnar <mingo@elte.hu>2009-04-20 11:36:49 -0400
commit1d8c8b209e9351a7de1307d7b9b6df4222b8d742 (patch)
tree43acf25217e2760bac99ced7575ad809d641f75f /Documentation
parentddcacfa0febff6454dba6cea1931f3020a9f6c24 (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.txt76
-rw-r--r--Documentation/perf_counter/Documentation/perf-top.txt61
-rw-r--r--Documentation/perf_counter/builtin.h4
-rwxr-xr-xDocumentation/perf_counter/generate-cmdlist.sh8
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 @@
1perf-stat(1)
2==========
3
4NAME
5----
6perf-stat - Run a command and gather performance counter statistics
7
8SYNOPSIS
9--------
10[verse]
11'perf stat' [-e <EVENT> | --event=EVENT] [-l] [-a] <command>
12
13DESCRIPTION
14-----------
15This command runs a command and gathers performance counter statistics
16from it.
17
18
19OPTIONS
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
53Configuration
54-------------
55
56EXAMPLES
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
74SEE ALSO
75--------
76linkperf: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 @@
1perf-top(1)
2==========
3
4NAME
5----
6perf-top - Run a command and profile it
7
8SYNOPSIS
9--------
10[verse]
11'perf top' [-e <EVENT> | --event=EVENT] [-l] [-a] <command>
12
13DESCRIPTION
14-----------
15This command runs a command and gathers a performance counter profile
16from it.
17
18
19OPTIONS
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
53Configuration
54-------------
55
56EXAMPLES
57--------
58
59SEE ALSO
60--------
61linkperf: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);
14extern int read_line_with_nul(char *buf, int size, FILE *file); 14extern int read_line_with_nul(char *buf, int size, FILE *file);
15extern int check_pager_config(const char *cmd); 15extern int check_pager_config(const char *cmd);
16 16
17extern int cmd_top(int argc, char **argv, const char *prefix); 17extern int cmd_top(int argc, const char **argv, const char *prefix);
18extern int cmd_stat(int argc, char **argv, const char *prefix); 18extern 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
10static struct cmdname_help common_cmds[] = {" 10static struct cmdname_help common_cmds[] = {"
11 11
12sed -n -e 's/^git-\([^ ]*\)[ ].* common.*/\1/p' command-list.txt | 12sed -n -e 's/^perf-\([^ ]*\)[ ].* common.*/\1/p' command-list.txt |
13sort | 13sort |
14while read cmd 14while read cmd
15do 15do
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"
23done 23done
24echo "};" 24echo "};"