From 8f46ca6118f46efd4bdb3d2cad08e9e07e5b2dbd Mon Sep 17 00:00:00 2001
From: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
Date: Mon, 9 Jun 2014 13:02:28 -0700
Subject: [PATCH] lrdp-v2: rtb: Add parsing support for L2 indirect read/write
 and IRQ

Add parsing support for L2 indirect accesses and IRQ logging.

Change-Id: I029fbc43077813234a0c3d7436bc9b7d165c39d6
---
 linux-ramdump-parser-v2/parsers/rtb.py | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/linux-ramdump-parser-v2/parsers/rtb.py b/linux-ramdump-parser-v2/parsers/rtb.py
index e1b0794..620d76f 100644
--- a/linux-ramdump-parser-v2/parsers/rtb.py
+++ b/linux-ramdump-parser-v2/parsers/rtb.py
@@ -30,6 +30,9 @@ print_table = {
     'LOGK_HOTPLUG': 'print_hotplug',
     'LOGK_CTXID': 'print_ctxid',
     'LOGK_TIMESTAMP': 'print_timestamp',
+    'LOGK_L2CPREAD': 'print_cp_rw',
+    'LOGK_L2CPWRITE': 'print_cp_rw',
+    'LOGK_IRQ': 'print_irq',
 }
 
 
@@ -92,6 +95,22 @@ class RTB(RamParser):
         rtbout.write('{0} Timestamp: {1:x}{2:x}\n'.format(
             logtype, data, caller).encode('ascii', 'ignore'))
 
+    def print_cp_rw(self, rtbout, rtb_ptr, logtype):
+        data = self.ramdump.read_structure_field(rtb_ptr, 'struct msm_rtb_layout', 'data')
+        caller = self.ramdump.read_structure_field(rtb_ptr, 'struct msm_rtb_layout', 'caller')
+        func = self.get_fun_name(caller)
+        line = self.get_caller(caller)
+        rtbout.write('{0} from offset {1:x} called from addr {2:x} {3} {4}\n'.format(
+            logtype, data, caller, func, line).encode('ascii', 'ignore'))
+
+    def print_irq(self, rtbout, rtb_ptr, logtype):
+        data = self.ramdump.read_structure_field(rtb_ptr, 'struct msm_rtb_layout', 'data')
+        caller = self.ramdump.read_structure_field(rtb_ptr, 'struct msm_rtb_layout', 'caller')
+        func = self.get_fun_name(caller)
+        line = self.get_caller(caller)
+        rtbout.write('{0} interrupt {1:x} handled from addr {2:x} {3} {4}\n'.format(
+            logtype, data, caller, func, line).encode('ascii', 'ignore'))
+
     def parse(self):
         rtb = self.ramdump.addr_lookup('msm_rtb')
         if rtb is None:
-- 
GitLab