aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/ftrace.c
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2008-05-12 15:20:45 -0400
committerThomas Gleixner <tglx@linutronix.de>2008-05-23 14:41:06 -0400
commit77a2b37d227483fe52aead242652aee406c25bf0 (patch)
treececb6a3a02a567530e2ce3502de18f371c9db7c1 /kernel/trace/ftrace.c
parent7bd2f24c2f769e3f8f1d4fc8b9fddf689825f6a7 (diff)
ftrace: startup tester on dynamic tracing.
This patch adds a startup self test on dynamic code modification and filters. The test filters on a specific function, makes sure that no other function is traced, exectutes the function, then makes sure that the function is traced. This patch also fixes a slight bug with the ftrace selftest, where tracer_enabled was not being set. Signed-off-by: Steven Rostedt <srostedt@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/trace/ftrace.c')
-rw-r--r--kernel/trace/ftrace.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 6d4d2e86debc..5e9389faaf75 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -1010,6 +1010,25 @@ ftrace_filter_write(struct file *file, const char __user *ubuf,
1010 return ret; 1010 return ret;
1011} 1011}
1012 1012
1013/**
1014 * ftrace_set_filter - set a function to filter on in ftrace
1015 * @buf - the string that holds the function filter text.
1016 * @len - the length of the string.
1017 * @reset - non zero to reset all filters before applying this filter.
1018 *
1019 * Filters denote which functions should be enabled when tracing is enabled.
1020 * If @buf is NULL and reset is set, all functions will be enabled for tracing.
1021 */
1022notrace void ftrace_set_filter(unsigned char *buf, int len, int reset)
1023{
1024 mutex_lock(&ftrace_filter_lock);
1025 if (reset)
1026 ftrace_filter_reset();
1027 if (buf)
1028 ftrace_match(buf, len);
1029 mutex_unlock(&ftrace_filter_lock);
1030}
1031
1013static int notrace 1032static int notrace
1014ftrace_filter_release(struct inode *inode, struct file *file) 1033ftrace_filter_release(struct inode *inode, struct file *file)
1015{ 1034{