aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/tests/code-reading.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/tests/code-reading.c')
-rw-r--r--tools/perf/tests/code-reading.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/perf/tests/code-reading.c b/tools/perf/tests/code-reading.c
index 94b7c7b02bde..fcc8984bc329 100644
--- a/tools/perf/tests/code-reading.c
+++ b/tools/perf/tests/code-reading.c
@@ -1,3 +1,4 @@
1// SPDX-License-Identifier: GPL-2.0
1#include <errno.h> 2#include <errno.h>
2#include <linux/kernel.h> 3#include <linux/kernel.h>
3#include <linux/types.h> 4#include <linux/types.h>
@@ -237,6 +238,11 @@ static int read_object_code(u64 addr, size_t len, u8 cpumode,
237 238
238 thread__find_addr_map(thread, cpumode, MAP__FUNCTION, addr, &al); 239 thread__find_addr_map(thread, cpumode, MAP__FUNCTION, addr, &al);
239 if (!al.map || !al.map->dso) { 240 if (!al.map || !al.map->dso) {
241 if (cpumode == PERF_RECORD_MISC_HYPERVISOR) {
242 pr_debug("Hypervisor address can not be resolved - skipping\n");
243 return 0;
244 }
245
240 pr_debug("thread__find_addr_map failed\n"); 246 pr_debug("thread__find_addr_map failed\n");
241 return -1; 247 return -1;
242 } 248 }
@@ -673,7 +679,7 @@ out_err:
673 return err; 679 return err;
674} 680}
675 681
676int test__code_reading(int subtest __maybe_unused) 682int test__code_reading(struct test *test __maybe_unused, int subtest __maybe_unused)
677{ 683{
678 int ret; 684 int ret;
679 685