[Concept,05/27] test: trace: Fix funcgraph check for matching exit indent

Message ID 20260119204130.3972647-6-sjg@u-boot.org
State New
Headers
Series Expo debugging and textedit improvements (part E) |

Commit Message

Simon Glass Jan. 19, 2026, 8:40 p.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

The check_funcgraph() function looks for initf_bootstage() entry and its
matching exit brace. Fix two issues:

1. The expected_indent should match the entry indent, not child level
   (indent + 2 spaces). Entry and exit braces are at the same level.

2. Increase head limit from 70 to 100 lines. With the log_file driver
   enabled, there are more traced function calls and the exit brace
   may appear beyond line 70.

Fixes: 6acf4a242f27 ("proftool: Fix funcgraph depth for exit records")
Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

 test/py/tests/test_trace.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Patch

diff --git a/test/py/tests/test_trace.py b/test/py/tests/test_trace.py
index 0bddf408833..498949372aa 100644
--- a/test/py/tests/test_trace.py
+++ b/test/py/tests/test_trace.py
@@ -189,7 +189,7 @@  def check_funcgraph(ubman, fname, proftool, map_fname, trace_dat):
                'dump-ftrace', '-f', 'funcgraph'])
 
     # Check that the trace has what we expect
-    cmd = f'trace-cmd report -l {trace_dat} |head -n 70'
+    cmd = f'trace-cmd report -l {trace_dat} |head -n 100'
     out = utils.run_and_log(ubman, ['sh', '-c', cmd])
 
     # First look for this:
@@ -221,7 +221,7 @@  def check_funcgraph(ubman, fname, proftool, map_fname, trace_dat):
                 break
             elif func == 'initf_bootstage() ':
                 found_start = True
-                expected_indent = indent + '  '
+                expected_indent = indent
             elif found_start and indent == expected_indent and brace == '}':
                 found_end = True