From bfdd0aed25cb7a45764ddfeda16492240dfffef8 Mon Sep 17 00:00:00 2001
From: Aparna Das <adas@codeaurora.org>
Date: Tue, 1 Jul 2014 18:10:04 -0700
Subject: [PATCH] linux-ramdump-parser-v2: dump only relevant registers for cpu
 ctxt

Current cpu context dump structure has variable number of reserved
elements for 32 and 64 bit dumps. Modify the parser to not dump the
entire cpu context structure but only relevant registers.

Change-Id: I615d2b7097ba35b1af2431caf70645cd6c4e5daa
---
 linux-ramdump-parser-v2/watchdog_v2.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/linux-ramdump-parser-v2/watchdog_v2.py b/linux-ramdump-parser-v2/watchdog_v2.py
index 1ef5e7d..65f67b3 100644
--- a/linux-ramdump-parser-v2/watchdog_v2.py
+++ b/linux-ramdump-parser-v2/watchdog_v2.py
@@ -10,6 +10,7 @@
 # GNU General Public License for more details.
 
 import struct
+import re
 from print_out import print_out_str
 
 # (name from tz dump, corresponding T32 register, whether or not to print_out_str (the function name))
@@ -149,7 +150,7 @@ sysdbg_cpu32_register_names = [
     ('cpsr', 'cpsr', False),
     ('r13_mon', 'r13_mon', False),
     ('r14_mon', 'r14_mon', True),
-    ('r14_hyp', 'r14_hyp', True),
+    ('r14_hyp', 'elr_hyp', True),
     ('_reserved', '_reserved', False),
     ('__reserved1', '__reserved1', False),
     ('__reserved2', '__reserved2', False),
@@ -226,6 +227,8 @@ class TZCpuCtx_v2():
         else:
             register_names = sysdbg_cpu32_register_names
         for reg_name, t32_name, print_pc in register_names:
+            if re.match('(.*)reserved(.*)', reg_name):
+                continue
             if print_pc:
                 a = ramdump.unwind_lookup(self.regs[reg_name])
                 if a is not None:
-- 
GitLab