diff options
| author | Jiri Kosina <jkosina@suse.com> | 2024-03-13 21:17:33 +0100 | 
|---|---|---|
| committer | Jiri Kosina <jkosina@suse.com> | 2024-03-13 21:17:33 +0100 | 
| commit | 2e21dee6a46a66e4c2ced778485e1044101edee4 (patch) | |
| tree | b9a9565cf9e3954ad316c343715b43b401c51074 /tools/perf/scripts/python/arm-cs-trace-disasm.py | |
| parent | 9a5b1521e2d0d7ace70c6e5eed073babcec91409 (diff) | |
| parent | 90184f90c9ac559062a04aca72e5d05730164de0 (diff) | |
Merge branch 'for-6.9/amd-sfh' into for-linus
- assorted fixes and optimizations for amd-sfh (Basavaraj Natikar)
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Diffstat (limited to 'tools/perf/scripts/python/arm-cs-trace-disasm.py')
| -rwxr-xr-x | tools/perf/scripts/python/arm-cs-trace-disasm.py | 30 | 
1 files changed, 16 insertions, 14 deletions
| diff --git a/tools/perf/scripts/python/arm-cs-trace-disasm.py b/tools/perf/scripts/python/arm-cs-trace-disasm.py index d59ff53f1d94..d973c2baed1c 100755 --- a/tools/perf/scripts/python/arm-cs-trace-disasm.py +++ b/tools/perf/scripts/python/arm-cs-trace-disasm.py @@ -45,8 +45,8 @@ parser = OptionParser(option_list=option_list)  # Initialize global dicts and regular expression  disasm_cache = dict()  cpu_data = dict() -disasm_re = re.compile("^\s*([0-9a-fA-F]+):") -disasm_func_re = re.compile("^\s*([0-9a-fA-F]+)\s.*:") +disasm_re = re.compile(r"^\s*([0-9a-fA-F]+):") +disasm_func_re = re.compile(r"^\s*([0-9a-fA-F]+)\s.*:")  cache_size = 64*1024  glb_source_file_name	= None @@ -188,6 +188,17 @@ def process_event(param_dict):  	dso_end = get_optional(param_dict, "dso_map_end")  	symbol = get_optional(param_dict, "symbol") +	cpu = sample["cpu"] +	ip = sample["ip"] +	addr = sample["addr"] + +	# Initialize CPU data if it's empty, and directly return back +	# if this is the first tracing event for this CPU. +	if (cpu_data.get(str(cpu) + 'addr') == None): +		cpu_data[str(cpu) + 'addr'] = addr +		return + +  	if (options.verbose == True):  		print("Event type: %s" % name)  		print_sample(sample) @@ -209,16 +220,6 @@ def process_event(param_dict):  	if (name[0:8] != "branches"):  		return -	cpu = sample["cpu"] -	ip = sample["ip"] -	addr = sample["addr"] - -	# Initialize CPU data if it's empty, and directly return back -	# if this is the first tracing event for this CPU. -	if (cpu_data.get(str(cpu) + 'addr') == None): -		cpu_data[str(cpu) + 'addr'] = addr -		return -  	# The format for packet is:  	#  	#		  +------------+------------+------------+ @@ -258,8 +259,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) | 
