Commit 326669fa authored by Steven Rostedt's avatar Steven Rostedt Committed by Steven Rostedt (Google)
Browse files

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: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
parent c8b039c3
Loading
Loading
Loading
Loading
+0 −20
Original line number Diff line number Diff line
@@ -7891,26 +7891,6 @@ u64 tracing_event_time_stamp(struct trace_buffer *buffer, struct ring_buffer_eve
	return ring_buffer_event_time_stamp(buffer, rbe);
}

/*
 * Set or disable using the per CPU trace_buffer_event when possible.
 */
int tracing_set_filter_buffering(struct trace_array *tr, bool set)
{
	guard(mutex)(&trace_types_lock);

	if (set && tr->no_filter_buffering_ref++)
		return 0;

	if (!set) {
		if (WARN_ON_ONCE(!tr->no_filter_buffering_ref))
			return -EINVAL;

		--tr->no_filter_buffering_ref;
	}

	return 0;
}

struct ftrace_buffer_info {
	struct trace_iterator	iter;
	void			*spare;
+0 −1
Original line number Diff line number Diff line
@@ -476,7 +476,6 @@ extern struct trace_array *trace_array_find(const char *instance);
extern struct trace_array *trace_array_find_get(const char *instance);

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

extern bool trace_clock_in_ns(struct trace_array *tr);
+20 −0
Original line number Diff line number Diff line
@@ -6531,6 +6531,26 @@ static bool existing_hist_update_only(char *glob,
	return updated;
}

/*
 * Set or disable using the per CPU trace_buffer_event when possible.
 */
static int tracing_set_filter_buffering(struct trace_array *tr, bool set)
{
	guard(mutex)(&trace_types_lock);

	if (set && tr->no_filter_buffering_ref++)
		return 0;

	if (!set) {
		if (WARN_ON_ONCE(!tr->no_filter_buffering_ref))
			return -EINVAL;

		--tr->no_filter_buffering_ref;
	}

	return 0;
}

static int hist_register_trigger(char *glob,
				 struct event_trigger_data *data,
				 struct trace_event_file *file)