Skip to content

Commit 5b20814

Browse files
ahunter6acmel
authored andcommitted
perf script: Add guest_code support
Add an option to indicate that guest code can be found in the hypervisor process. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Ian Rogers <irogers@google.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Leo Yan <leo.yan@linaro.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: kvm@vger.kernel.org Link: https://lore.kernel.org/r/20220517131011.6117-5-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent 096fc36 commit 5b20814

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

tools/perf/Documentation/perf-script.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,10 @@ include::itrace.txt[]
499499
The known limitations include exception handing such as
500500
setjmp/longjmp will have calls/returns not match.
501501

502+
--guest-code::
503+
Indicate that guest code can be found in the hypervisor process,
504+
which is a common case for KVM test programs.
505+
502506
SEE ALSO
503507
--------
504508
linkperf:perf-record[1], linkperf:perf-script-perl[1],

tools/perf/builtin-script.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3912,6 +3912,8 @@ int cmd_script(int argc, const char **argv)
39123912
"file", "file saving guest os /proc/kallsyms"),
39133913
OPT_STRING(0, "guestmodules", &symbol_conf.default_guest_modules,
39143914
"file", "file saving guest os /proc/modules"),
3915+
OPT_BOOLEAN(0, "guest-code", &symbol_conf.guest_code,
3916+
"Guest code can be found in hypervisor process"),
39153917
OPT_BOOLEAN('\0', "stitch-lbr", &script.stitch_lbr,
39163918
"Enable LBR callgraph stitching approach"),
39173919
OPTS_EVSWITCH(&script.evswitch),
@@ -3937,7 +3939,8 @@ int cmd_script(int argc, const char **argv)
39373939
if (symbol_conf.guestmount ||
39383940
symbol_conf.default_guest_vmlinux_name ||
39393941
symbol_conf.default_guest_kallsyms ||
3940-
symbol_conf.default_guest_modules) {
3942+
symbol_conf.default_guest_modules ||
3943+
symbol_conf.guest_code) {
39413944
/*
39423945
* Enable guest sample processing.
39433946
*/

0 commit comments

Comments
 (0)