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.

tracing/boot: Fix a hist trigger dependency for boot time tracing

Fixes a build error when CONFIG_HIST_TRIGGERS=n with boot-time
tracing. Since the trigger_process_regex() is defined only
when CONFIG_HIST_TRIGGERS=y, if it is disabled, the 'actions'
event option also must be disabled.

Link: https://lkml.kernel.org/r/162856123376.203126.582144262622247352.stgit@devnote2

Fixes: 81a59555ff15 ("tracing/boot: Add per-event settings")
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

authored by

Masami Hiramatsu and committed by
Steven Rostedt (VMware)
6fe7c745 6c34df6f

+9 -6
+9 -6
kernel/trace/trace_boot.c
··· 205 205 pr_err("Failed to apply filter: %s\n", buf); 206 206 } 207 207 208 - xbc_node_for_each_array_value(enode, "actions", anode, p) { 209 - if (strlcpy(buf, p, ARRAY_SIZE(buf)) >= ARRAY_SIZE(buf)) 210 - pr_err("action string is too long: %s\n", p); 211 - else if (trigger_process_regex(file, buf) < 0) 212 - pr_err("Failed to apply an action: %s\n", buf); 213 - } 208 + if (IS_ENABLED(CONFIG_HIST_TRIGGERS)) { 209 + xbc_node_for_each_array_value(enode, "actions", anode, p) { 210 + if (strlcpy(buf, p, ARRAY_SIZE(buf)) >= ARRAY_SIZE(buf)) 211 + pr_err("action string is too long: %s\n", p); 212 + else if (trigger_process_regex(file, buf) < 0) 213 + pr_err("Failed to apply an action: %s\n", buf); 214 + } 215 + } else if (xbc_node_find_value(enode, "actions", NULL)) 216 + pr_err("Failed to apply event actions because CONFIG_HIST_TRIGGERS is not set.\n"); 214 217 215 218 if (xbc_node_find_value(enode, "enable", NULL)) { 216 219 if (trace_event_enable_disable(file, 1, 0) < 0)