@@ -219,13 +219,12 @@ static int __init
219219trace_boot_hist_add_array (struct xbc_node * hnode , char * * bufp ,
220220 char * end , const char * key )
221221{
222- struct xbc_node * knode , * anode ;
222+ struct xbc_node * anode ;
223223 const char * p ;
224224 char sep ;
225225
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 ) {
229228 if (!anode ) {
230229 pr_err ("hist.%s requires value(s).\n" , key );
231230 return - EINVAL ;
@@ -263,9 +262,9 @@ trace_boot_hist_add_one_handler(struct xbc_node *hnode, char **bufp,
263262 append_printf (bufp , end , ":%s(%s)" , handler , p );
264263
265264 /* Compose 'action' parameter */
266- knode = xbc_node_find_child (hnode , "trace" );
265+ knode = xbc_node_find_subkey (hnode , "trace" );
267266 if (!knode )
268- knode = xbc_node_find_child (hnode , "save" );
267+ knode = xbc_node_find_subkey (hnode , "save" );
269268
270269 if (knode ) {
271270 anode = xbc_node_get_child (knode );
@@ -284,7 +283,7 @@ trace_boot_hist_add_one_handler(struct xbc_node *hnode, char **bufp,
284283 sep = ',' ;
285284 }
286285 append_printf (bufp , end , ")" );
287- } else if (xbc_node_find_child (hnode , "snapshot" )) {
286+ } else if (xbc_node_find_subkey (hnode , "snapshot" )) {
288287 append_printf (bufp , end , ".snapshot()" );
289288 } else {
290289 pr_err ("hist.%s requires an action.\n" ,
@@ -315,7 +314,7 @@ trace_boot_hist_add_handlers(struct xbc_node *hnode, char **bufp,
315314 break ;
316315 }
317316
318- if (xbc_node_find_child (hnode , param ))
317+ if (xbc_node_find_subkey (hnode , param ))
319318 ret = trace_boot_hist_add_one_handler (hnode , bufp , end , handler , param );
320319
321320 return ret ;
@@ -375,7 +374,7 @@ trace_boot_compose_hist_cmd(struct xbc_node *hnode, char *buf, size_t size)
375374 if (p )
376375 append_printf (& buf , end , ":name=%s" , p );
377376
378- node = xbc_node_find_child (hnode , "var" );
377+ node = xbc_node_find_subkey (hnode , "var" );
379378 if (node ) {
380379 xbc_node_for_each_key_value (node , knode , p ) {
381380 /* Expression must not include spaces. */
@@ -386,21 +385,21 @@ trace_boot_compose_hist_cmd(struct xbc_node *hnode, char *buf, size_t size)
386385 }
387386
388387 /* Histogram control attributes (mutual exclusive) */
389- if (xbc_node_find_child (hnode , "pause" ))
388+ if (xbc_node_find_value (hnode , "pause" , NULL ))
390389 append_printf (& buf , end , ":pause" );
391- else if (xbc_node_find_child (hnode , "continue" ))
390+ else if (xbc_node_find_value (hnode , "continue" , NULL ))
392391 append_printf (& buf , end , ":continue" );
393- else if (xbc_node_find_child (hnode , "clear" ))
392+ else if (xbc_node_find_value (hnode , "clear" , NULL ))
394393 append_printf (& buf , end , ":clear" );
395394
396395 /* Histogram handler and actions */
397- node = xbc_node_find_child (hnode , "onmax" );
396+ node = xbc_node_find_subkey (hnode , "onmax" );
398397 if (node && trace_boot_hist_add_handlers (node , & buf , end , "var" ) < 0 )
399398 return - EINVAL ;
400- node = xbc_node_find_child (hnode , "onchange" );
399+ node = xbc_node_find_subkey (hnode , "onchange" );
401400 if (node && trace_boot_hist_add_handlers (node , & buf , end , "var" ) < 0 )
402401 return - EINVAL ;
403- node = xbc_node_find_child (hnode , "onmatch" );
402+ node = xbc_node_find_subkey (hnode , "onmatch" );
404403 if (node && trace_boot_hist_add_handlers (node , & buf , end , "event" ) < 0 )
405404 return - EINVAL ;
406405
@@ -437,7 +436,7 @@ trace_boot_init_histograms(struct trace_event_file *file,
437436 }
438437 }
439438
440- if (xbc_node_find_child (hnode , "keys" )) {
439+ if (xbc_node_find_subkey (hnode , "keys" )) {
441440 if (trace_boot_compose_hist_cmd (hnode , buf , size ) == 0 ) {
442441 tmp = kstrdup (buf , GFP_KERNEL );
443442 if (trigger_process_regex (file , buf ) < 0 )
@@ -496,7 +495,7 @@ trace_boot_init_one_event(struct trace_array *tr, struct xbc_node *gnode,
496495 else if (trigger_process_regex (file , buf ) < 0 )
497496 pr_err ("Failed to apply an action: %s\n" , p );
498497 }
499- anode = xbc_node_find_child (enode , "hist" );
498+ anode = xbc_node_find_subkey (enode , "hist" );
500499 if (anode )
501500 trace_boot_init_histograms (file , anode , buf , ARRAY_SIZE (buf ));
502501 } else if (xbc_node_find_value (enode , "actions" , NULL ))
@@ -518,7 +517,7 @@ trace_boot_init_events(struct trace_array *tr, struct xbc_node *node)
518517 bool enable , enable_all = false;
519518 const char * data ;
520519
521- node = xbc_node_find_child (node , "event" );
520+ node = xbc_node_find_subkey (node , "event" );
522521 if (!node )
523522 return ;
524523 /* per-event key starts with "event.GROUP.EVENT" */
@@ -621,7 +620,7 @@ trace_boot_init_instances(struct xbc_node *node)
621620 struct trace_array * tr ;
622621 const char * p ;
623622
624- node = xbc_node_find_child (node , "instance" );
623+ node = xbc_node_find_subkey (node , "instance" );
625624 if (!node )
626625 return ;
627626
0 commit comments