tracing/profile: Add filter support
[cascardo/linux.git] / include / linux / ftrace_event.h
index bd099ba..d117704 100644 (file)
@@ -4,6 +4,7 @@
 #include <linux/ring_buffer.h>
 #include <linux/trace_seq.h>
 #include <linux/percpu.h>
+#include <linux/hardirq.h>
 
 struct trace_array;
 struct tracer;
@@ -130,15 +131,20 @@ struct ftrace_event_call {
        void                    *data;
 
        atomic_t                profile_count;
-       int                     (*profile_enable)(struct ftrace_event_call *);
-       void                    (*profile_disable)(struct ftrace_event_call *);
+       int                     (*profile_enable)(void);
+       void                    (*profile_disable)(void);
 };
 
+#define FTRACE_MAX_PROFILE_SIZE        2048
+
+extern char                    *trace_profile_buf;
+extern char                    *trace_profile_buf_nmi;
+
 #define MAX_FILTER_PRED                32
 #define MAX_FILTER_STR_VAL     256     /* Should handle KSYM_SYMBOL_LEN */
 
 extern void destroy_preds(struct ftrace_event_call *call);
-extern int filter_match_preds(struct ftrace_event_call *call, void *rec);
+extern int filter_match_preds(struct event_filter *filter, void *rec);
 extern int filter_current_check_discard(struct ring_buffer *buffer,
                                        struct ftrace_event_call *call,
                                        void *rec,
@@ -180,4 +186,13 @@ do {                                                                       \
                __trace_printk(ip, fmt, ##args);                        \
 } while (0)
 
+#ifdef CONFIG_EVENT_PROFILE
+struct perf_event;
+extern int ftrace_profile_enable(int event_id);
+extern void ftrace_profile_disable(int event_id);
+extern int ftrace_profile_set_filter(struct perf_event *event, int event_id,
+                                    char *filter_str);
+extern void ftrace_profile_free_filter(struct perf_event *event);
+#endif
+
 #endif /* _LINUX_FTRACE_EVENT_H */