A bootconfig containing ftrace.event.enable makes bconf2ftrace.sh try to
write to events/enable/enable. The per-event loop treats the global
enable key as an event named "enable" in a group with the same name.

Since events/enable is a file, this write fails. With --apply, the script
exits before it reaches the code that enables all events. The same thing
happens with ftrace.instance.NAME.event.enable.

Skip the global enable key in the per-event loop and let the existing
global handler write to events/enable.

Fixes: 1d8365a553a7 ("tools/bootconfig: Support per-group/all event enabling 
option")
Signed-off-by: Eduardo Mucelli Rezende Oliveira <[email protected]>
---
This is my second submission to the Linux kernel. Feedback is welcome.

Tested with --apply in a temporary tracefs instance on my Ubuntu machine,
running kernel 7.0.0-38-generic, with recording disabled. The original
script exits with status 2 and leaves events disabled. With the fix, it
exits successfully and the instance's events/enable reads 1. Per-group
enabling works with both versions.

 tools/bootconfig/scripts/bconf2ftrace.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/bootconfig/scripts/bconf2ftrace.sh 
b/tools/bootconfig/scripts/bconf2ftrace.sh
index 850c207343..7745c97e7a 100755
--- a/tools/bootconfig/scripts/bconf2ftrace.sh
+++ b/tools/bootconfig/scripts/bconf2ftrace.sh
@@ -218,6 +218,7 @@ setup_events() { # prefix("ftrace" or 
"ftrace.instance.INSTANCE") [instance]
        prefix="${1}.event"
        if xbc_has_branch ${1}.event; then
                for grpev in `xbc_subkeys ${1}.event 2`; do
+                       [ "$grpev" = "enable" ] && continue
                        setup_event $prefix ${grpev%.*} ${grpev#*.} $2
                done
        fi

base-commit: a804c5742bff224d4cb4d25dd383554d598be32b
-- 
2.53.0


Reply via email to