mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eduardo Mucelli Rezende Oliveira <edumucelli@gmail.com>
To: mhiramat@kernel.org
Cc: rostedt@goodmis.org, linux-trace-kernel@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 4/5] tools/bootconfig: Resolve histogram dependencies until no progress is made
Date: Sat, 31 Oct 2026 19:35:33 +0100	[thread overview]
Message-ID: <cc5b165d95ad5f2083453644f70f8b194874598b.1793471731.git.edumucelli@gmail.com> (raw)
In-Reply-To: <cover.1793471731.git.edumucelli@gmail.com>

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@gmail.com>
---
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


  parent reply	other threads:[~2026-10-31 18:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-31 18:35 [PATCH 0/5] tools/bootconfig: Fix tracing script filters and histogram dependencies Eduardo Mucelli Rezende Oliveira
2026-10-31 18:35 ` [PATCH 1/5] tools/bootconfig: Read the documented ftrace.notraces key Eduardo Mucelli Rezende Oliveira
2026-10-31 18:35 ` [PATCH 2/5] tools/bootconfig: Preserve quotes in exported event actions Eduardo Mucelli Rezende Oliveira
2026-10-31 18:35 ` [PATCH 3/5] tools/bootconfig: Ignore filter strings when resolving histogram variables Eduardo Mucelli Rezende Oliveira
2026-10-31 18:35 ` Eduardo Mucelli Rezende Oliveira [this message]
2026-10-31 18:35 ` [PATCH 5/5] tools/bootconfig: Match literal keys in tracing script helpers Eduardo Mucelli Rezende Oliveira

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cc5b165d95ad5f2083453644f70f8b194874598b.1793471731.git.edumucelli@gmail.com \
    --to=edumucelli@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®