perf script: Add guest_code support
authorAdrian Hunter <adrian.hunter@intel.com>
Tue, 17 May 2022 13:10:09 +0000 (16:10 +0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 23 May 2022 13:19:04 +0000 (10:19 -0300)
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>
tools/perf/Documentation/perf-script.txt
tools/perf/builtin-script.c

index 2012a8e..1a557ff 100644 (file)
@@ -499,6 +499,10 @@ 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.
+
 SEE ALSO
 --------
 linkperf:perf-record[1], linkperf:perf-script-perl[1],
index ae6d216..c689054 100644 (file)
@@ -3912,6 +3912,8 @@ int cmd_script(int argc, const char **argv)
                   "file", "file saving guest os /proc/kallsyms"),
        OPT_STRING(0, "guestmodules", &symbol_conf.default_guest_modules,
                   "file", "file saving guest os /proc/modules"),
+       OPT_BOOLEAN(0, "guest-code", &symbol_conf.guest_code,
+                   "Guest code can be found in hypervisor process"),
        OPT_BOOLEAN('\0', "stitch-lbr", &script.stitch_lbr,
                    "Enable LBR callgraph stitching approach"),
        OPTS_EVSWITCH(&script.evswitch),
@@ -3937,7 +3939,8 @@ int cmd_script(int argc, const char **argv)
        if (symbol_conf.guestmount ||
            symbol_conf.default_guest_vmlinux_name ||
            symbol_conf.default_guest_kallsyms ||
-           symbol_conf.default_guest_modules) {
+           symbol_conf.default_guest_modules ||
+           symbol_conf.guest_code) {
                /*
                 * Enable guest sample processing.
                 */