aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ftrace_event.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/ftrace_event.h')
-rw-r--r--include/linux/ftrace_event.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index 2233c98d80df..cd95919d9ff3 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -5,6 +5,7 @@
5#include <linux/trace_seq.h> 5#include <linux/trace_seq.h>
6#include <linux/percpu.h> 6#include <linux/percpu.h>
7#include <linux/hardirq.h> 7#include <linux/hardirq.h>
8#include <linux/perf_event.h>
8 9
9struct trace_array; 10struct trace_array;
10struct tracer; 11struct tracer;
@@ -138,9 +139,6 @@ struct ftrace_event_call {
138 139
139#define FTRACE_MAX_PROFILE_SIZE 2048 140#define FTRACE_MAX_PROFILE_SIZE 2048
140 141
141extern char *perf_trace_buf;
142extern char *perf_trace_buf_nmi;
143
144#define MAX_FILTER_PRED 32 142#define MAX_FILTER_PRED 32
145#define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */ 143#define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */
146 144
@@ -188,13 +186,27 @@ do { \
188 __trace_printk(ip, fmt, ##args); \ 186 __trace_printk(ip, fmt, ##args); \
189} while (0) 187} while (0)
190 188
191#ifdef CONFIG_EVENT_PROFILE 189#ifdef CONFIG_PERF_EVENTS
192struct perf_event; 190struct perf_event;
193extern int ftrace_profile_enable(int event_id); 191extern int ftrace_profile_enable(int event_id);
194extern void ftrace_profile_disable(int event_id); 192extern void ftrace_profile_disable(int event_id);
195extern int ftrace_profile_set_filter(struct perf_event *event, int event_id, 193extern int ftrace_profile_set_filter(struct perf_event *event, int event_id,
196 char *filter_str); 194 char *filter_str);
197extern void ftrace_profile_free_filter(struct perf_event *event); 195extern void ftrace_profile_free_filter(struct perf_event *event);
196extern void *
197ftrace_perf_buf_prepare(int size, unsigned short type, int *rctxp,
198 unsigned long *irq_flags);
199
200static inline void
201ftrace_perf_buf_submit(void *raw_data, int size, int rctx, u64 addr,
202 u64 count, unsigned long irq_flags)
203{
204 struct trace_entry *entry = raw_data;
205
206 perf_tp_event(entry->type, addr, count, raw_data, size);
207 perf_swevent_put_recursion_context(rctx);
208 local_irq_restore(irq_flags);
209}
198#endif 210#endif
199 211
200#endif /* _LINUX_FTRACE_EVENT_H */ 212#endif /* _LINUX_FTRACE_EVENT_H */