Commit 44d00dc7 authored by Masami Hiramatsu's avatar Masami Hiramatsu Committed by Steven Rostedt (VMware)
Browse files

tracing/probe: Fix to allow user to enable events on unloaded modules

Fix to allow user to enable probe events on unloaded modules.

This operations was allowed before commit 60d53e2c ("tracing/probe:
Split trace_event related data from trace_probe"), because if users
need to probe module init functions, they have to enable those probe
events before loading module.


Fixes: 60d53e2c

 ("tracing/probe: Split trace_event related data from trace_probe")
Signed-off-by: default avatarMasami Hiramatsu <>
Signed-off-by: default avatarSteven Rostedt (VMware) <>
parent 604e3548
......@@ -371,31 +371,24 @@ static int enable_trace_kprobe(struct trace_event_call *call,
if (enabled)
return 0;
enabled = false;
list_for_each_entry(pos, trace_probe_probe_list(tp), list) {
tk = container_of(pos, struct trace_kprobe, tp);
if (trace_kprobe_has_gone(tk))
ret = __enable_trace_kprobe(tk);
if (ret) {
if (enabled) {
enabled = false;
if (ret)
enabled = true;
if (!enabled) {
/* No probe is enabled. Roll back */
if (ret) {
/* Failed to enable one of them. Roll back all */
if (enabled)
if (file)
trace_probe_remove_file(tp, file);
trace_probe_clear_flag(tp, TP_FLAG_PROFILE);
if (!ret)
/* Since all probes are gone, this is not available */
return ret;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment