Skip to content

Commit

Permalink
perf scripts python arm-cs-trace-disasm.py: Set start vm addr of exec…
Browse files Browse the repository at this point in the history
…table file to 0

For exectable ELF file, which e_type is ET_EXEC, dso start address is a
absolute address other than offset. Just set vm_start to zero when dso
start is 0x400000, which means it is a exectable file.

Reviewed-by: James Clark <james.clark@arm.com>
Signed-off-by: Ruidong Tian <tianruidong@linux.alibaba.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Al Grant <al.grant@arm.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
Cc: Tor Jeremiassen <tor@ti.com>
Link: https://lore.kernel.org/r/20231214123304.34087-3-tianruidong@linux.alibaba.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
Ruidong Tian authored and Arnaldo Carvalho de Melo committed Dec 20, 2023
1 parent e43c64c commit c344675
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tools/perf/scripts/python/arm-cs-trace-disasm.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,9 @@ def process_event(param_dict):

if (options.objdump_name != None):
# It doesn't need to decrease virtual memory offset for disassembly
# for kernel dso, so in this case we set vm_start to zero.
if (dso == "[kernel.kallsyms]"):
# for kernel dso and executable file dso, so in this case we set
# vm_start to zero.
if (dso == "[kernel.kallsyms]" or dso_start == 0x400000):
dso_vm_start = 0
else:
dso_vm_start = int(dso_start)
Expand Down

0 comments on commit c344675

Please sign in to comment.