Skip to content

Commit cfd7998

Browse files
mhiramatrostedt
authored andcommitted
tracing/boot: Fix to loop on only subkeys
Since the commit e5efaeb ("bootconfig: Support mixing a value and subkeys under a key") allows to co-exist a value node and key nodes under a node, xbc_node_for_each_child() is not only returning key node but also a value node. In the boot-time tracing using xbc_node_for_each_child() to iterate the events, groups and instances, but those must be key nodes. Thus it must use xbc_node_for_each_subkey(). Link: https://lkml.kernel.org/r/163112988361.74896.2267026262061819145.stgit@devnote2 Fixes: e5efaeb ("bootconfig: Support mixing a value and subkeys under a key") Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
1 parent 04178ea commit cfd7998

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

kernel/trace/trace_boot.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -522,14 +522,14 @@ trace_boot_init_events(struct trace_array *tr, struct xbc_node *node)
522522
if (!node)
523523
return;
524524
/* per-event key starts with "event.GROUP.EVENT" */
525-
xbc_node_for_each_child(node, gnode) {
525+
xbc_node_for_each_subkey(node, gnode) {
526526
data = xbc_node_get_data(gnode);
527527
if (!strcmp(data, "enable")) {
528528
enable_all = true;
529529
continue;
530530
}
531531
enable = false;
532-
xbc_node_for_each_child(gnode, enode) {
532+
xbc_node_for_each_subkey(gnode, enode) {
533533
data = xbc_node_get_data(enode);
534534
if (!strcmp(data, "enable")) {
535535
enable = true;
@@ -625,7 +625,7 @@ trace_boot_init_instances(struct xbc_node *node)
625625
if (!node)
626626
return;
627627

628-
xbc_node_for_each_child(node, inode) {
628+
xbc_node_for_each_subkey(node, inode) {
629629
p = xbc_node_get_data(inode);
630630
if (!p || *p == '\0')
631631
continue;

0 commit comments

Comments
 (0)