summaryrefslogtreecommitdiffstats
path: root/include/linux/ftrace_event.h
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2009-08-07 10:33:43 +0800
committerSteven Rostedt <rostedt@goodmis.org>2009-08-26 00:32:07 -0400
commit87a342f5db69d53ea70493bb1ec69c9047677038 (patch)
tree89ec97b3a32d6508d10f1598201e48a24c08c46e /include/linux/ftrace_event.h
parent43b51ead3f752a3935116e5b1a94254b8573734f (diff)
downloadlinux-87a342f5db69d53ea70493bb1ec69c9047677038.tar.gz
linux-87a342f5db69d53ea70493bb1ec69c9047677038.tar.bz2
linux-87a342f5db69d53ea70493bb1ec69c9047677038.zip
tracing/filters: Support filtering for char * strings
Usually, char * entries are dangerous in traces because the string can be released whereas a pointer to it can still wait to be read from the ring buffer. But sometimes we can assume it's safe, like in case of RO data (eg: __file__ or __line__, used in bkl trace event). If these RO data are in a module and so is the call to the trace event, then it's safe, because the ring buffer will be flushed once this module get unloaded. To allow char * to be treated as a string: TRACE_EVENT(..., TP_STRUCT__entry( __field_ext(const char *, name, FILTER_PTR_STRING) ... ) ... ); The filtering will not dereference "char *" unless the developer explicitly sets FILTER_PTR_STR in __field_ext. Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> LKML-Reference: <4A7B9287.90205@cn.fujitsu.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'include/linux/ftrace_event.h')
-rw-r--r--include/linux/ftrace_event.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index 0440bea8f6bb..ace2da9e0a0d 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -144,6 +144,7 @@ enum {
FILTER_OTHER = 0,
FILTER_STATIC_STRING,
FILTER_DYN_STRING,
+ FILTER_PTR_STRING,
};
extern int trace_define_field(struct ftrace_event_call *call,