perf tools: Tidy guest option documentation
authorAdrian Hunter <adrian.hunter@intel.com>
Thu, 11 Aug 2022 17:04:11 +0000 (20:04 +0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 11 Aug 2022 21:50:17 +0000 (18:50 -0300)
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 <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20220811170411.84154-4-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/Documentation/guest-files.txt [new file with mode: 0644]
tools/perf/Documentation/guestmount.txt [new file with mode: 0644]
tools/perf/Documentation/perf-inject.txt
tools/perf/Documentation/perf-kvm.txt
tools/perf/Documentation/perf-script.txt

diff --git a/tools/perf/Documentation/guest-files.txt b/tools/perf/Documentation/guest-files.txt
new file mode 100644 (file)
index 0000000..8cc0b09
--- /dev/null
@@ -0,0 +1,16 @@
+include::guestmount.txt[]
+
+--guestkallsyms=<path>::
+       Guest OS /proc/kallsyms file copy. perf reads it to get guest
+       kernel symbols. Users copy it out from guest OS.
+
+--guestmodules=<path>::
+       Guest OS /proc/modules file copy. perf reads it to get guest
+       kernel module information. Users copy it out from guest OS.
+
+--guestvmlinux=<path>::
+       Guest OS kernel vmlinux.
+
+--guest-code::
+       Indicate that guest code can be found in the hypervisor process,
+       which is a common case for KVM test programs.
diff --git a/tools/perf/Documentation/guestmount.txt b/tools/perf/Documentation/guestmount.txt
new file mode 100644 (file)
index 0000000..6edf123
--- /dev/null
@@ -0,0 +1,11 @@
+--guestmount=<path>::
+       Guest OS root file system mount directory. Users mount guest OS
+       root directories under <path> by a specific filesystem access method,
+       typically, sshfs.
+       For example, start 2 guest OS, one's pid is 8888 and the other's is 9999:
+[verse]
+       $ mkdir \~/guestmount
+       $ cd \~/guestmount
+       $ sshfs -o allow_other,direct_io -p 5551 localhost:/ 8888/
+       $ sshfs -o allow_other,direct_io -p 5552 localhost:/ 9999/
+       $ perf {GMEXAMPLECMD} --guestmount=~/guestmount {GMEXAMPLESUBCMD}
index c741ca2107b1f45c621f70a9b5a80b1a3c569d63..ffc293fdf61df3d0c9e85977dcaa99033e0ff271 100644 (file)
@@ -102,17 +102,9 @@ include::itrace.txt[]
        should be used, and also --buildid-all and --switch-events may be
        useful.
 
---guestmount=<path>::
-       Guest OS root file system mount directory. Users mount guest OS
-       root directories under <path> by a specific filesystem access method,
-       typically, sshfs.
-       For example, start 2 guest OS, one's pid is 8888 and the other's is 9999:
-[verse]
-       $ mkdir \~/guestmount
-       $ cd \~/guestmount
-       $ sshfs -o allow_other,direct_io -p 5551 localhost:/ 8888/
-       $ sshfs -o allow_other,direct_io -p 5552 localhost:/ 9999/
-       $ perf inject --guestmount=~/guestmount
+:GMEXAMPLECMD: inject
+:GMEXAMPLESUBCMD:
+include::guestmount.txt[]
 
 SEE ALSO
 --------
index 83c742adf86e143698a1f2201205f391fd48e203..2ad3f5d9f72b5fcb23a720a6c54cd581530961f0 100644 (file)
@@ -77,26 +77,11 @@ OPTIONS
         Collect host side performance profile.
 --guest::
         Collect guest side performance profile.
---guestmount=<path>::
-       Guest os root file system mount directory. Users mounts guest os
-        root directories under <path> by a specific filesystem access method,
-       typically, sshfs. For example, start 2 guest os. The one's pid is 8888
-       and the other's is 9999.
-        #mkdir ~/guestmount; cd ~/guestmount
-        #sshfs -o allow_other,direct_io -p 5551 localhost:/ 8888/
-        #sshfs -o allow_other,direct_io -p 5552 localhost:/ 9999/
-        #perf kvm --host --guest --guestmount=~/guestmount top
---guestkallsyms=<path>::
-        Guest os /proc/kallsyms file copy. 'perf' kvm' reads it to get guest
-       kernel symbols. Users copy it out from guest os.
---guestmodules=<path>::
-       Guest os /proc/modules file copy. 'perf' kvm' reads it to get guest
-       kernel module information. Users copy it out from guest os.
---guestvmlinux=<path>::
-       Guest os kernel vmlinux.
---guest-code::
-       Indicate that guest code can be found in the hypervisor process,
-       which is a common case for KVM test programs.
+
+:GMEXAMPLECMD: kvm --host --guest
+:GMEXAMPLESUBCMD: top
+include::guest-files.txt[]
+
 -v::
 --verbose::
        Be more verbose (show counter open errors, etc).
index 48ee42a891b66e40db1dac64a1066b7b2518e4d1..68e37de5fae47b385cc31d617047134662569bf0 100644 (file)
@@ -487,29 +487,6 @@ include::itrace.txt[]
        For itrace only show specified functions and their callees for
        itrace. Multiple functions can be separated by comma.
 
---guestmount=<path>::
-       Guest OS root file system mount directory. Users mount guest OS
-       root directories under <path> by a specific filesystem access method,
-       typically, sshfs.
-       For example, start 2 guest OS, one's pid is 8888 and the other's is 9999:
-[verse]
-       $ mkdir \~/guestmount
-       $ cd \~/guestmount
-       $ sshfs -o allow_other,direct_io -p 5551 localhost:/ 8888/
-       $ sshfs -o allow_other,direct_io -p 5552 localhost:/ 9999/
-       $ perf script --guestmount=~/guestmount
-
---guestkallsyms=<path>::
-       Guest OS /proc/kallsyms file copy. perf reads it to get guest
-       kernel symbols. Users copy it out from guest OS.
-
---guestmodules=<path>::
-       Guest OS /proc/modules file copy. perf reads it to get guest
-       kernel module information. Users copy it out from guest OS.
-
---guestvmlinux=<path>::
-       Guest OS kernel vmlinux.
-
 --switch-on EVENT_NAME::
        Only consider events after this event is found.
 
@@ -530,9 +507,9 @@ include::itrace.txt[]
        The known limitations include exception handing such as
        setjmp/longjmp will have calls/returns not match.
 
---guest-code::
-       Indicate that guest code can be found in the hypervisor process,
-       which is a common case for KVM test programs.
+:GMEXAMPLECMD: script
+:GMEXAMPLESUBCMD:
+include::guest-files.txt[]
 
 SEE ALSO
 --------