]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
tracing: Consolidate trace_add/remove_event_call back to the nolock functions
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Tue, 4 Dec 2018 18:35:45 +0000 (13:35 -0500)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Mon, 10 Dec 2018 17:22:10 +0000 (12:22 -0500)
The trace_add/remove_event_call_nolock() functions were added to allow
the tace_add/remove_event_call() code be called when the event_mutex
lock was already taken. Now that all callers are done within the
event_mutex, there's no reason to have two different interfaces.

Remove the current wrapper trace_add/remove_event_call()s and rename the
_nolock versions back to the original names.

Link: http://lkml.kernel.org/r/154140866955.17322.2081425494660638846.stgit@devbox
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
include/linux/trace_events.h
kernel/trace/trace_events.c
kernel/trace/trace_events_hist.c
kernel/trace/trace_kprobe.c
kernel/trace/trace_uprobe.c

index 3aa05593a53f152b001afe7e4110e411ff88393c..4130a5497d40523c0f01a52d1235edb31a3ee4f2 100644 (file)
@@ -529,8 +529,6 @@ extern int trace_event_raw_init(struct trace_event_call *call);
 extern int trace_define_field(struct trace_event_call *call, const char *type,
                              const char *name, int offset, int size,
                              int is_signed, int filter_type);
-extern int trace_add_event_call_nolock(struct trace_event_call *call);
-extern int trace_remove_event_call_nolock(struct trace_event_call *call);
 extern int trace_add_event_call(struct trace_event_call *call);
 extern int trace_remove_event_call(struct trace_event_call *call);
 extern int trace_event_get_offsets(struct trace_event_call *call);
index a3b157f689ee549025206f3f365639e0fea0e3c9..bd0162c0467c8d7f5c06d80d0139cca7cf03a48c 100644 (file)
@@ -2305,7 +2305,8 @@ __trace_early_add_new_event(struct trace_event_call *call,
 struct ftrace_module_file_ops;
 static void __add_event_to_tracers(struct trace_event_call *call);
 
-int trace_add_event_call_nolock(struct trace_event_call *call)
+/* Add an additional event_call dynamically */
+int trace_add_event_call(struct trace_event_call *call)
 {
        int ret;
        lockdep_assert_held(&event_mutex);
@@ -2320,17 +2321,6 @@ int trace_add_event_call_nolock(struct trace_event_call *call)
        return ret;
 }
 
-/* Add an additional event_call dynamically */
-int trace_add_event_call(struct trace_event_call *call)
-{
-       int ret;
-
-       mutex_lock(&event_mutex);
-       ret = trace_add_event_call_nolock(call);
-       mutex_unlock(&event_mutex);
-       return ret;
-}
-
 /*
  * Must be called under locking of trace_types_lock, event_mutex and
  * trace_event_sem.
@@ -2376,8 +2366,8 @@ static int probe_remove_event_call(struct trace_event_call *call)
        return 0;
 }
 
-/* no event_mutex version */
-int trace_remove_event_call_nolock(struct trace_event_call *call)
+/* Remove an event_call */
+int trace_remove_event_call(struct trace_event_call *call)
 {
        int ret;
 
@@ -2392,18 +2382,6 @@ int trace_remove_event_call_nolock(struct trace_event_call *call)
        return ret;
 }
 
-/* Remove an event_call */
-int trace_remove_event_call(struct trace_event_call *call)
-{
-       int ret;
-
-       mutex_lock(&event_mutex);
-       ret = trace_remove_event_call_nolock(call);
-       mutex_unlock(&event_mutex);
-
-       return ret;
-}
-
 #define for_each_event(event, start, end)                      \
        for (event = start;                                     \
             (unsigned long)event < (unsigned long)end;         \
index 21e4954375a119660f78dbb9c9f22326308bcbcd..82e72c48a5a980ee2d27a34edd1c60f33bc8bb79 100644 (file)
@@ -960,7 +960,7 @@ static int register_synth_event(struct synth_event *event)
        call->data = event;
        call->tp = event->tp;
 
-       ret = trace_add_event_call_nolock(call);
+       ret = trace_add_event_call(call);
        if (ret) {
                pr_warn("Failed to register synthetic event: %s\n",
                        trace_event_name(call));
@@ -969,7 +969,7 @@ static int register_synth_event(struct synth_event *event)
 
        ret = set_synth_event_print_fmt(call);
        if (ret < 0) {
-               trace_remove_event_call_nolock(call);
+               trace_remove_event_call(call);
                goto err;
        }
  out:
@@ -984,7 +984,7 @@ static int unregister_synth_event(struct synth_event *event)
        struct trace_event_call *call = &event->call;
        int ret;
 
-       ret = trace_remove_event_call_nolock(call);
+       ret = trace_remove_event_call(call);
 
        return ret;
 }
index bdf8c2ad5152ac82bcf004f5a5305cd5f39c57b8..0e0f7b8024fb7c3edc962210395429d60db2e5ad 100644 (file)
@@ -1353,7 +1353,7 @@ static int register_kprobe_event(struct trace_kprobe *tk)
                kfree(call->print_fmt);
                return -ENODEV;
        }
-       ret = trace_add_event_call_nolock(call);
+       ret = trace_add_event_call(call);
        if (ret) {
                pr_info("Failed to register kprobe event: %s\n",
                        trace_event_name(call));
@@ -1368,7 +1368,7 @@ static int unregister_kprobe_event(struct trace_kprobe *tk)
        int ret;
 
        /* tp->event is unregistered in trace_remove_event_call() */
-       ret = trace_remove_event_call_nolock(&tk->tp.call);
+       ret = trace_remove_event_call(&tk->tp.call);
        if (!ret)
                kfree(tk->tp.call.print_fmt);
        return ret;
index 4a7b21c891f3dd5cb483c62a6bec21ce60812340..e335576b941181614abd9eb8c15b0b710c3c0972 100644 (file)
@@ -1320,7 +1320,7 @@ static int register_uprobe_event(struct trace_uprobe *tu)
                return -ENODEV;
        }
 
-       ret = trace_add_event_call_nolock(call);
+       ret = trace_add_event_call(call);
 
        if (ret) {
                pr_info("Failed to register uprobe event: %s\n",
@@ -1337,7 +1337,7 @@ static int unregister_uprobe_event(struct trace_uprobe *tu)
        int ret;
 
        /* tu->event is unregistered in trace_remove_event_call() */
-       ret = trace_remove_event_call_nolock(&tu->tp.call);
+       ret = trace_remove_event_call(&tu->tp.call);
        if (ret)
                return ret;
        kfree(tu->tp.call.print_fmt);