aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2024-01-17 16:43:04 -0500
committerTom Rini <trini@konsulko.com>2024-01-17 16:43:04 -0500
commitef18c94dfbb9940282355dd59d79d30c9642a42b (patch)
tree042c893df6f07c7b68cfc24de13ea1010fd53e40
parentbfcb320e32b644c7ad2b61958abd511ed549e71b (diff)
downloadu-boot-WIP/17Jan2024.zip
u-boot-WIP/17Jan2024.tar.gz
u-boot-WIP/17Jan2024.tar.bz2
test: test_trace.py: Handle newer trace-cmd report formatsWIP/17Jan2024
With newer versions of trace-cmd we have another column in the report that we need to handle. We don't care about it, so just use a regex to remove it from the output that we then parse. Signed-off-by: Tom Rini <trini@konsulko.com>
-rw-r--r--test/py/tests/test_trace.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/test/py/tests/test_trace.py b/test/py/tests/test_trace.py
index 28a6e72..9cb5aa9 100644
--- a/test/py/tests/test_trace.py
+++ b/test/py/tests/test_trace.py
@@ -117,12 +117,17 @@ def check_function(cons, fname, proftool, map_fname, trace_dat):
out = util.run_and_log(cons, ['sh', '-c', cmd])
# Format:
- # unknown option 14
# u-boot-1 [000] 60.805596: function: initf_malloc
# u-boot-1 [000] 60.805597: function: initf_malloc
# u-boot-1 [000] 60.805601: function: initf_bootstage
# u-boot-1 [000] 60.805607: function: initf_bootstage
- lines = [line.replace(':', '').split() for line in out.splitlines()]
+ # OR:
+ # u-boot-1 [000] ..... 60.805596: function: initf_malloc
+ # u-boot-1 [000] ..... 60.805597: function: initf_malloc
+ # u-boot-1 [000] ..... 60.805601: function: initf_bootstage
+ # u-boot-1 [000] ..... 60.805607: function: initf_bootstage
+
+ lines = [re.sub(r'(:|\.\.\.\.\.)', '', line).split() for line in out.splitlines()]
vals = {items[4]: float(items[2]) for items in lines if len(items) == 5}
base = None
max_delta = 0
@@ -176,6 +181,7 @@ def check_funcgraph(cons, fname, proftool, map_fname, trace_dat):
# u-boot-1 [000] 282.101375: funcgraph_exit: 0.006 us | }
# Then check for this:
# u-boot-1 [000] 282.101375: funcgraph_entry: 0.000 us | initcall_is_event();
+ # And this all may be '[000] ..... 282.' instead.
expected_indent = None
found_start = False
@@ -185,7 +191,7 @@ def check_funcgraph(cons, fname, proftool, map_fname, trace_dat):
# Look for initf_bootstage() entry and make sure we see the exit
# Collect the time for initf_dm()
for line in out.splitlines():
- m = RE_LINE.match(line)
+ m = RE_LINE.match(re.sub(r'\.\.\.\.\.', '', line))
if m:
timestamp, indent, func, brace = m.groups()
if found_end:
@@ -209,7 +215,7 @@ def check_funcgraph(cons, fname, proftool, map_fname, trace_dat):
start_timestamp = None
end_timestamp = None
for line in out.splitlines():
- m = RE_LINE.match(line)
+ m = RE_LINE.match(re.sub(r'\.\.\.\.\.', '', line))
if m:
timestamp, indent, func, brace = m.groups()
if func == 'initf_dm() ':