Skip to content
Snippets Groups Projects
Commit cfb61009 authored by Gopi Krishna Nedanuri's avatar Gopi Krishna Nedanuri
Browse files

lrdp_v2: Print NS Watchdog related info

   Add parser to print NS Watchdog related info

Change-Id: Ic721758993f046b3c6d0ebb0c18309ebbe9ca9b1
parent 1c5f89ee
No related branches found
No related tags found
No related merge requests found
# Copyright (c) 2012-2015, The Linux Foundation. All rights reserved.
# Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 and
......@@ -13,6 +13,7 @@ import struct
import re
from print_out import print_out_str
from bitops import is_set
from parser_util import register_parser, RamParser
# name from tz dump, corresponding T32 register, whether or not to
# print_out_str (the function name)
......@@ -820,3 +821,48 @@ class TZRegDump_v2():
self.sec_regs = TZCpuCtx_v2(self.version, sc_secure,
self.neon_regs, ram_dump)
return True
@register_parser('--watchdog', 'Extracts NS Watchdog related info')
class Watchdog(RamParser):
def parse(self):
get_wdog_timing(self.ramdump)
def get_wdog_timing(ramdump):
jiffies = ramdump.read_word('jiffies')
last_jiffies_update = ramdump.read_word('last_jiffies_update')
tick_do_timer_cpu = ramdump.read_word('tick_do_timer_cpu')
wdog_data_addr = ramdump.read_word('wdog_data')
pet_timer_off = ramdump.field_offset(
'struct msm_watchdog_data', 'pet_timer')
timer_expires_off = ramdump.field_offset('struct timer_list', 'expires')
pet_timer_expires = ramdump.read_word(
wdog_data_addr + pet_timer_off + timer_expires_off)
last_pet_off = ramdump.field_offset('struct msm_watchdog_data', 'last_pet')
wdog_last_pet = ramdump.read_word(wdog_data_addr + last_pet_off)
timer_expired_off = ramdump.field_offset(
'struct msm_watchdog_data', 'timer_expired')
pet_timer_expired = ramdump.read_word(wdog_data_addr + timer_expired_off)
pet_time_off = ramdump.field_offset('struct msm_watchdog_data', 'pet_time')
bark_time_off = ramdump.field_offset(
'struct msm_watchdog_data', 'bark_time')
pet_time = ramdump.read_int(wdog_data_addr + pet_time_off)
bark_time = ramdump.read_int(wdog_data_addr + bark_time_off)
print_out_str('Non-secure Watchdog data')
print_out_str('Pet time: {0}s'.format(pet_time/1000.0))
print_out_str('Bark time: {0}s'.format(bark_time/1000.0))
print_out_str('Watchdog last pet: {0}'.format(wdog_last_pet/1000000000.0))
if pet_timer_expired == 1:
print_out_str('Watchdog pet timer expired')
else:
print_out_str('Watchdog pet timer not expired')
if jiffies > pet_timer_expires:
print_out_str('Current jiffies crossed pet_timer expires jiffies')
print_out_str('pet_timer_expires: {0}'.format(pet_timer_expires))
print_out_str('Current jiffies : {0}'.format(jiffies))
print_out_str(
'Timestamp of last timer interrupt(last_jiffies_update): {0}'.format(
last_jiffies_update/1000000000.0))
print_out_str('Core which updates jiffies(tick_do_timer_cpu): {0}'.format(
tick_do_timer_cpu))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment