diff options
author | David Woodhouse <David.Woodhouse@intel.com> | 2008-10-21 14:42:20 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2008-10-21 14:42:20 -0400 |
commit | b876d08f816527af257e13d89fb0d3b4b849223c (patch) | |
tree | 40569f568230f918ca55f04b355e251747f913ed /kernel/trace/trace_nop.c | |
parent | b364776ad1208a71f0c53578c84619a395412a8d (diff) | |
parent | 2515ddc6db8eb49a79f0fe5e67ff09ac7c81eab4 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts:
drivers/pci/dmar.c
Diffstat (limited to 'kernel/trace/trace_nop.c')
-rw-r--r-- | kernel/trace/trace_nop.c | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/kernel/trace/trace_nop.c b/kernel/trace/trace_nop.c new file mode 100644 index 000000000000..4592b4862515 --- /dev/null +++ b/kernel/trace/trace_nop.c | |||
@@ -0,0 +1,64 @@ | |||
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 | { | ||
29 | int cpu; | ||
30 | ctx_trace = tr; | ||
31 | |||
32 | for_each_online_cpu(cpu) | ||
33 | tracing_reset(tr, cpu); | ||
34 | |||
35 | if (tr->ctrl) | ||
36 | start_nop_trace(tr); | ||
37 | } | ||
38 | |||
39 | static void nop_trace_reset(struct trace_array *tr) | ||
40 | { | ||
41 | if (tr->ctrl) | ||
42 | stop_nop_trace(tr); | ||
43 | } | ||
44 | |||
45 | static void nop_trace_ctrl_update(struct trace_array *tr) | ||
46 | { | ||
47 | /* When starting a new trace, reset the buffers */ | ||
48 | if (tr->ctrl) | ||
49 | start_nop_trace(tr); | ||
50 | else | ||
51 | stop_nop_trace(tr); | ||
52 | } | ||
53 | |||
54 | struct tracer nop_trace __read_mostly = | ||
55 | { | ||
56 | .name = "nop", | ||
57 | .init = nop_trace_init, | ||
58 | .reset = nop_trace_reset, | ||
59 | .ctrl_update = nop_trace_ctrl_update, | ||
60 | #ifdef CONFIG_FTRACE_SELFTEST | ||
61 | .selftest = trace_selftest_startup_nop, | ||
62 | #endif | ||
63 | }; | ||
64 | |||