blob: 0e77415caed3eb2ed890950f2d3cacaa537c0de4 [file] [log] [blame]
Steven Noonanfb1b6d82008-09-19 03:06:43 -07001/*
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
15static struct trace_array *ctx_trace;
16
17static void start_nop_trace(struct trace_array *tr)
18{
19 /* Nothing to do! */
20}
21
22static void stop_nop_trace(struct trace_array *tr)
23{
24 /* Nothing to do! */
25}
26
Frederic Weisbecker1c800252008-11-16 05:57:26 +010027static int nop_trace_init(struct trace_array *tr)
Steven Noonanfb1b6d82008-09-19 03:06:43 -070028{
Frédéric Weisbecker35cb5ed2008-09-21 20:10:14 +020029 int cpu;
Steven Noonanfb1b6d82008-09-19 03:06:43 -070030 ctx_trace = tr;
31
Frédéric Weisbecker35cb5ed2008-09-21 20:10:14 +020032 for_each_online_cpu(cpu)
Steven Rostedt3928a8a2008-09-29 23:02:41 -040033 tracing_reset(tr, cpu);
Frédéric Weisbecker35cb5ed2008-09-21 20:10:14 +020034
Steven Rostedtc76f0692008-11-07 22:36:02 -050035 start_nop_trace(tr);
Frederic Weisbecker1c800252008-11-16 05:57:26 +010036 return 0;
Steven Noonanfb1b6d82008-09-19 03:06:43 -070037}
38
39static void nop_trace_reset(struct trace_array *tr)
40{
Steven Rostedtc76f0692008-11-07 22:36:02 -050041 stop_nop_trace(tr);
Steven Noonanfb1b6d82008-09-19 03:06:43 -070042}
43
Frédéric Weisbecker43a15382008-09-21 20:16:30 +020044struct tracer nop_trace __read_mostly =
Steven Noonanfb1b6d82008-09-19 03:06:43 -070045{
46 .name = "nop",
47 .init = nop_trace_init,
48 .reset = nop_trace_reset,
Steven Noonanfb1b6d82008-09-19 03:06:43 -070049#ifdef CONFIG_FTRACE_SELFTEST
50 .selftest = trace_selftest_startup_nop,
51#endif
52};
53