Skip to content

Commit 4983955

Browse files
author
Ingo Molnar
committed
Merge branch 'tip/perf/core' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace into perf/core
Pull ftrace robustization fixes from Steve Rostedt. Signed-off-by: Ingo Molnar <[email protected]>
2 parents e227051 + 7374e82 commit 4983955

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

include/linux/ftrace_event.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,9 @@ struct ftrace_event_call {
207207
* bit 1: enabled
208208
* bit 2: filter_active
209209
* bit 3: enabled cmd record
210+
* bit 4: allow trace by non root (cap any)
211+
* bit 5: failed to apply filter
212+
* bit 6: ftrace internal event (do not enable)
210213
*
211214
* Changes to flags must hold the event_mutex.
212215
*

kernel/trace/ftrace.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ static int remove_ftrace_list_ops(struct ftrace_ops **list,
312312

313313
static int __register_ftrace_function(struct ftrace_ops *ops)
314314
{
315-
if (ftrace_disabled)
315+
if (unlikely(ftrace_disabled))
316316
return -ENODEV;
317317

318318
if (FTRACE_WARN_ON(ops == &global_ops))
@@ -4299,16 +4299,12 @@ int register_ftrace_function(struct ftrace_ops *ops)
42994299

43004300
mutex_lock(&ftrace_lock);
43014301

4302-
if (unlikely(ftrace_disabled))
4303-
goto out_unlock;
4304-
43054302
ret = __register_ftrace_function(ops);
43064303
if (!ret)
43074304
ret = ftrace_startup(ops, 0);
43084305

4309-
4310-
out_unlock:
43114306
mutex_unlock(&ftrace_lock);
4307+
43124308
return ret;
43134309
}
43144310
EXPORT_SYMBOL_GPL(register_ftrace_function);

kernel/trace/trace_output.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1325,4 +1325,4 @@ __init static int init_events(void)
13251325

13261326
return 0;
13271327
}
1328-
device_initcall(init_events);
1328+
early_initcall(init_events);

0 commit comments

Comments
 (0)