Skip to content

Commit c7b84ec

Browse files
Steven Rostedtrostedt
authored andcommitted
tracing: Remove unused function unregister_tracer()
The function register_tracer() is only used by kernel core code, that never needs to remove the tracer. As trace_events have become the main way to add new tracing to the kernel, the need to unregister a tracer has diminished. Remove the unused function unregister_tracer(). If a need arises where we need it, then we can always add it back. Signed-off-by: Steven Rostedt <[email protected]>
1 parent 15075ca commit c7b84ec

File tree

2 files changed

+0
-27
lines changed

2 files changed

+0
-27
lines changed

kernel/trace/trace.c

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -882,32 +882,6 @@ int register_tracer(struct tracer *type)
882882
return ret;
883883
}
884884

885-
void unregister_tracer(struct tracer *type)
886-
{
887-
struct tracer **t;
888-
889-
mutex_lock(&trace_types_lock);
890-
for (t = &trace_types; *t; t = &(*t)->next) {
891-
if (*t == type)
892-
goto found;
893-
}
894-
pr_info("Tracer %s not registered\n", type->name);
895-
goto out;
896-
897-
found:
898-
*t = (*t)->next;
899-
900-
if (type == current_trace && tracer_enabled) {
901-
tracer_enabled = 0;
902-
tracing_stop();
903-
if (current_trace->stop)
904-
current_trace->stop(&global_trace);
905-
current_trace = &nop_trace;
906-
}
907-
out:
908-
mutex_unlock(&trace_types_lock);
909-
}
910-
911885
void tracing_reset(struct trace_array *tr, int cpu)
912886
{
913887
struct ring_buffer *buffer = tr->buffer;

kernel/trace/trace.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,6 @@ void tracing_sched_switch_assign_trace(struct trace_array *tr);
410410
void tracing_stop_sched_switch_record(void);
411411
void tracing_start_sched_switch_record(void);
412412
int register_tracer(struct tracer *type);
413-
void unregister_tracer(struct tracer *type);
414413
int is_tracing_stopped(void);
415414
enum trace_file_type {
416415
TRACE_FILE_LAT_FMT = 1,

0 commit comments

Comments
 (0)