Skip to content

Commit bf6065b

Browse files
committed
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: Steven Rostedt <rostedt@goodmis.org>
1 parent 8c1a49a commit bf6065b

4 files changed

Lines changed: 8 additions & 4 deletions

File tree

‎kernel/trace/trace.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3393,7 +3393,7 @@ int set_tracer_flag(struct trace_array *tr, unsigned int mask, int enabled)
33933393

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

33993399
if (enabled)

‎kernel/trace/trace.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ struct tracer {
358358
int (*set_flag)(struct trace_array *tr,
359359
u32 old_flags, u32 bit, int set);
360360
/* Return 0 if OK with change, else return non-zero */
361-
int (*flag_changed)(struct tracer *tracer,
361+
int (*flag_changed)(struct trace_array *tr,
362362
u32 mask, int set);
363363
struct tracer *next;
364364
struct tracer_flags *flags;

‎kernel/trace/trace_irqsoff.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,8 +572,10 @@ static void irqsoff_function_set(int set)
572572
unregister_irqsoff_function(is_graph());
573573
}
574574

575-
static int irqsoff_flag_changed(struct tracer *tracer, u32 mask, int set)
575+
static int irqsoff_flag_changed(struct trace_array *tr, u32 mask, int set)
576576
{
577+
struct tracer *tracer = tr->current_trace;
578+
577579
if (mask & TRACE_ITER_FUNCTION)
578580
irqsoff_function_set(set);
579581

‎kernel/trace/trace_sched_wakeup.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,10 @@ static void wakeup_function_set(int set)
179179
unregister_wakeup_function(is_graph());
180180
}
181181

182-
static int wakeup_flag_changed(struct tracer *tracer, u32 mask, int set)
182+
static int wakeup_flag_changed(struct trace_array *tr, u32 mask, int set)
183183
{
184+
struct tracer *tracer = tr->current_trace;
185+
184186
if (mask & TRACE_ITER_FUNCTION)
185187
wakeup_function_set(set);
186188

0 commit comments

Comments
 (0)