Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'trace-v5.15-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace

Pull tracing fixes from Steven Rostedt:
"Minor fixes to the processing of the bootconfig tree"

* tag 'trace-v5.15-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
bootconfig: Rename xbc_node_find_child() to xbc_node_find_subkey()
tracing/boot: Fix to check the histogram control param is a leaf node
tracing/boot: Fix trace_boot_hist_add_array() to check array is value

+24 -25
+2 -2
include/linux/bootconfig.h
··· 110 110 } 111 111 112 112 /* Tree-based key-value access APIs */ 113 - struct xbc_node * __init xbc_node_find_child(struct xbc_node *parent, 113 + struct xbc_node * __init xbc_node_find_subkey(struct xbc_node *parent, 114 114 const char *key); 115 115 116 116 const char * __init xbc_node_find_value(struct xbc_node *parent, ··· 148 148 */ 149 149 static inline struct xbc_node * __init xbc_find_node(const char *key) 150 150 { 151 - return xbc_node_find_child(NULL, key); 151 + return xbc_node_find_subkey(NULL, key); 152 152 } 153 153 154 154 /**
+18 -19
kernel/trace/trace_boot.c
··· 219 219 trace_boot_hist_add_array(struct xbc_node *hnode, char **bufp, 220 220 char *end, const char *key) 221 221 { 222 - struct xbc_node *knode, *anode; 222 + struct xbc_node *anode; 223 223 const char *p; 224 224 char sep; 225 225 226 - knode = xbc_node_find_child(hnode, key); 227 - if (knode) { 228 - anode = xbc_node_get_child(knode); 226 + p = xbc_node_find_value(hnode, key, &anode); 227 + if (p) { 229 228 if (!anode) { 230 229 pr_err("hist.%s requires value(s).\n", key); 231 230 return -EINVAL; ··· 262 263 append_printf(bufp, end, ":%s(%s)", handler, p); 263 264 264 265 /* Compose 'action' parameter */ 265 - knode = xbc_node_find_child(hnode, "trace"); 266 + knode = xbc_node_find_subkey(hnode, "trace"); 266 267 if (!knode) 267 - knode = xbc_node_find_child(hnode, "save"); 268 + knode = xbc_node_find_subkey(hnode, "save"); 268 269 269 270 if (knode) { 270 271 anode = xbc_node_get_child(knode); ··· 283 284 sep = ','; 284 285 } 285 286 append_printf(bufp, end, ")"); 286 - } else if (xbc_node_find_child(hnode, "snapshot")) { 287 + } else if (xbc_node_find_subkey(hnode, "snapshot")) { 287 288 append_printf(bufp, end, ".snapshot()"); 288 289 } else { 289 290 pr_err("hist.%s requires an action.\n", ··· 314 315 break; 315 316 } 316 317 317 - if (xbc_node_find_child(hnode, param)) 318 + if (xbc_node_find_subkey(hnode, param)) 318 319 ret = trace_boot_hist_add_one_handler(hnode, bufp, end, handler, param); 319 320 320 321 return ret; ··· 374 375 if (p) 375 376 append_printf(&buf, end, ":name=%s", p); 376 377 377 - node = xbc_node_find_child(hnode, "var"); 378 + node = xbc_node_find_subkey(hnode, "var"); 378 379 if (node) { 379 380 xbc_node_for_each_key_value(node, knode, p) { 380 381 /* Expression must not include spaces. */ ··· 385 386 } 386 387 387 388 /* Histogram control attributes (mutual exclusive) */ 388 - if (xbc_node_find_child(hnode, "pause")) 389 + if (xbc_node_find_value(hnode, "pause", NULL)) 389 390 append_printf(&buf, end, ":pause"); 390 - else if (xbc_node_find_child(hnode, "continue")) 391 + else if (xbc_node_find_value(hnode, "continue", NULL)) 391 392 append_printf(&buf, end, ":continue"); 392 - else if (xbc_node_find_child(hnode, "clear")) 393 + else if (xbc_node_find_value(hnode, "clear", NULL)) 393 394 append_printf(&buf, end, ":clear"); 394 395 395 396 /* Histogram handler and actions */ 396 - node = xbc_node_find_child(hnode, "onmax"); 397 + node = xbc_node_find_subkey(hnode, "onmax"); 397 398 if (node && trace_boot_hist_add_handlers(node, &buf, end, "var") < 0) 398 399 return -EINVAL; 399 - node = xbc_node_find_child(hnode, "onchange"); 400 + node = xbc_node_find_subkey(hnode, "onchange"); 400 401 if (node && trace_boot_hist_add_handlers(node, &buf, end, "var") < 0) 401 402 return -EINVAL; 402 - node = xbc_node_find_child(hnode, "onmatch"); 403 + node = xbc_node_find_subkey(hnode, "onmatch"); 403 404 if (node && trace_boot_hist_add_handlers(node, &buf, end, "event") < 0) 404 405 return -EINVAL; 405 406 ··· 436 437 } 437 438 } 438 439 439 - if (xbc_node_find_child(hnode, "keys")) { 440 + if (xbc_node_find_subkey(hnode, "keys")) { 440 441 if (trace_boot_compose_hist_cmd(hnode, buf, size) == 0) { 441 442 tmp = kstrdup(buf, GFP_KERNEL); 442 443 if (trigger_process_regex(file, buf) < 0) ··· 495 496 else if (trigger_process_regex(file, buf) < 0) 496 497 pr_err("Failed to apply an action: %s\n", p); 497 498 } 498 - anode = xbc_node_find_child(enode, "hist"); 499 + anode = xbc_node_find_subkey(enode, "hist"); 499 500 if (anode) 500 501 trace_boot_init_histograms(file, anode, buf, ARRAY_SIZE(buf)); 501 502 } else if (xbc_node_find_value(enode, "actions", NULL)) ··· 517 518 bool enable, enable_all = false; 518 519 const char *data; 519 520 520 - node = xbc_node_find_child(node, "event"); 521 + node = xbc_node_find_subkey(node, "event"); 521 522 if (!node) 522 523 return; 523 524 /* per-event key starts with "event.GROUP.EVENT" */ ··· 620 621 struct trace_array *tr; 621 622 const char *p; 622 623 623 - node = xbc_node_find_child(node, "instance"); 624 + node = xbc_node_find_subkey(node, "instance"); 624 625 if (!node) 625 626 return; 626 627
+4 -4
lib/bootconfig.c
··· 142 142 } 143 143 144 144 /** 145 - * xbc_node_find_child() - Find a child node which matches given key 145 + * xbc_node_find_subkey() - Find a subkey node which matches given key 146 146 * @parent: An XBC node. 147 147 * @key: A key string. 148 148 * 149 - * Search a node under @parent which matches @key. The @key can contain 149 + * Search a key node under @parent which matches @key. The @key can contain 150 150 * several words jointed with '.'. If @parent is NULL, this searches the 151 151 * node from whole tree. Return NULL if no node is matched. 152 152 */ 153 153 struct xbc_node * __init 154 - xbc_node_find_child(struct xbc_node *parent, const char *key) 154 + xbc_node_find_subkey(struct xbc_node *parent, const char *key) 155 155 { 156 156 struct xbc_node *node; 157 157 ··· 191 191 xbc_node_find_value(struct xbc_node *parent, const char *key, 192 192 struct xbc_node **vnode) 193 193 { 194 - struct xbc_node *node = xbc_node_find_child(parent, key); 194 + struct xbc_node *node = xbc_node_find_subkey(parent, key); 195 195 196 196 if (!node || !xbc_node_is_key(node)) 197 197 return NULL;