[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <b30454af62f9a06080c77c1bd0c7dd20782bfebd.1724104248.git.scclevenger@os.amperecomputing.com>
Date: Tue, 20 Aug 2024 16:11:31 -0600
From: Steve Clevenger <scclevenger@...amperecomputing.com>
To: james.clark@....com,
mike.leach@...aro.org
Cc: suzuki.poulose@....com,
leo.yan@...aro.org,
ilkka@...ampercomputing.com,
coresight@...ts.linaro.org,
linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org,
"steve.c.clevenger.ampere" <scclevenger@...amperecomputing.com>
Subject: [PATCH 5/5] Adjust objdump start/end range per map pgoff parameter
From: "steve.c.clevenger.ampere" <scclevenger@...amperecomputing.com>
Extract map_pgoff parameter from the dictionary, and adjust start/end
range passed to objdump based on the value.
The start_addr/stop_addr address checks are changed to print a warning
only if verbose == True. This script repeatedly sees a zero value passed
in for
start_addr = cpu_data[str(cpu) + 'addr']
These zero values are not a new problem. The start_addr/stop_addr warning
clutters the instruction trace output, hence this change.
Signed-off-by: steve.c.clevenger.ampere <scclevenger@...amperecomputing.com>
---
.../perf/scripts/python/arm-cs-trace-disasm.py | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/tools/perf/scripts/python/arm-cs-trace-disasm.py b/tools/perf/scripts/python/arm-cs-trace-disasm.py
index d973c2baed1c..6bf806078f9a 100755
--- a/tools/perf/scripts/python/arm-cs-trace-disasm.py
+++ b/tools/perf/scripts/python/arm-cs-trace-disasm.py
@@ -187,6 +187,7 @@ def process_event(param_dict):
dso_start = get_optional(param_dict, "dso_map_start")
dso_end = get_optional(param_dict, "dso_map_end")
symbol = get_optional(param_dict, "symbol")
+ map_pgoff = get_optional(param_dict, "map_pgoff")
cpu = sample["cpu"]
ip = sample["ip"]
@@ -250,13 +251,25 @@ def process_event(param_dict):
return
if (start_addr < int(dso_start) or start_addr > int(dso_end)):
- print("Start address 0x%x is out of range [ 0x%x .. 0x%x ] for dso %s" % (start_addr, int(dso_start), int(dso_end), dso))
+ if (options.verbose == True):
+ print("Start address 0x%x is out of range [ 0x%x .. 0x%x ] for dso %s" % (start_addr, int(dso_start), int(dso_end), dso))
return
if (stop_addr < int(dso_start) or stop_addr > int(dso_end)):
- print("Stop address 0x%x is out of range [ 0x%x .. 0x%x ] for dso %s" % (stop_addr, int(dso_start), int(dso_end), dso))
+ if (options.verbose == True):
+ print("Stop address 0x%x is out of range [ 0x%x .. 0x%x ] for dso %s" % (stop_addr, int(dso_start), int(dso_end), dso))
return
+ if map_pgoff != None and map_pgoff != '[unknown]':
+ if (dso == "[kernel.kallsyms]"):
+ dso_vm_start = 0
+ map_pgoff = '[unknown]'
+ else:
+ dso_vm_start = int(dso_start)
+ start_addr += map_pgoff
+ stop_addr += map_pgoff
+ map_pgoff = '[unknown]'
+
if (options.objdump_name != None):
# It doesn't need to decrease virtual memory offset for disassembly
# for kernel dso and executable file dso, so in this case we set
--
2.25.1
Powered by blists - more mailing lists