aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace_functions.c
diff options
context:
space:
mode:
authorSteven Rostedt (VMware) <rostedt@goodmis.org>2017-04-20 11:46:03 -0400
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2017-04-20 22:06:48 -0400
commit2290f2c589285d0031e3b7445afff8949f3fdbb6 (patch)
tree98f8e9db7a57eadcaf517404e0f5712b0a204461 /kernel/trace/trace_functions.c
parentcab5037950821caa1301df0223de657c6ee202a8 (diff)
tracing/ftrace: Allow for the traceonoff probe be unique to instances
Have the traceon/off function probe triggers affect only the instance they are set in. This required making the trace_on/off accessible for other files in the tracing directory. Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace_functions.c')
-rw-r--r--kernel/trace/trace_functions.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/kernel/trace/trace_functions.c b/kernel/trace/trace_functions.c
index 7775e1ca5bad..8c30ca733a5c 100644
--- a/kernel/trace/trace_functions.c
+++ b/kernel/trace/trace_functions.c
@@ -268,7 +268,8 @@ static struct tracer function_trace __tracer_data =
268 268
269#ifdef CONFIG_DYNAMIC_FTRACE 269#ifdef CONFIG_DYNAMIC_FTRACE
270static void update_traceon_count(struct ftrace_probe_ops *ops, 270static void update_traceon_count(struct ftrace_probe_ops *ops,
271 unsigned long ip, bool on, 271 unsigned long ip,
272 struct trace_array *tr, bool on,
272 void *data) 273 void *data)
273{ 274{
274 struct ftrace_func_mapper *mapper = data; 275 struct ftrace_func_mapper *mapper = data;
@@ -313,13 +314,13 @@ static void update_traceon_count(struct ftrace_probe_ops *ops,
313 /* Make sure we see count before checking tracing state */ 314 /* Make sure we see count before checking tracing state */
314 smp_rmb(); 315 smp_rmb();
315 316
316 if (on == !!tracing_is_on()) 317 if (on == !!tracer_tracing_is_on(tr))
317 return; 318 return;
318 319
319 if (on) 320 if (on)
320 tracing_on(); 321 tracer_tracing_on(tr);
321 else 322 else
322 tracing_off(); 323 tracer_tracing_off(tr);
323 324
324 /* Make sure tracing state is visible before updating count */ 325 /* Make sure tracing state is visible before updating count */
325 smp_wmb(); 326 smp_wmb();
@@ -332,7 +333,7 @@ ftrace_traceon_count(unsigned long ip, unsigned long parent_ip,
332 struct trace_array *tr, struct ftrace_probe_ops *ops, 333 struct trace_array *tr, struct ftrace_probe_ops *ops,
333 void *data) 334 void *data)
334{ 335{
335 update_traceon_count(ops, ip, 1, data); 336 update_traceon_count(ops, ip, tr, 1, data);
336} 337}
337 338
338static void 339static void
@@ -340,7 +341,7 @@ ftrace_traceoff_count(unsigned long ip, unsigned long parent_ip,
340 struct trace_array *tr, struct ftrace_probe_ops *ops, 341 struct trace_array *tr, struct ftrace_probe_ops *ops,
341 void *data) 342 void *data)
342{ 343{
343 update_traceon_count(ops, ip, 0, data); 344 update_traceon_count(ops, ip, tr, 0, data);
344} 345}
345 346
346static void 347static void
@@ -348,10 +349,10 @@ ftrace_traceon(unsigned long ip, unsigned long parent_ip,
348 struct trace_array *tr, struct ftrace_probe_ops *ops, 349 struct trace_array *tr, struct ftrace_probe_ops *ops,
349 void *data) 350 void *data)
350{ 351{
351 if (tracing_is_on()) 352 if (tracer_tracing_is_on(tr))
352 return; 353 return;
353 354
354 tracing_on(); 355 tracer_tracing_on(tr);
355} 356}
356 357
357static void 358static void
@@ -359,10 +360,10 @@ ftrace_traceoff(unsigned long ip, unsigned long parent_ip,
359 struct trace_array *tr, struct ftrace_probe_ops *ops, 360 struct trace_array *tr, struct ftrace_probe_ops *ops,
360 void *data) 361 void *data)
361{ 362{
362 if (!tracing_is_on()) 363 if (!tracer_tracing_is_on(tr))
363 return; 364 return;
364 365
365 tracing_off(); 366 tracer_tracing_off(tr);
366} 367}
367 368
368/* 369/*