Skip to content

Commit 53e76d3

Browse files
ahunter6acmel
authored andcommitted
perf tools: Tidy guest option documentation
Move common guest options into include files. Use attribute substitution to customize an example, using "[verse]" to define the block instead of a "literal" block which does not permit substitution. Signed-off-by: Adrian Hunter <[email protected]> Cc: Ian Rogers <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Namhyung Kim <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent d9ca43c commit 53e76d3

File tree

5 files changed

+38
-57
lines changed

5 files changed

+38
-57
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
include::guestmount.txt[]
2+
3+
--guestkallsyms=<path>::
4+
Guest OS /proc/kallsyms file copy. perf reads it to get guest
5+
kernel symbols. Users copy it out from guest OS.
6+
7+
--guestmodules=<path>::
8+
Guest OS /proc/modules file copy. perf reads it to get guest
9+
kernel module information. Users copy it out from guest OS.
10+
11+
--guestvmlinux=<path>::
12+
Guest OS kernel vmlinux.
13+
14+
--guest-code::
15+
Indicate that guest code can be found in the hypervisor process,
16+
which is a common case for KVM test programs.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--guestmount=<path>::
2+
Guest OS root file system mount directory. Users mount guest OS
3+
root directories under <path> by a specific filesystem access method,
4+
typically, sshfs.
5+
For example, start 2 guest OS, one's pid is 8888 and the other's is 9999:
6+
[verse]
7+
$ mkdir \~/guestmount
8+
$ cd \~/guestmount
9+
$ sshfs -o allow_other,direct_io -p 5551 localhost:/ 8888/
10+
$ sshfs -o allow_other,direct_io -p 5552 localhost:/ 9999/
11+
$ perf {GMEXAMPLECMD} --guestmount=~/guestmount {GMEXAMPLESUBCMD}

tools/perf/Documentation/perf-inject.txt

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -102,17 +102,9 @@ include::itrace.txt[]
102102
should be used, and also --buildid-all and --switch-events may be
103103
useful.
104104

105-
--guestmount=<path>::
106-
Guest OS root file system mount directory. Users mount guest OS
107-
root directories under <path> by a specific filesystem access method,
108-
typically, sshfs.
109-
For example, start 2 guest OS, one's pid is 8888 and the other's is 9999:
110-
[verse]
111-
$ mkdir \~/guestmount
112-
$ cd \~/guestmount
113-
$ sshfs -o allow_other,direct_io -p 5551 localhost:/ 8888/
114-
$ sshfs -o allow_other,direct_io -p 5552 localhost:/ 9999/
115-
$ perf inject --guestmount=~/guestmount
105+
:GMEXAMPLECMD: inject
106+
:GMEXAMPLESUBCMD:
107+
include::guestmount.txt[]
116108

117109
SEE ALSO
118110
--------

tools/perf/Documentation/perf-kvm.txt

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -77,26 +77,11 @@ OPTIONS
7777
Collect host side performance profile.
7878
--guest::
7979
Collect guest side performance profile.
80-
--guestmount=<path>::
81-
Guest os root file system mount directory. Users mounts guest os
82-
root directories under <path> by a specific filesystem access method,
83-
typically, sshfs. For example, start 2 guest os. The one's pid is 8888
84-
and the other's is 9999.
85-
#mkdir ~/guestmount; cd ~/guestmount
86-
#sshfs -o allow_other,direct_io -p 5551 localhost:/ 8888/
87-
#sshfs -o allow_other,direct_io -p 5552 localhost:/ 9999/
88-
#perf kvm --host --guest --guestmount=~/guestmount top
89-
--guestkallsyms=<path>::
90-
Guest os /proc/kallsyms file copy. 'perf' kvm' reads it to get guest
91-
kernel symbols. Users copy it out from guest os.
92-
--guestmodules=<path>::
93-
Guest os /proc/modules file copy. 'perf' kvm' reads it to get guest
94-
kernel module information. Users copy it out from guest os.
95-
--guestvmlinux=<path>::
96-
Guest os kernel vmlinux.
97-
--guest-code::
98-
Indicate that guest code can be found in the hypervisor process,
99-
which is a common case for KVM test programs.
80+
81+
:GMEXAMPLECMD: kvm --host --guest
82+
:GMEXAMPLESUBCMD: top
83+
include::guest-files.txt[]
84+
10085
-v::
10186
--verbose::
10287
Be more verbose (show counter open errors, etc).

tools/perf/Documentation/perf-script.txt

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -487,29 +487,6 @@ include::itrace.txt[]
487487
For itrace only show specified functions and their callees for
488488
itrace. Multiple functions can be separated by comma.
489489

490-
--guestmount=<path>::
491-
Guest OS root file system mount directory. Users mount guest OS
492-
root directories under <path> by a specific filesystem access method,
493-
typically, sshfs.
494-
For example, start 2 guest OS, one's pid is 8888 and the other's is 9999:
495-
[verse]
496-
$ mkdir \~/guestmount
497-
$ cd \~/guestmount
498-
$ sshfs -o allow_other,direct_io -p 5551 localhost:/ 8888/
499-
$ sshfs -o allow_other,direct_io -p 5552 localhost:/ 9999/
500-
$ perf script --guestmount=~/guestmount
501-
502-
--guestkallsyms=<path>::
503-
Guest OS /proc/kallsyms file copy. perf reads it to get guest
504-
kernel symbols. Users copy it out from guest OS.
505-
506-
--guestmodules=<path>::
507-
Guest OS /proc/modules file copy. perf reads it to get guest
508-
kernel module information. Users copy it out from guest OS.
509-
510-
--guestvmlinux=<path>::
511-
Guest OS kernel vmlinux.
512-
513490
--switch-on EVENT_NAME::
514491
Only consider events after this event is found.
515492

@@ -530,9 +507,9 @@ include::itrace.txt[]
530507
The known limitations include exception handing such as
531508
setjmp/longjmp will have calls/returns not match.
532509

533-
--guest-code::
534-
Indicate that guest code can be found in the hypervisor process,
535-
which is a common case for KVM test programs.
510+
:GMEXAMPLECMD: script
511+
:GMEXAMPLESUBCMD:
512+
include::guest-files.txt[]
536513

537514
SEE ALSO
538515
--------

0 commit comments

Comments
 (0)