[PATCH 4/5] tools/bootconfig: Resolve histogram dependencies until no progress is made

From: Eduardo Mucelli Rezende Oliveira

Date: Sat Oct 31 2026 - 14:36:37 EST


The exporter retries unresolved events only three times. A valid chain
of eight histogram dependencies in reverse traversal order therefore
exports only four histograms and reports the others as undefined, even
though all their providers are present.

Retry while the unresolved event list changes. Stop when all events have
been exported or a pass makes no progress, preserving the diagnostic for
missing variables and dependency cycles.

Fixes: 2b86062a34a8 ("tools/bootconfig: Add a script to generates bootconfig from ftrace")
Signed-off-by: Eduardo Mucelli Rezende Oliveira <edumucelli@xxxxxxxxx>
---
I installed a valid chain of eight dependent histograms in a temporary
tracefs instance on my Ubuntu machine, running kernel 7.0.0-38-generic,
with recording disabled.

The original exporter emitted only four histograms, so replay restored
half the configuration. With the fix, all eight were exported in provider
order and restored correctly. Fixture checks cover shorter and longer
chains, missing variables and cycles that must stop without looping.

tools/bootconfig/scripts/ftrace2bconf.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/bootconfig/scripts/ftrace2bconf.sh b/tools/bootconfig/scripts/ftrace2bconf.sh
index 8ba1a698611e..b3c976bc98c8 100755
--- a/tools/bootconfig/scripts/ftrace2bconf.sh
+++ b/tools/bootconfig/scripts/ftrace2bconf.sh
@@ -203,10 +203,10 @@ event_options() {
per_event_options $INSTANCE/events/$group/$event
done
done
- retry=0
- while [ $retry -lt 3 ]; do
+ while [ "$UNRESOLVED_EVENTS" ]; do
+ prev_unresolved=$UNRESOLVED_EVENTS
retry_unresolved
- retry=$((retry + 1))
+ [ "$prev_unresolved" = "$UNRESOLVED_EVENTS" ] && break
done
if [ "$UNRESOLVED_EVENTS" ]; then
cat 1>&2 << EOF
--
2.53.0