[lkml]   [2017]   [Aug]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH v2] perf test powerpc: Fix 'Object code reading' test
'Object code reading' test always fails on powerpc guest. Two reasons
for the failure are:

1. When elf section is too big (size beyond 'unsigned int' max value).
objdump fails to disassemble from such section. This was fixed with
commit 0f6329bd7fc ("binutils/objdump: Fix disassemble for huge elf
sections") in binutils.

2. When the sample is from hypervisor. Hypervisor symbols can not
be resolved within guest and thus thread__find_addr_map() fails for
such symbols. Fix this by ignoring hypervisor symbols in the test.

Signed-off-by: Ravi Bangoria <>
Changes in v2:
- Add pr_debug()

tools/perf/tests/code-reading.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/tools/perf/tests/code-reading.c b/tools/perf/tests/code-reading.c
index 761c5a4..466a462 100644
--- a/tools/perf/tests/code-reading.c
+++ b/tools/perf/tests/code-reading.c
@@ -237,6 +237,11 @@ static int read_object_code(u64 addr, size_t len, u8 cpumode,

thread__find_addr_map(thread, cpumode, MAP__FUNCTION, addr, &al);
if (! || !>dso) {
+ pr_debug("Hypervisor address can not be resolved - skipping\n");
+ return 0;
+ }
pr_debug("thread__find_addr_map failed\n");
return -1;
 \ /
  Last update: 2017-08-31 11:15    [W:0.027 / U:3.620 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site