summaryrefslogtreecommitdiffstats
path: root/tools/perf/tests/code-reading.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 17:39:57 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 17:39:57 +0000
commitdc50eab76b709d68175a358d6e23a5a3890764d3 (patch)
treec754d0390db060af0213ff994f0ac310e4cfd6e9 /tools/perf/tests/code-reading.c
parentAdding debian version 6.6.15-2. (diff)
downloadlinux-dc50eab76b709d68175a358d6e23a5a3890764d3.tar.xz
linux-dc50eab76b709d68175a358d6e23a5a3890764d3.zip
Merging upstream version 6.7.7.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tools/perf/tests/code-reading.c')
-rw-r--r--tools/perf/tests/code-reading.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/perf/tests/code-reading.c b/tools/perf/tests/code-reading.c
index ed3815163d..3af8101201 100644
--- a/tools/perf/tests/code-reading.c
+++ b/tools/perf/tests/code-reading.c
@@ -269,6 +269,16 @@ static int read_object_code(u64 addr, size_t len, u8 cpumode,
if (addr + len > map__end(al.map))
len = map__end(al.map) - addr;
+ /*
+ * Some architectures (ex: powerpc) have stubs (trampolines) in kernel
+ * modules to manage long jumps. Check if the ip offset falls in stubs
+ * sections for kernel modules. And skip module address after text end
+ */
+ if (dso->is_kmod && al.addr > dso->text_end) {
+ pr_debug("skipping the module address %#"PRIx64" after text end\n", al.addr);
+ goto out;
+ }
+
/* Read the object code using perf */
ret_len = dso__data_read_offset(dso, maps__machine(thread__maps(thread)),
al.addr, buf1, len);