tracing: simple updates
Steven Rostedt
maintainerIngo,
I understand that I'm currently on Thomas's "most loved" list, I figured I would send out these simple changes. Nothing that should cause me another brown paper bag fix in this.
Please pull the latest tip/perf/core tree, which can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
tip/perf/core
Head SHA1: 7374e82771c6d5a9af2080be46f64a5826c7efb1
Borislav Petkov (1):
ftrace: Remove a superfluous check
Steven Rostedt (2):
tracing: Add comments for the other bits of ftrace_event_call.flags
tracing: Register the ftrace internal events during early boot
----
include/linux/ftrace_event.h | 3 +++ kernel/trace/ftrace.c | 8 ++------ kernel/trace/trace_output.c | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-)
Steven Rostedt
maintainerPATCH 1/3 ftrace: Remove a superfluous check
From: Borislav Petkov <[email protected]>
register_ftrace_function() checks ftrace_disabled and calls __register_ftrace_function which does it again.
Drop the first check and add the unlikely hint to the second one. Also, drop the label as John correctly notices.
No functional change.
--- kernel/trace/ftrace.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
kernel/trace/ftrace.c +2 -6
@@ -312,7 +312,7 @@ static int remove_ftrace_list_ops(struct ftrace_ops **list,static int __register_ftrace_function (struct ftrace_ops *ops) { -if (ftrace_disabled) +if (unlikely (ftrace_disabled))return -ENODEV ;if (FTRACE_WARN_ON (ops == &global_ops))
@@ -4299,16 +4299,12 @@ int register_ftrace_function(struct ftrace_ops *ops)mutex_lock (&ftrace_lock); -if (unlikely (ftrace_disabled)) - goto out_unlock; - ret =__register_ftrace_function (ops);if (!ret) ret =ftrace_startup (ops,0 ); - - out_unlock:mutex_unlock (&ftrace_lock); +return ret; }EXPORT_SYMBOL_GPL (register_ftrace_function);
Signature · 1 line
1.7.10
Steven Rostedt
maintainerPATCH 2/3 tracing: Add comments for the other bits of ftrace_event_call.flags
In reply to Steven RostedtFrom: Steven Rostedt <[email protected]>
TRACE_EVENT_FL_ENABLED_BIT,
TRACE_EVENT_FL_FILTERED_BIT,
TRACE_EVENT_FL_RECORDED_CMD_BIT,
Have comments about what they are, but:
TRACE_EVENT_FL_CAP_ANY_BIT,
TRACE_EVENT_FL_NO_SET_FILTER_BIT,
TRACE_EVENT_FL_IGNORE_ENABLE_BIT,
do not, making them second class citizens. To prevent another class warfare, these bits have protested for their right to be commented. And By Golly! I'll give them what they want!
--- include/linux/ftrace_event.h | 3 +++ 1 file changed, 3 insertions(+)
include/linux/ftrace_event.h +3 -0
@@ -207,6 +207,9 @@ struct ftrace_event_call {* bit 1: enabled * bit 2: filter_active * bit 3: enabled cmd record +* bit 4: allow trace by non root (cap any) +* bit 5: failed to apply filter +* bit 6: ftrace internal event (do not enable) * * Changes to flags must hold the event_mutex. *
Signature · 1 line
1.7.10
Steven Rostedt
maintainerPATCH 3/3 tracing: Register the ftrace internal events during early boot
In reply to Steven RostedtFrom: Steven Rostedt <[email protected]>
All trace events including ftrace internel events (like trace_printk and function tracing), register functions that describe how to print their output. The events may be recorded as soon as the ring buffer is allocated, but they are just raw binary in the buffer. The mapping of event ids to how to print them are held within a structure that is registered on system boot.
If a crash happens in boot up before these functions are registered then their output (via ftrace_dump_on_oops) will be useless:
Dumping ftrace buffer:
---------------------------------
<...>-1 0.... 319705us : Unknown type 6
---------------------------------
This can be quite frustrating for a kernel developer trying to see what is going wrong.
There's no reason to register them so late in the boot up process. They can be registered by early_initcall().
--- kernel/trace/trace_output.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/trace/trace_output.c +1 -1
@@ -1325,4 +1325,4 @@ __init static int init_events(void)return 0 ; } -device_initcall (init_events); +early_initcall (init_events);
Signature · 1 line
1.7.10
Quoted 21 lines · Steven Rostedt
Ingo,
I understand that I'm currently on Thomas's "most loved" list, I figured I would send out these simple changes. Nothing that should cause me another brown paper bag fix in this.
Please pull the latest tip/perf/core tree, which can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
tip/perf/coreHead SHA1:
7374e82771c6d5a9af2080be46f64a5826c7efb1Borislav Petkov (1):
ftrace: Remove a superfluous checkSteven Rostedt (2):
tracing: Add comments for the other bits of ftrace_event_call.flags
tracing: Register the ftrace internal events during early boot
Quoted 5 lines
----
include/linux/ftrace_event.h | 3 +++ kernel/trace/ftrace.c | 8 ++------ kernel/trace/trace_output.c | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-)
Pulled, thanks Steve!
Ingo