linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf scripts python arm-cs-trace-disasm.py: Skip disasm if address continuity is broken
@ 2024-07-19  9:26 Ganapatrao Kulkarni
  2024-07-19 14:39 ` James Clark
  0 siblings, 1 reply; 45+ messages in thread
From: Ganapatrao Kulkarni @ 2024-07-19  9:26 UTC (permalink / raw)
  To: james.clark, mike.leach, suzuki.poulose
  Cc: acme, coresight, linux-arm-kernel, linux-kernel, darren,
	scclevenger, gankulkarni

To generate the instruction tracing, script uses 2 contiguous packets
address range. If there a continuity brake due to discontiguous branch
address, it is required to reset the tracing and start tracing with the
new set of contiguous packets.

Adding change to identify the break and complete the remaining tracing
of current packets and restart tracing from new set of packets, if
continuity is established.

Signed-off-by: Ganapatrao Kulkarni <gankulkarni@os.amperecomputing.com>
---
 tools/perf/scripts/python/arm-cs-trace-disasm.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tools/perf/scripts/python/arm-cs-trace-disasm.py b/tools/perf/scripts/python/arm-cs-trace-disasm.py
index d973c2baed1c..ad10cee2c35e 100755
--- a/tools/perf/scripts/python/arm-cs-trace-disasm.py
+++ b/tools/perf/scripts/python/arm-cs-trace-disasm.py
@@ -198,6 +198,10 @@ def process_event(param_dict):
 		cpu_data[str(cpu) + 'addr'] = addr
 		return
 
+	if (cpu_data.get(str(cpu) + 'ip') == None):
+		cpu_data[str(cpu) + 'ip'] = ip
+
+	prev_ip = cpu_data[str(cpu) + 'ip']
 
 	if (options.verbose == True):
 		print("Event type: %s" % name)
@@ -243,12 +247,18 @@ def process_event(param_dict):
 
 	# Record for previous sample packet
 	cpu_data[str(cpu) + 'addr'] = addr
+	cpu_data[str(cpu) + 'ip'] = stop_addr
 
 	# Handle CS_ETM_TRACE_ON packet if start_addr=0 and stop_addr=4
 	if (start_addr == 0 and stop_addr == 4):
 		print("CPU%d: CS_ETM_TRACE_ON packet is inserted" % cpu)
 		return
 
+	if (stop_addr < start_addr):
+		# Continuity of the Packets broken, set start_addr to previous
+		# packet ip to complete the remaining tracing of the address range.
+		start_addr = prev_ip
+
 	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))
 		return
-- 
2.45.2



^ permalink raw reply related	[flat|nested] 45+ messages in thread

end of thread, other threads:[~2024-09-02  6:14 UTC | newest]

Thread overview: 45+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-19  9:26 [PATCH] perf scripts python arm-cs-trace-disasm.py: Skip disasm if address continuity is broken Ganapatrao Kulkarni
2024-07-19 14:39 ` James Clark
2024-07-22 10:02   ` Ganapatrao Kulkarni
2024-07-23 13:10     ` James Clark
2024-07-23 15:26       ` Ganapatrao Kulkarni
2024-07-23 15:46         ` James Clark
2024-07-24  6:38           ` Ganapatrao Kulkarni
2024-07-24 14:45             ` James Clark
2024-08-01 10:00               ` James Clark
2024-08-01 10:28                 ` Al Grant
2024-08-01 11:26                   ` James Clark
2024-08-01 11:58                     ` Al Grant
2024-08-01 14:58                       ` James Clark
2024-08-05 12:22                 ` Ganapatrao Kulkarni
2024-08-05 13:59                   ` James Clark
2024-08-06  7:02                     ` Ganapatrao Kulkarni
2024-08-06  9:47                       ` James Clark
2024-08-06  9:57                         ` James Clark
2024-08-06 15:02                           ` Steve Clevenger
2024-08-06 16:14                             ` James Clark
2024-08-07 12:17                               ` Ganapatrao Kulkarni
2024-08-07 14:53                                 ` James Clark
2024-08-07 16:18                                   ` Ganapatrao Kulkarni
2024-08-07 19:20                                     ` Leo Yan
2024-08-08  4:36                                       ` Ganapatrao Kulkarni
2024-08-08  7:42                                         ` Leo Yan
2024-08-08  9:21                                           ` James Clark
2024-08-08 10:51                                             ` James Clark
2024-08-08 11:14                                               ` Ganapatrao Kulkarni
2024-08-08 15:01                                                 ` Mike Leach
2024-08-07 16:48                                   ` Leo Yan
2024-08-08  9:32                                     ` James Clark
2024-08-08 11:05                                       ` Leo Yan
2024-08-09 14:13                                       ` Mike Leach
2024-08-09 15:19                                         ` James Clark
2024-08-19 10:59                                           ` Mike Leach
2024-08-23  9:03                                             ` James Clark
2024-08-23  9:57                                               ` Ganapatrao Kulkarni
2024-08-23 10:36                                                 ` James Clark
2024-08-23 10:37                                                   ` James Clark
2024-08-30  9:58                                                 ` James Clark
2024-09-02  6:12                                                   ` Ganapatrao Kulkarni
2024-08-28  9:33                                               ` Mike Leach
2024-08-29 13:35                                                 ` James Clark
2024-08-08  7:54                               ` Leo Yan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).