Skip to content

Commit 326669f

Browse files
committed
tracing: Move tracing_set_filter_buffering() into trace_events_hist.c
The function tracing_set_filter_buffering() is only used in trace_events_hist.c. Move it to that file and make it static. Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Cc: Andrew Morton <akpm@linux-foundation.org> Link: https://patch.msgid.link/20260206195936.617080218@kernel.org Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 parent c8b039c commit 326669f

3 files changed

Lines changed: 20 additions & 21 deletions

File tree

kernel/trace/trace.c

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7891,26 +7891,6 @@ u64 tracing_event_time_stamp(struct trace_buffer *buffer, struct ring_buffer_eve
78917891
return ring_buffer_event_time_stamp(buffer, rbe);
78927892
}
78937893

7894-
/*
7895-
* Set or disable using the per CPU trace_buffer_event when possible.
7896-
*/
7897-
int tracing_set_filter_buffering(struct trace_array *tr, bool set)
7898-
{
7899-
guard(mutex)(&trace_types_lock);
7900-
7901-
if (set && tr->no_filter_buffering_ref++)
7902-
return 0;
7903-
7904-
if (!set) {
7905-
if (WARN_ON_ONCE(!tr->no_filter_buffering_ref))
7906-
return -EINVAL;
7907-
7908-
--tr->no_filter_buffering_ref;
7909-
}
7910-
7911-
return 0;
7912-
}
7913-
79147894
struct ftrace_buffer_info {
79157895
struct trace_iterator iter;
79167896
void *spare;

kernel/trace/trace.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,6 @@ extern struct trace_array *trace_array_find(const char *instance);
476476
extern struct trace_array *trace_array_find_get(const char *instance);
477477

478478
extern u64 tracing_event_time_stamp(struct trace_buffer *buffer, struct ring_buffer_event *rbe);
479-
extern int tracing_set_filter_buffering(struct trace_array *tr, bool set);
480479
extern int tracing_set_clock(struct trace_array *tr, const char *clockstr);
481480

482481
extern bool trace_clock_in_ns(struct trace_array *tr);

kernel/trace/trace_events_hist.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6531,6 +6531,26 @@ static bool existing_hist_update_only(char *glob,
65316531
return updated;
65326532
}
65336533

6534+
/*
6535+
* Set or disable using the per CPU trace_buffer_event when possible.
6536+
*/
6537+
static int tracing_set_filter_buffering(struct trace_array *tr, bool set)
6538+
{
6539+
guard(mutex)(&trace_types_lock);
6540+
6541+
if (set && tr->no_filter_buffering_ref++)
6542+
return 0;
6543+
6544+
if (!set) {
6545+
if (WARN_ON_ONCE(!tr->no_filter_buffering_ref))
6546+
return -EINVAL;
6547+
6548+
--tr->no_filter_buffering_ref;
6549+
}
6550+
6551+
return 0;
6552+
}
6553+
65346554
static int hist_register_trigger(char *glob,
65356555
struct event_trigger_data *data,
65366556
struct trace_event_file *file)

0 commit comments

Comments
 (0)