Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bf6065b5 authored by Steven Rostedt (Red Hat)'s avatar Steven Rostedt (Red Hat) Committed by Steven Rostedt
Browse files

tracing: Pass trace_array to flag_changed callback



As options (flags) may affect instances instead of being global
the flag_changed() callbacks need to receive the trace_array descriptor
of the instance they will be modifying.

Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent 8c1a49ae
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -3393,7 +3393,7 @@ int set_tracer_flag(struct trace_array *tr, unsigned int mask, int enabled)


	/* Give the tracer a chance to approve the change */
	/* Give the tracer a chance to approve the change */
	if (tr->current_trace->flag_changed)
	if (tr->current_trace->flag_changed)
		if (tr->current_trace->flag_changed(tr->current_trace, mask, !!enabled))
		if (tr->current_trace->flag_changed(tr, mask, !!enabled))
			return -EINVAL;
			return -EINVAL;


	if (enabled)
	if (enabled)
+1 −1
Original line number Original line Diff line number Diff line
@@ -358,7 +358,7 @@ struct tracer {
	int			(*set_flag)(struct trace_array *tr,
	int			(*set_flag)(struct trace_array *tr,
					    u32 old_flags, u32 bit, int set);
					    u32 old_flags, u32 bit, int set);
	/* Return 0 if OK with change, else return non-zero */
	/* Return 0 if OK with change, else return non-zero */
	int			(*flag_changed)(struct tracer *tracer,
	int			(*flag_changed)(struct trace_array *tr,
						u32 mask, int set);
						u32 mask, int set);
	struct tracer		*next;
	struct tracer		*next;
	struct tracer_flags	*flags;
	struct tracer_flags	*flags;
+3 −1
Original line number Original line Diff line number Diff line
@@ -572,8 +572,10 @@ static void irqsoff_function_set(int set)
		unregister_irqsoff_function(is_graph());
		unregister_irqsoff_function(is_graph());
}
}


static int irqsoff_flag_changed(struct tracer *tracer, u32 mask, int set)
static int irqsoff_flag_changed(struct trace_array *tr, u32 mask, int set)
{
{
	struct tracer *tracer = tr->current_trace;

	if (mask & TRACE_ITER_FUNCTION)
	if (mask & TRACE_ITER_FUNCTION)
		irqsoff_function_set(set);
		irqsoff_function_set(set);


+3 −1
Original line number Original line Diff line number Diff line
@@ -179,8 +179,10 @@ static void wakeup_function_set(int set)
		unregister_wakeup_function(is_graph());
		unregister_wakeup_function(is_graph());
}
}


static int wakeup_flag_changed(struct tracer *tracer, u32 mask, int set)
static int wakeup_flag_changed(struct trace_array *tr, u32 mask, int set)
{
{
	struct tracer *tracer = tr->current_trace;

	if (mask & TRACE_ITER_FUNCTION)
	if (mask & TRACE_ITER_FUNCTION)
		wakeup_function_set(set);
		wakeup_function_set(set);