aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-08-21 21:16:48 -0600
committerTom Rini <trini@konsulko.com>2023-08-31 13:16:54 -0400
commitba5e3e1ed0afb3daa446d2168e5c8c9fe119cbaf (patch)
treed265d9442db79b365039fc727d5d0cbe987fbd58 /scripts
parentb81a024e4a37097d3dcffccb225850f8f6dc8277 (diff)
downloadu-boot-ba5e3e1ed0afb3daa446d2168e5c8c9fe119cbaf.zip
u-boot-ba5e3e1ed0afb3daa446d2168e5c8c9fe119cbaf.tar.gz
u-boot-ba5e3e1ed0afb3daa446d2168e5c8c9fe119cbaf.tar.bz2
event: Support a simple spy record
The current event spy is always passed the event context and the event. The context is always NULL for a static spy. The event is not often used. Introduce a 'simple' spy which takes no arguments. This allows us to drop the adaptation code that many of these spy records use. Update the event script to find these in the image. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/event_dump.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/scripts/event_dump.py b/scripts/event_dump.py
index 0117457..24dfe2b 100755
--- a/scripts/event_dump.py
+++ b/scripts/event_dump.py
@@ -19,8 +19,10 @@ from u_boot_pylib import tools
# A typical symbol looks like this:
# _u_boot_list_2_evspy_info_2_EVT_MISC_INIT_F_3_sandbox_misc_init_f
-PREFIX = '_u_boot_list_2_evspy_info_2_'
-RE_EVTYPE = re.compile('%s(.*)_3_.*' % PREFIX)
+PREFIX_FULL = '_u_boot_list_2_evspy_info_2_'
+PREFIX_SIMPLE = '_u_boot_list_2_evspy_info_simple_2_'
+RE_EVTYPE_FULL = re.compile('%s(.*)_3_.*' % PREFIX_FULL)
+RE_EVTYPE_SIMPLE = re.compile('%s(.*)_3_.*' % PREFIX_SIMPLE)
def show_sym(fname, data, endian, evtype, sym):
"""Show information about an evspy entry
@@ -88,12 +90,14 @@ def show_event_spy_list(fname, endian):
fname (str): Filename of ELF file
endian (str): Endianness to use ('little', 'big', 'auto')
"""
- syms = elf.GetSymbolFileOffset(fname, [PREFIX])
+ syms = elf.GetSymbolFileOffset(fname, [PREFIX_FULL, PREFIX_SIMPLE])
data = tools.read_file(fname)
print('%-20s %-30s %s' % ('Event type', 'Id', 'Source location'))
print('%-20s %-30s %s' % ('-' * 20, '-' * 30, '-' * 30))
for name, sym in syms.items():
- m_evtype = RE_EVTYPE.search(name)
+ m_evtype = RE_EVTYPE_FULL.search(name)
+ if not m_evtype:
+ m_evtype = RE_EVTYPE_SIMPLE.search(name)
evtype = m_evtype .group(1)
show_sym(fname, data, endian, evtype, sym)