Steven Noonan | fb1b6d8 | 2008-09-19 03:06:43 -0700 | [diff] [blame] | 1 | /* |
| 2 | * nop tracer |
| 3 | * |
| 4 | * Copyright (C) 2008 Steven Noonan <steven@uplinklabs.net> |
| 5 | * |
| 6 | */ |
| 7 | |
| 8 | #include <linux/module.h> |
| 9 | #include <linux/fs.h> |
| 10 | #include <linux/debugfs.h> |
| 11 | #include <linux/ftrace.h> |
| 12 | |
| 13 | #include "trace.h" |
| 14 | |
| 15 | static struct trace_array *ctx_trace; |
| 16 | |
| 17 | static void start_nop_trace(struct trace_array *tr) |
| 18 | { |
| 19 | /* Nothing to do! */ |
| 20 | } |
| 21 | |
| 22 | static void stop_nop_trace(struct trace_array *tr) |
| 23 | { |
| 24 | /* Nothing to do! */ |
| 25 | } |
| 26 | |
| 27 | static void nop_trace_init(struct trace_array *tr) |
| 28 | { |
Frédéric Weisbecker | 35cb5ed | 2008-09-21 20:10:14 +0200 | [diff] [blame] | 29 | int cpu; |
Steven Noonan | fb1b6d8 | 2008-09-19 03:06:43 -0700 | [diff] [blame] | 30 | ctx_trace = tr; |
| 31 | |
Frédéric Weisbecker | 35cb5ed | 2008-09-21 20:10:14 +0200 | [diff] [blame] | 32 | for_each_online_cpu(cpu) |
Steven Rostedt | 3928a8a | 2008-09-29 23:02:41 -0400 | [diff] [blame] | 33 | tracing_reset(tr, cpu); |
Frédéric Weisbecker | 35cb5ed | 2008-09-21 20:10:14 +0200 | [diff] [blame] | 34 | |
Steven Rostedt | c76f069 | 2008-11-07 22:36:02 -0500 | [diff] [blame^] | 35 | start_nop_trace(tr); |
Steven Noonan | fb1b6d8 | 2008-09-19 03:06:43 -0700 | [diff] [blame] | 36 | } |
| 37 | |
| 38 | static void nop_trace_reset(struct trace_array *tr) |
| 39 | { |
Steven Rostedt | c76f069 | 2008-11-07 22:36:02 -0500 | [diff] [blame^] | 40 | stop_nop_trace(tr); |
Steven Noonan | fb1b6d8 | 2008-09-19 03:06:43 -0700 | [diff] [blame] | 41 | } |
| 42 | |
Frédéric Weisbecker | 43a1538 | 2008-09-21 20:16:30 +0200 | [diff] [blame] | 43 | struct tracer nop_trace __read_mostly = |
Steven Noonan | fb1b6d8 | 2008-09-19 03:06:43 -0700 | [diff] [blame] | 44 | { |
| 45 | .name = "nop", |
| 46 | .init = nop_trace_init, |
| 47 | .reset = nop_trace_reset, |
Steven Noonan | fb1b6d8 | 2008-09-19 03:06:43 -0700 | [diff] [blame] | 48 | #ifdef CONFIG_FTRACE_SELFTEST |
| 49 | .selftest = trace_selftest_startup_nop, |
| 50 | #endif |
| 51 | }; |
| 52 | |