-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A no-op tracer which can serve two purposes: 1. A template for development of a new tracer. 2. A convenient way to see ftrace_printk() calls without an irrelevant trace making the output messy. [ mingo@elte.hu: resolved conflicts ] Signed-off-by: Steven Noonan <steven@uplinklabs.net> Signed-off-by: Ingo Molnar <mingo@elte.hu>
- Loading branch information
Steven Noonan
authored and
Ingo Molnar
committed
Oct 14, 2008
1 parent
5bf9a1e
commit fb1b6d8
Showing
5 changed files
with
89 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* nop tracer | ||
* | ||
* Copyright (C) 2008 Steven Noonan <steven@uplinklabs.net> | ||
* | ||
*/ | ||
|
||
#include <linux/module.h> | ||
#include <linux/fs.h> | ||
#include <linux/debugfs.h> | ||
#include <linux/ftrace.h> | ||
|
||
#include "trace.h" | ||
|
||
static struct trace_array *ctx_trace; | ||
|
||
static void start_nop_trace(struct trace_array *tr) | ||
{ | ||
/* Nothing to do! */ | ||
} | ||
|
||
static void stop_nop_trace(struct trace_array *tr) | ||
{ | ||
/* Nothing to do! */ | ||
} | ||
|
||
static void nop_trace_init(struct trace_array *tr) | ||
{ | ||
ctx_trace = tr; | ||
|
||
if (tr->ctrl) | ||
start_nop_trace(tr); | ||
} | ||
|
||
static void nop_trace_reset(struct trace_array *tr) | ||
{ | ||
if (tr->ctrl) | ||
stop_nop_trace(tr); | ||
} | ||
|
||
static void nop_trace_ctrl_update(struct trace_array *tr) | ||
{ | ||
/* When starting a new trace, reset the buffers */ | ||
if (tr->ctrl) | ||
start_nop_trace(tr); | ||
else | ||
stop_nop_trace(tr); | ||
} | ||
|
||
static struct tracer nop_trace __read_mostly = | ||
{ | ||
.name = "nop", | ||
.init = nop_trace_init, | ||
.reset = nop_trace_reset, | ||
.ctrl_update = nop_trace_ctrl_update, | ||
#ifdef CONFIG_FTRACE_SELFTEST | ||
.selftest = trace_selftest_startup_nop, | ||
#endif | ||
}; | ||
|
||
__init static int init_nop_trace(void) | ||
{ | ||
return register_tracer(&nop_trace); | ||
} | ||
device_initcall(init_nop_trace); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters