diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-10 22:53:40 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-10 22:53:40 -0400 |
commit | 862366118026a358882eefc70238dbcc3db37aac (patch) | |
tree | 4eb62bc10327a5afac064a95a091ea05ecd2acc1 /include | |
parent | 57eee9ae7bbcfb692dc96c739a5184adb6349733 (diff) | |
parent | 511b01bdf64ad8a38414096eab283c7784aebfc4 (diff) |
Merge branch 'tracing-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'tracing-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (244 commits)
Revert "x86, bts: reenable ptrace branch trace support"
tracing: do not translate event helper macros in print format
ftrace/documentation: fix typo in function grapher name
tracing/events: convert block trace points to TRACE_EVENT(), fix !CONFIG_BLOCK
tracing: add protection around module events unload
tracing: add trace_seq_vprint interface
tracing: fix the block trace points print size
tracing/events: convert block trace points to TRACE_EVENT()
ring-buffer: fix ret in rb_add_time_stamp
ring-buffer: pass in lockdep class key for reader_lock
tracing: add annotation to what type of stack trace is recorded
tracing: fix multiple use of __print_flags and __print_symbolic
tracing/events: fix output format of user stack
tracing/events: fix output format of kernel stack
tracing/trace_stack: fix the number of entries in the header
ring-buffer: discard timestamps that are at the start of the buffer
ring-buffer: try to discard unneeded timestamps
ring-buffer: fix bug in ring_buffer_discard_commit
ftrace: do not profile functions when disabled
tracing: make trace pipe recognize latency format flag
...
Diffstat (limited to 'include')
36 files changed, 2213 insertions, 379 deletions
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 89853bcd27a6..f1736ca7922c 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h | |||
@@ -63,7 +63,7 @@ | |||
63 | #define BRANCH_PROFILE() | 63 | #define BRANCH_PROFILE() |
64 | #endif | 64 | #endif |
65 | 65 | ||
66 | #ifdef CONFIG_EVENT_TRACER | 66 | #ifdef CONFIG_EVENT_TRACING |
67 | #define FTRACE_EVENTS() VMLINUX_SYMBOL(__start_ftrace_events) = .; \ | 67 | #define FTRACE_EVENTS() VMLINUX_SYMBOL(__start_ftrace_events) = .; \ |
68 | *(_ftrace_events) \ | 68 | *(_ftrace_events) \ |
69 | VMLINUX_SYMBOL(__stop_ftrace_events) = .; | 69 | VMLINUX_SYMBOL(__stop_ftrace_events) = .; |
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h index d960889e92ef..7e4350ece0f8 100644 --- a/include/linux/blktrace_api.h +++ b/include/linux/blktrace_api.h | |||
@@ -116,9 +116,9 @@ struct blk_io_trace { | |||
116 | * The remap event | 116 | * The remap event |
117 | */ | 117 | */ |
118 | struct blk_io_trace_remap { | 118 | struct blk_io_trace_remap { |
119 | __be32 device; | ||
120 | __be32 device_from; | 119 | __be32 device_from; |
121 | __be64 sector; | 120 | __be32 device_to; |
121 | __be64 sector_from; | ||
122 | }; | 122 | }; |
123 | 123 | ||
124 | enum { | 124 | enum { |
@@ -165,8 +165,9 @@ struct blk_trace { | |||
165 | 165 | ||
166 | extern int blk_trace_ioctl(struct block_device *, unsigned, char __user *); | 166 | extern int blk_trace_ioctl(struct block_device *, unsigned, char __user *); |
167 | extern void blk_trace_shutdown(struct request_queue *); | 167 | extern void blk_trace_shutdown(struct request_queue *); |
168 | extern int do_blk_trace_setup(struct request_queue *q, | 168 | extern int do_blk_trace_setup(struct request_queue *q, char *name, |
169 | char *name, dev_t dev, struct blk_user_trace_setup *buts); | 169 | dev_t dev, struct block_device *bdev, |
170 | struct blk_user_trace_setup *buts); | ||
170 | extern void __trace_note_message(struct blk_trace *, const char *fmt, ...); | 171 | extern void __trace_note_message(struct blk_trace *, const char *fmt, ...); |
171 | 172 | ||
172 | /** | 173 | /** |
@@ -193,22 +194,42 @@ extern void __trace_note_message(struct blk_trace *, const char *fmt, ...); | |||
193 | extern void blk_add_driver_data(struct request_queue *q, struct request *rq, | 194 | extern void blk_add_driver_data(struct request_queue *q, struct request *rq, |
194 | void *data, size_t len); | 195 | void *data, size_t len); |
195 | extern int blk_trace_setup(struct request_queue *q, char *name, dev_t dev, | 196 | extern int blk_trace_setup(struct request_queue *q, char *name, dev_t dev, |
197 | struct block_device *bdev, | ||
196 | char __user *arg); | 198 | char __user *arg); |
197 | extern int blk_trace_startstop(struct request_queue *q, int start); | 199 | extern int blk_trace_startstop(struct request_queue *q, int start); |
198 | extern int blk_trace_remove(struct request_queue *q); | 200 | extern int blk_trace_remove(struct request_queue *q); |
201 | extern int blk_trace_init_sysfs(struct device *dev); | ||
199 | 202 | ||
200 | extern struct attribute_group blk_trace_attr_group; | 203 | extern struct attribute_group blk_trace_attr_group; |
201 | 204 | ||
202 | #else /* !CONFIG_BLK_DEV_IO_TRACE */ | 205 | #else /* !CONFIG_BLK_DEV_IO_TRACE */ |
203 | #define blk_trace_ioctl(bdev, cmd, arg) (-ENOTTY) | 206 | # define blk_trace_ioctl(bdev, cmd, arg) (-ENOTTY) |
204 | #define blk_trace_shutdown(q) do { } while (0) | 207 | # define blk_trace_shutdown(q) do { } while (0) |
205 | #define do_blk_trace_setup(q, name, dev, buts) (-ENOTTY) | 208 | # define do_blk_trace_setup(q, name, dev, bdev, buts) (-ENOTTY) |
206 | #define blk_add_driver_data(q, rq, data, len) do {} while (0) | 209 | # define blk_add_driver_data(q, rq, data, len) do {} while (0) |
207 | #define blk_trace_setup(q, name, dev, arg) (-ENOTTY) | 210 | # define blk_trace_setup(q, name, dev, bdev, arg) (-ENOTTY) |
208 | #define blk_trace_startstop(q, start) (-ENOTTY) | 211 | # define blk_trace_startstop(q, start) (-ENOTTY) |
209 | #define blk_trace_remove(q) (-ENOTTY) | 212 | # define blk_trace_remove(q) (-ENOTTY) |
210 | #define blk_add_trace_msg(q, fmt, ...) do { } while (0) | 213 | # define blk_add_trace_msg(q, fmt, ...) do { } while (0) |
214 | static inline int blk_trace_init_sysfs(struct device *dev) | ||
215 | { | ||
216 | return 0; | ||
217 | } | ||
211 | 218 | ||
212 | #endif /* CONFIG_BLK_DEV_IO_TRACE */ | 219 | #endif /* CONFIG_BLK_DEV_IO_TRACE */ |
220 | |||
221 | #if defined(CONFIG_EVENT_TRACING) && defined(CONFIG_BLOCK) | ||
222 | |||
223 | static inline int blk_cmd_buf_len(struct request *rq) | ||
224 | { | ||
225 | return blk_pc_request(rq) ? rq->cmd_len * 3 : 1; | ||
226 | } | ||
227 | |||
228 | extern void blk_dump_cmd(char *buf, struct request *rq); | ||
229 | extern void blk_fill_rwbs(char *rwbs, u32 rw, int bytes); | ||
230 | extern void blk_fill_rwbs_rq(char *rwbs, struct request *rq); | ||
231 | |||
232 | #endif /* CONFIG_EVENT_TRACING && CONFIG_BLOCK */ | ||
233 | |||
213 | #endif /* __KERNEL__ */ | 234 | #endif /* __KERNEL__ */ |
214 | #endif | 235 | #endif |
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 8a0c2f221e6b..39b95c56587e 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
@@ -233,8 +233,6 @@ extern int ftrace_arch_read_dyn_info(char *buf, int size); | |||
233 | 233 | ||
234 | extern int skip_trace(unsigned long ip); | 234 | extern int skip_trace(unsigned long ip); |
235 | 235 | ||
236 | extern void ftrace_release(void *start, unsigned long size); | ||
237 | |||
238 | extern void ftrace_disable_daemon(void); | 236 | extern void ftrace_disable_daemon(void); |
239 | extern void ftrace_enable_daemon(void); | 237 | extern void ftrace_enable_daemon(void); |
240 | #else | 238 | #else |
@@ -325,13 +323,8 @@ static inline void __ftrace_enabled_restore(int enabled) | |||
325 | 323 | ||
326 | #ifdef CONFIG_FTRACE_MCOUNT_RECORD | 324 | #ifdef CONFIG_FTRACE_MCOUNT_RECORD |
327 | extern void ftrace_init(void); | 325 | extern void ftrace_init(void); |
328 | extern void ftrace_init_module(struct module *mod, | ||
329 | unsigned long *start, unsigned long *end); | ||
330 | #else | 326 | #else |
331 | static inline void ftrace_init(void) { } | 327 | static inline void ftrace_init(void) { } |
332 | static inline void | ||
333 | ftrace_init_module(struct module *mod, | ||
334 | unsigned long *start, unsigned long *end) { } | ||
335 | #endif | 328 | #endif |
336 | 329 | ||
337 | /* | 330 | /* |
@@ -368,6 +361,7 @@ struct ftrace_ret_stack { | |||
368 | unsigned long ret; | 361 | unsigned long ret; |
369 | unsigned long func; | 362 | unsigned long func; |
370 | unsigned long long calltime; | 363 | unsigned long long calltime; |
364 | unsigned long long subtime; | ||
371 | }; | 365 | }; |
372 | 366 | ||
373 | /* | 367 | /* |
@@ -379,8 +373,6 @@ extern void return_to_handler(void); | |||
379 | 373 | ||
380 | extern int | 374 | extern int |
381 | ftrace_push_return_trace(unsigned long ret, unsigned long func, int *depth); | 375 | ftrace_push_return_trace(unsigned long ret, unsigned long func, int *depth); |
382 | extern void | ||
383 | ftrace_pop_return_trace(struct ftrace_graph_ret *trace, unsigned long *ret); | ||
384 | 376 | ||
385 | /* | 377 | /* |
386 | * Sometimes we don't want to trace a function with the function | 378 | * Sometimes we don't want to trace a function with the function |
@@ -496,8 +488,15 @@ static inline int test_tsk_trace_graph(struct task_struct *tsk) | |||
496 | 488 | ||
497 | extern int ftrace_dump_on_oops; | 489 | extern int ftrace_dump_on_oops; |
498 | 490 | ||
491 | #ifdef CONFIG_PREEMPT | ||
492 | #define INIT_TRACE_RECURSION .trace_recursion = 0, | ||
493 | #endif | ||
494 | |||
499 | #endif /* CONFIG_TRACING */ | 495 | #endif /* CONFIG_TRACING */ |
500 | 496 | ||
497 | #ifndef INIT_TRACE_RECURSION | ||
498 | #define INIT_TRACE_RECURSION | ||
499 | #endif | ||
501 | 500 | ||
502 | #ifdef CONFIG_HW_BRANCH_TRACER | 501 | #ifdef CONFIG_HW_BRANCH_TRACER |
503 | 502 | ||
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h new file mode 100644 index 000000000000..5c093ffc655b --- /dev/null +++ b/include/linux/ftrace_event.h | |||
@@ -0,0 +1,172 @@ | |||
1 | #ifndef _LINUX_FTRACE_EVENT_H | ||
2 | #define _LINUX_FTRACE_EVENT_H | ||
3 | |||
4 | #include <linux/trace_seq.h> | ||
5 | #include <linux/ring_buffer.h> | ||
6 | #include <linux/percpu.h> | ||
7 | |||
8 | struct trace_array; | ||
9 | struct tracer; | ||
10 | struct dentry; | ||
11 | |||
12 | DECLARE_PER_CPU(struct trace_seq, ftrace_event_seq); | ||
13 | |||
14 | struct trace_print_flags { | ||
15 | unsigned long mask; | ||
16 | const char *name; | ||
17 | }; | ||
18 | |||
19 | const char *ftrace_print_flags_seq(struct trace_seq *p, const char *delim, | ||
20 | unsigned long flags, | ||
21 | const struct trace_print_flags *flag_array); | ||
22 | |||
23 | const char *ftrace_print_symbols_seq(struct trace_seq *p, unsigned long val, | ||
24 | const struct trace_print_flags *symbol_array); | ||
25 | |||
26 | /* | ||
27 | * The trace entry - the most basic unit of tracing. This is what | ||
28 | * is printed in the end as a single line in the trace output, such as: | ||
29 | * | ||
30 | * bash-15816 [01] 235.197585: idle_cpu <- irq_enter | ||
31 | */ | ||
32 | struct trace_entry { | ||
33 | unsigned short type; | ||
34 | unsigned char flags; | ||
35 | unsigned char preempt_count; | ||
36 | int pid; | ||
37 | int tgid; | ||
38 | }; | ||
39 | |||
40 | #define FTRACE_MAX_EVENT \ | ||
41 | ((1 << (sizeof(((struct trace_entry *)0)->type) * 8)) - 1) | ||
42 | |||
43 | /* | ||
44 | * Trace iterator - used by printout routines who present trace | ||
45 | * results to users and which routines might sleep, etc: | ||
46 | */ | ||
47 | struct trace_iterator { | ||
48 | struct trace_array *tr; | ||
49 | struct tracer *trace; | ||
50 | void *private; | ||
51 | int cpu_file; | ||
52 | struct mutex mutex; | ||
53 | struct ring_buffer_iter *buffer_iter[NR_CPUS]; | ||
54 | unsigned long iter_flags; | ||
55 | |||
56 | /* The below is zeroed out in pipe_read */ | ||
57 | struct trace_seq seq; | ||
58 | struct trace_entry *ent; | ||
59 | int cpu; | ||
60 | u64 ts; | ||
61 | |||
62 | loff_t pos; | ||
63 | long idx; | ||
64 | |||
65 | cpumask_var_t started; | ||
66 | }; | ||
67 | |||
68 | |||
69 | typedef enum print_line_t (*trace_print_func)(struct trace_iterator *iter, | ||
70 | int flags); | ||
71 | struct trace_event { | ||
72 | struct hlist_node node; | ||
73 | struct list_head list; | ||
74 | int type; | ||
75 | trace_print_func trace; | ||
76 | trace_print_func raw; | ||
77 | trace_print_func hex; | ||
78 | trace_print_func binary; | ||
79 | }; | ||
80 | |||
81 | extern int register_ftrace_event(struct trace_event *event); | ||
82 | extern int unregister_ftrace_event(struct trace_event *event); | ||
83 | |||
84 | /* Return values for print_line callback */ | ||
85 | enum print_line_t { | ||
86 | TRACE_TYPE_PARTIAL_LINE = 0, /* Retry after flushing the seq */ | ||
87 | TRACE_TYPE_HANDLED = 1, | ||
88 | TRACE_TYPE_UNHANDLED = 2, /* Relay to other output functions */ | ||
89 | TRACE_TYPE_NO_CONSUME = 3 /* Handled but ask to not consume */ | ||
90 | }; | ||
91 | |||
92 | |||
93 | struct ring_buffer_event * | ||
94 | trace_current_buffer_lock_reserve(int type, unsigned long len, | ||
95 | unsigned long flags, int pc); | ||
96 | void trace_current_buffer_unlock_commit(struct ring_buffer_event *event, | ||
97 | unsigned long flags, int pc); | ||
98 | void trace_nowake_buffer_unlock_commit(struct ring_buffer_event *event, | ||
99 | unsigned long flags, int pc); | ||
100 | void trace_current_buffer_discard_commit(struct ring_buffer_event *event); | ||
101 | |||
102 | void tracing_record_cmdline(struct task_struct *tsk); | ||
103 | |||
104 | struct ftrace_event_call { | ||
105 | struct list_head list; | ||
106 | char *name; | ||
107 | char *system; | ||
108 | struct dentry *dir; | ||
109 | struct trace_event *event; | ||
110 | int enabled; | ||
111 | int (*regfunc)(void); | ||
112 | void (*unregfunc)(void); | ||
113 | int id; | ||
114 | int (*raw_init)(void); | ||
115 | int (*show_format)(struct trace_seq *s); | ||
116 | int (*define_fields)(void); | ||
117 | struct list_head fields; | ||
118 | int filter_active; | ||
119 | void *filter; | ||
120 | void *mod; | ||
121 | |||
122 | #ifdef CONFIG_EVENT_PROFILE | ||
123 | atomic_t profile_count; | ||
124 | int (*profile_enable)(struct ftrace_event_call *); | ||
125 | void (*profile_disable)(struct ftrace_event_call *); | ||
126 | #endif | ||
127 | }; | ||
128 | |||
129 | #define MAX_FILTER_PRED 32 | ||
130 | #define MAX_FILTER_STR_VAL 128 | ||
131 | |||
132 | extern int init_preds(struct ftrace_event_call *call); | ||
133 | extern void destroy_preds(struct ftrace_event_call *call); | ||
134 | extern int filter_match_preds(struct ftrace_event_call *call, void *rec); | ||
135 | extern int filter_current_check_discard(struct ftrace_event_call *call, | ||
136 | void *rec, | ||
137 | struct ring_buffer_event *event); | ||
138 | |||
139 | extern int trace_define_field(struct ftrace_event_call *call, char *type, | ||
140 | char *name, int offset, int size, int is_signed); | ||
141 | |||
142 | #define is_signed_type(type) (((type)(-1)) < 0) | ||
143 | |||
144 | int trace_set_clr_event(const char *system, const char *event, int set); | ||
145 | |||
146 | /* | ||
147 | * The double __builtin_constant_p is because gcc will give us an error | ||
148 | * if we try to allocate the static variable to fmt if it is not a | ||
149 | * constant. Even with the outer if statement optimizing out. | ||
150 | */ | ||
151 | #define event_trace_printk(ip, fmt, args...) \ | ||
152 | do { \ | ||
153 | __trace_printk_check_format(fmt, ##args); \ | ||
154 | tracing_record_cmdline(current); \ | ||
155 | if (__builtin_constant_p(fmt)) { \ | ||
156 | static const char *trace_printk_fmt \ | ||
157 | __attribute__((section("__trace_printk_fmt"))) = \ | ||
158 | __builtin_constant_p(fmt) ? fmt : NULL; \ | ||
159 | \ | ||
160 | __trace_bprintk(ip, trace_printk_fmt, ##args); \ | ||
161 | } else \ | ||
162 | __trace_printk(ip, fmt, ##args); \ | ||
163 | } while (0) | ||
164 | |||
165 | #define __common_field(type, item, is_signed) \ | ||
166 | ret = trace_define_field(event_call, #type, "common_" #item, \ | ||
167 | offsetof(typeof(field.ent), item), \ | ||
168 | sizeof(field.ent.item), is_signed); \ | ||
169 | if (ret) \ | ||
170 | return ret; | ||
171 | |||
172 | #endif /* _LINUX_FTRACE_EVENT_H */ | ||
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index d87247d2641f..889bf99eca6d 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
@@ -174,6 +174,7 @@ extern struct cred init_cred; | |||
174 | INIT_TRACE_IRQFLAGS \ | 174 | INIT_TRACE_IRQFLAGS \ |
175 | INIT_LOCKDEP \ | 175 | INIT_LOCKDEP \ |
176 | INIT_FTRACE_GRAPH \ | 176 | INIT_FTRACE_GRAPH \ |
177 | INIT_TRACE_RECURSION \ | ||
177 | } | 178 | } |
178 | 179 | ||
179 | 180 | ||
diff --git a/include/linux/kmemtrace.h b/include/linux/kmemtrace.h new file mode 100644 index 000000000000..b616d3930c3b --- /dev/null +++ b/include/linux/kmemtrace.h | |||
@@ -0,0 +1,25 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2008 Eduard - Gabriel Munteanu | ||
3 | * | ||
4 | * This file is released under GPL version 2. | ||
5 | */ | ||
6 | |||
7 | #ifndef _LINUX_KMEMTRACE_H | ||
8 | #define _LINUX_KMEMTRACE_H | ||
9 | |||
10 | #ifdef __KERNEL__ | ||
11 | |||
12 | #include <trace/events/kmem.h> | ||
13 | |||
14 | #ifdef CONFIG_KMEMTRACE | ||
15 | extern void kmemtrace_init(void); | ||
16 | #else | ||
17 | static inline void kmemtrace_init(void) | ||
18 | { | ||
19 | } | ||
20 | #endif | ||
21 | |||
22 | #endif /* __KERNEL__ */ | ||
23 | |||
24 | #endif /* _LINUX_KMEMTRACE_H */ | ||
25 | |||
diff --git a/include/linux/mm.h b/include/linux/mm.h index 511b09867096..9772d6cbfc82 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -19,6 +19,7 @@ struct anon_vma; | |||
19 | struct file_ra_state; | 19 | struct file_ra_state; |
20 | struct user_struct; | 20 | struct user_struct; |
21 | struct writeback_control; | 21 | struct writeback_control; |
22 | struct rlimit; | ||
22 | 23 | ||
23 | #ifndef CONFIG_DISCONTIGMEM /* Don't use mapnrs, do it properly */ | 24 | #ifndef CONFIG_DISCONTIGMEM /* Don't use mapnrs, do it properly */ |
24 | extern unsigned long max_mapnr; | 25 | extern unsigned long max_mapnr; |
@@ -1317,8 +1318,8 @@ int vmemmap_populate_basepages(struct page *start_page, | |||
1317 | int vmemmap_populate(struct page *start_page, unsigned long pages, int node); | 1318 | int vmemmap_populate(struct page *start_page, unsigned long pages, int node); |
1318 | void vmemmap_populate_print_last(void); | 1319 | void vmemmap_populate_print_last(void); |
1319 | 1320 | ||
1320 | extern void *alloc_locked_buffer(size_t size); | 1321 | extern int account_locked_memory(struct mm_struct *mm, struct rlimit *rlim, |
1321 | extern void free_locked_buffer(void *buffer, size_t size); | 1322 | size_t size); |
1322 | extern void release_locked_buffer(void *buffer, size_t size); | 1323 | extern void refund_locked_memory(struct mm_struct *mm, size_t size); |
1323 | #endif /* __KERNEL__ */ | 1324 | #endif /* __KERNEL__ */ |
1324 | #endif /* _LINUX_MM_H */ | 1325 | #endif /* _LINUX_MM_H */ |
diff --git a/include/linux/mmiotrace.h b/include/linux/mmiotrace.h index 3d1b7bde1283..97491f78b08c 100644 --- a/include/linux/mmiotrace.h +++ b/include/linux/mmiotrace.h | |||
@@ -30,6 +30,8 @@ extern unsigned int kmmio_count; | |||
30 | 30 | ||
31 | extern int register_kmmio_probe(struct kmmio_probe *p); | 31 | extern int register_kmmio_probe(struct kmmio_probe *p); |
32 | extern void unregister_kmmio_probe(struct kmmio_probe *p); | 32 | extern void unregister_kmmio_probe(struct kmmio_probe *p); |
33 | extern int kmmio_init(void); | ||
34 | extern void kmmio_cleanup(void); | ||
33 | 35 | ||
34 | #ifdef CONFIG_MMIOTRACE | 36 | #ifdef CONFIG_MMIOTRACE |
35 | /* kmmio is active by some kmmio_probes? */ | 37 | /* kmmio is active by some kmmio_probes? */ |
diff --git a/include/linux/module.h b/include/linux/module.h index 627ac082e2a6..a8f2c0aa4c32 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -337,6 +337,14 @@ struct module | |||
337 | const char **trace_bprintk_fmt_start; | 337 | const char **trace_bprintk_fmt_start; |
338 | unsigned int num_trace_bprintk_fmt; | 338 | unsigned int num_trace_bprintk_fmt; |
339 | #endif | 339 | #endif |
340 | #ifdef CONFIG_EVENT_TRACING | ||
341 | struct ftrace_event_call *trace_events; | ||
342 | unsigned int num_trace_events; | ||
343 | #endif | ||
344 | #ifdef CONFIG_FTRACE_MCOUNT_RECORD | ||
345 | unsigned long *ftrace_callsites; | ||
346 | unsigned int num_ftrace_callsites; | ||
347 | #endif | ||
340 | 348 | ||
341 | #ifdef CONFIG_MODULE_UNLOAD | 349 | #ifdef CONFIG_MODULE_UNLOAD |
342 | /* What modules depend on me? */ | 350 | /* What modules depend on me? */ |
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index 67c15653fc23..59e133d39d50 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h | |||
@@ -95,7 +95,6 @@ extern void __ptrace_link(struct task_struct *child, | |||
95 | struct task_struct *new_parent); | 95 | struct task_struct *new_parent); |
96 | extern void __ptrace_unlink(struct task_struct *child); | 96 | extern void __ptrace_unlink(struct task_struct *child); |
97 | extern void exit_ptrace(struct task_struct *tracer); | 97 | extern void exit_ptrace(struct task_struct *tracer); |
98 | extern void ptrace_fork(struct task_struct *task, unsigned long clone_flags); | ||
99 | #define PTRACE_MODE_READ 1 | 98 | #define PTRACE_MODE_READ 1 |
100 | #define PTRACE_MODE_ATTACH 2 | 99 | #define PTRACE_MODE_ATTACH 2 |
101 | /* Returns 0 on success, -errno on denial. */ | 100 | /* Returns 0 on success, -errno on denial. */ |
@@ -327,15 +326,6 @@ static inline void user_enable_block_step(struct task_struct *task) | |||
327 | #define arch_ptrace_untrace(task) do { } while (0) | 326 | #define arch_ptrace_untrace(task) do { } while (0) |
328 | #endif | 327 | #endif |
329 | 328 | ||
330 | #ifndef arch_ptrace_fork | ||
331 | /* | ||
332 | * Do machine-specific work to initialize a new task. | ||
333 | * | ||
334 | * This is called from copy_process(). | ||
335 | */ | ||
336 | #define arch_ptrace_fork(child, clone_flags) do { } while (0) | ||
337 | #endif | ||
338 | |||
339 | extern int task_current_syscall(struct task_struct *target, long *callno, | 329 | extern int task_current_syscall(struct task_struct *target, long *callno, |
340 | unsigned long args[6], unsigned int maxargs, | 330 | unsigned long args[6], unsigned int maxargs, |
341 | unsigned long *sp, unsigned long *pc); | 331 | unsigned long *sp, unsigned long *pc); |
diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h index e1b7b2173885..8670f1575fe1 100644 --- a/include/linux/ring_buffer.h +++ b/include/linux/ring_buffer.h | |||
@@ -11,7 +11,7 @@ struct ring_buffer_iter; | |||
11 | * Don't refer to this struct directly, use functions below. | 11 | * Don't refer to this struct directly, use functions below. |
12 | */ | 12 | */ |
13 | struct ring_buffer_event { | 13 | struct ring_buffer_event { |
14 | u32 type:2, len:3, time_delta:27; | 14 | u32 type_len:5, time_delta:27; |
15 | u32 array[]; | 15 | u32 array[]; |
16 | }; | 16 | }; |
17 | 17 | ||
@@ -24,7 +24,8 @@ struct ring_buffer_event { | |||
24 | * size is variable depending on how much | 24 | * size is variable depending on how much |
25 | * padding is needed | 25 | * padding is needed |
26 | * If time_delta is non zero: | 26 | * If time_delta is non zero: |
27 | * everything else same as RINGBUF_TYPE_DATA | 27 | * array[0] holds the actual length |
28 | * size = 4 + length (bytes) | ||
28 | * | 29 | * |
29 | * @RINGBUF_TYPE_TIME_EXTEND: Extend the time delta | 30 | * @RINGBUF_TYPE_TIME_EXTEND: Extend the time delta |
30 | * array[0] = time delta (28 .. 59) | 31 | * array[0] = time delta (28 .. 59) |
@@ -35,22 +36,23 @@ struct ring_buffer_event { | |||
35 | * array[1..2] = tv_sec | 36 | * array[1..2] = tv_sec |
36 | * size = 16 bytes | 37 | * size = 16 bytes |
37 | * | 38 | * |
38 | * @RINGBUF_TYPE_DATA: Data record | 39 | * <= @RINGBUF_TYPE_DATA_TYPE_LEN_MAX: |
39 | * If len is zero: | 40 | * Data record |
41 | * If type_len is zero: | ||
40 | * array[0] holds the actual length | 42 | * array[0] holds the actual length |
41 | * array[1..(length+3)/4] holds data | 43 | * array[1..(length+3)/4] holds data |
42 | * size = 4 + 4 + length (bytes) | 44 | * size = 4 + length (bytes) |
43 | * else | 45 | * else |
44 | * length = len << 2 | 46 | * length = type_len << 2 |
45 | * array[0..(length+3)/4-1] holds data | 47 | * array[0..(length+3)/4-1] holds data |
46 | * size = 4 + length (bytes) | 48 | * size = 4 + length (bytes) |
47 | */ | 49 | */ |
48 | enum ring_buffer_type { | 50 | enum ring_buffer_type { |
51 | RINGBUF_TYPE_DATA_TYPE_LEN_MAX = 28, | ||
49 | RINGBUF_TYPE_PADDING, | 52 | RINGBUF_TYPE_PADDING, |
50 | RINGBUF_TYPE_TIME_EXTEND, | 53 | RINGBUF_TYPE_TIME_EXTEND, |
51 | /* FIXME: RINGBUF_TYPE_TIME_STAMP not implemented */ | 54 | /* FIXME: RINGBUF_TYPE_TIME_STAMP not implemented */ |
52 | RINGBUF_TYPE_TIME_STAMP, | 55 | RINGBUF_TYPE_TIME_STAMP, |
53 | RINGBUF_TYPE_DATA, | ||
54 | }; | 56 | }; |
55 | 57 | ||
56 | unsigned ring_buffer_event_length(struct ring_buffer_event *event); | 58 | unsigned ring_buffer_event_length(struct ring_buffer_event *event); |
@@ -68,13 +70,54 @@ ring_buffer_event_time_delta(struct ring_buffer_event *event) | |||
68 | return event->time_delta; | 70 | return event->time_delta; |
69 | } | 71 | } |
70 | 72 | ||
73 | /* | ||
74 | * ring_buffer_event_discard can discard any event in the ring buffer. | ||
75 | * it is up to the caller to protect against a reader from | ||
76 | * consuming it or a writer from wrapping and replacing it. | ||
77 | * | ||
78 | * No external protection is needed if this is called before | ||
79 | * the event is commited. But in that case it would be better to | ||
80 | * use ring_buffer_discard_commit. | ||
81 | * | ||
82 | * Note, if an event that has not been committed is discarded | ||
83 | * with ring_buffer_event_discard, it must still be committed. | ||
84 | */ | ||
71 | void ring_buffer_event_discard(struct ring_buffer_event *event); | 85 | void ring_buffer_event_discard(struct ring_buffer_event *event); |
72 | 86 | ||
73 | /* | 87 | /* |
88 | * ring_buffer_discard_commit will remove an event that has not | ||
89 | * ben committed yet. If this is used, then ring_buffer_unlock_commit | ||
90 | * must not be called on the discarded event. This function | ||
91 | * will try to remove the event from the ring buffer completely | ||
92 | * if another event has not been written after it. | ||
93 | * | ||
94 | * Example use: | ||
95 | * | ||
96 | * if (some_condition) | ||
97 | * ring_buffer_discard_commit(buffer, event); | ||
98 | * else | ||
99 | * ring_buffer_unlock_commit(buffer, event); | ||
100 | */ | ||
101 | void ring_buffer_discard_commit(struct ring_buffer *buffer, | ||
102 | struct ring_buffer_event *event); | ||
103 | |||
104 | /* | ||
74 | * size is in bytes for each per CPU buffer. | 105 | * size is in bytes for each per CPU buffer. |
75 | */ | 106 | */ |
76 | struct ring_buffer * | 107 | struct ring_buffer * |
77 | ring_buffer_alloc(unsigned long size, unsigned flags); | 108 | __ring_buffer_alloc(unsigned long size, unsigned flags, struct lock_class_key *key); |
109 | |||
110 | /* | ||
111 | * Because the ring buffer is generic, if other users of the ring buffer get | ||
112 | * traced by ftrace, it can produce lockdep warnings. We need to keep each | ||
113 | * ring buffer's lock class separate. | ||
114 | */ | ||
115 | #define ring_buffer_alloc(size, flags) \ | ||
116 | ({ \ | ||
117 | static struct lock_class_key __key; \ | ||
118 | __ring_buffer_alloc((size), (flags), &__key); \ | ||
119 | }) | ||
120 | |||
78 | void ring_buffer_free(struct ring_buffer *buffer); | 121 | void ring_buffer_free(struct ring_buffer *buffer); |
79 | 122 | ||
80 | int ring_buffer_resize(struct ring_buffer *buffer, unsigned long size); | 123 | int ring_buffer_resize(struct ring_buffer *buffer, unsigned long size); |
@@ -122,6 +165,8 @@ unsigned long ring_buffer_entries(struct ring_buffer *buffer); | |||
122 | unsigned long ring_buffer_overruns(struct ring_buffer *buffer); | 165 | unsigned long ring_buffer_overruns(struct ring_buffer *buffer); |
123 | unsigned long ring_buffer_entries_cpu(struct ring_buffer *buffer, int cpu); | 166 | unsigned long ring_buffer_entries_cpu(struct ring_buffer *buffer, int cpu); |
124 | unsigned long ring_buffer_overrun_cpu(struct ring_buffer *buffer, int cpu); | 167 | unsigned long ring_buffer_overrun_cpu(struct ring_buffer *buffer, int cpu); |
168 | unsigned long ring_buffer_commit_overrun_cpu(struct ring_buffer *buffer, int cpu); | ||
169 | unsigned long ring_buffer_nmi_dropped_cpu(struct ring_buffer *buffer, int cpu); | ||
125 | 170 | ||
126 | u64 ring_buffer_time_stamp(struct ring_buffer *buffer, int cpu); | 171 | u64 ring_buffer_time_stamp(struct ring_buffer *buffer, int cpu); |
127 | void ring_buffer_normalize_time_stamp(struct ring_buffer *buffer, | 172 | void ring_buffer_normalize_time_stamp(struct ring_buffer *buffer, |
@@ -137,6 +182,11 @@ void ring_buffer_free_read_page(struct ring_buffer *buffer, void *data); | |||
137 | int ring_buffer_read_page(struct ring_buffer *buffer, void **data_page, | 182 | int ring_buffer_read_page(struct ring_buffer *buffer, void **data_page, |
138 | size_t len, int cpu, int full); | 183 | size_t len, int cpu, int full); |
139 | 184 | ||
185 | struct trace_seq; | ||
186 | |||
187 | int ring_buffer_print_entry_header(struct trace_seq *s); | ||
188 | int ring_buffer_print_page_header(struct trace_seq *s); | ||
189 | |||
140 | enum ring_buffer_flags { | 190 | enum ring_buffer_flags { |
141 | RB_FL_OVERWRITE = 1 << 0, | 191 | RB_FL_OVERWRITE = 1 << 0, |
142 | }; | 192 | }; |
diff --git a/include/linux/sched.h b/include/linux/sched.h index d4646ae300f0..d1399660b776 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -97,8 +97,8 @@ struct exec_domain; | |||
97 | struct futex_pi_state; | 97 | struct futex_pi_state; |
98 | struct robust_list_head; | 98 | struct robust_list_head; |
99 | struct bio; | 99 | struct bio; |
100 | struct bts_tracer; | ||
101 | struct fs_struct; | 100 | struct fs_struct; |
101 | struct bts_context; | ||
102 | 102 | ||
103 | /* | 103 | /* |
104 | * List of flags we want to share for kernel threads, | 104 | * List of flags we want to share for kernel threads, |
@@ -1230,18 +1230,11 @@ struct task_struct { | |||
1230 | struct list_head ptraced; | 1230 | struct list_head ptraced; |
1231 | struct list_head ptrace_entry; | 1231 | struct list_head ptrace_entry; |
1232 | 1232 | ||
1233 | #ifdef CONFIG_X86_PTRACE_BTS | ||
1234 | /* | 1233 | /* |
1235 | * This is the tracer handle for the ptrace BTS extension. | 1234 | * This is the tracer handle for the ptrace BTS extension. |
1236 | * This field actually belongs to the ptracer task. | 1235 | * This field actually belongs to the ptracer task. |
1237 | */ | 1236 | */ |
1238 | struct bts_tracer *bts; | 1237 | struct bts_context *bts; |
1239 | /* | ||
1240 | * The buffer to hold the BTS data. | ||
1241 | */ | ||
1242 | void *bts_buffer; | ||
1243 | size_t bts_size; | ||
1244 | #endif /* CONFIG_X86_PTRACE_BTS */ | ||
1245 | 1238 | ||
1246 | /* PID/PID hash table linkage. */ | 1239 | /* PID/PID hash table linkage. */ |
1247 | struct pid_link pids[PIDTYPE_MAX]; | 1240 | struct pid_link pids[PIDTYPE_MAX]; |
@@ -1449,7 +1442,9 @@ struct task_struct { | |||
1449 | #ifdef CONFIG_TRACING | 1442 | #ifdef CONFIG_TRACING |
1450 | /* state flags for use by tracers */ | 1443 | /* state flags for use by tracers */ |
1451 | unsigned long trace; | 1444 | unsigned long trace; |
1452 | #endif | 1445 | /* bitmask of trace recursion */ |
1446 | unsigned long trace_recursion; | ||
1447 | #endif /* CONFIG_TRACING */ | ||
1453 | }; | 1448 | }; |
1454 | 1449 | ||
1455 | /* Future-safe accessor for struct task_struct's cpus_allowed. */ | 1450 | /* Future-safe accessor for struct task_struct's cpus_allowed. */ |
@@ -2022,8 +2017,10 @@ extern void set_task_comm(struct task_struct *tsk, char *from); | |||
2022 | extern char *get_task_comm(char *to, struct task_struct *tsk); | 2017 | extern char *get_task_comm(char *to, struct task_struct *tsk); |
2023 | 2018 | ||
2024 | #ifdef CONFIG_SMP | 2019 | #ifdef CONFIG_SMP |
2020 | extern void wait_task_context_switch(struct task_struct *p); | ||
2025 | extern unsigned long wait_task_inactive(struct task_struct *, long match_state); | 2021 | extern unsigned long wait_task_inactive(struct task_struct *, long match_state); |
2026 | #else | 2022 | #else |
2023 | static inline void wait_task_context_switch(struct task_struct *p) {} | ||
2027 | static inline unsigned long wait_task_inactive(struct task_struct *p, | 2024 | static inline unsigned long wait_task_inactive(struct task_struct *p, |
2028 | long match_state) | 2025 | long match_state) |
2029 | { | 2026 | { |
diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h index 5ac9b0bcaf9a..713f841ecaa9 100644 --- a/include/linux/slab_def.h +++ b/include/linux/slab_def.h | |||
@@ -14,7 +14,7 @@ | |||
14 | #include <asm/page.h> /* kmalloc_sizes.h needs PAGE_SIZE */ | 14 | #include <asm/page.h> /* kmalloc_sizes.h needs PAGE_SIZE */ |
15 | #include <asm/cache.h> /* kmalloc_sizes.h needs L1_CACHE_BYTES */ | 15 | #include <asm/cache.h> /* kmalloc_sizes.h needs L1_CACHE_BYTES */ |
16 | #include <linux/compiler.h> | 16 | #include <linux/compiler.h> |
17 | #include <trace/kmemtrace.h> | 17 | #include <linux/kmemtrace.h> |
18 | 18 | ||
19 | /* Size description struct for general caches. */ | 19 | /* Size description struct for general caches. */ |
20 | struct cache_sizes { | 20 | struct cache_sizes { |
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h index 5046f90c1171..be5d40c43bd2 100644 --- a/include/linux/slub_def.h +++ b/include/linux/slub_def.h | |||
@@ -10,7 +10,7 @@ | |||
10 | #include <linux/gfp.h> | 10 | #include <linux/gfp.h> |
11 | #include <linux/workqueue.h> | 11 | #include <linux/workqueue.h> |
12 | #include <linux/kobject.h> | 12 | #include <linux/kobject.h> |
13 | #include <trace/kmemtrace.h> | 13 | #include <linux/kmemtrace.h> |
14 | 14 | ||
15 | enum stat_item { | 15 | enum stat_item { |
16 | ALLOC_FASTPATH, /* Allocation from cpu slab */ | 16 | ALLOC_FASTPATH, /* Allocation from cpu slab */ |
diff --git a/include/linux/trace_seq.h b/include/linux/trace_seq.h new file mode 100644 index 000000000000..c68bccba2074 --- /dev/null +++ b/include/linux/trace_seq.h | |||
@@ -0,0 +1,92 @@ | |||
1 | #ifndef _LINUX_TRACE_SEQ_H | ||
2 | #define _LINUX_TRACE_SEQ_H | ||
3 | |||
4 | #include <linux/fs.h> | ||
5 | |||
6 | /* | ||
7 | * Trace sequences are used to allow a function to call several other functions | ||
8 | * to create a string of data to use (up to a max of PAGE_SIZE. | ||
9 | */ | ||
10 | |||
11 | struct trace_seq { | ||
12 | unsigned char buffer[PAGE_SIZE]; | ||
13 | unsigned int len; | ||
14 | unsigned int readpos; | ||
15 | }; | ||
16 | |||
17 | static inline void | ||
18 | trace_seq_init(struct trace_seq *s) | ||
19 | { | ||
20 | s->len = 0; | ||
21 | s->readpos = 0; | ||
22 | } | ||
23 | |||
24 | /* | ||
25 | * Currently only defined when tracing is enabled. | ||
26 | */ | ||
27 | #ifdef CONFIG_TRACING | ||
28 | extern int trace_seq_printf(struct trace_seq *s, const char *fmt, ...) | ||
29 | __attribute__ ((format (printf, 2, 3))); | ||
30 | extern int trace_seq_vprintf(struct trace_seq *s, const char *fmt, va_list args) | ||
31 | __attribute__ ((format (printf, 2, 0))); | ||
32 | extern int | ||
33 | trace_seq_bprintf(struct trace_seq *s, const char *fmt, const u32 *binary); | ||
34 | extern void trace_print_seq(struct seq_file *m, struct trace_seq *s); | ||
35 | extern ssize_t trace_seq_to_user(struct trace_seq *s, char __user *ubuf, | ||
36 | size_t cnt); | ||
37 | extern int trace_seq_puts(struct trace_seq *s, const char *str); | ||
38 | extern int trace_seq_putc(struct trace_seq *s, unsigned char c); | ||
39 | extern int trace_seq_putmem(struct trace_seq *s, const void *mem, size_t len); | ||
40 | extern int trace_seq_putmem_hex(struct trace_seq *s, const void *mem, | ||
41 | size_t len); | ||
42 | extern void *trace_seq_reserve(struct trace_seq *s, size_t len); | ||
43 | extern int trace_seq_path(struct trace_seq *s, struct path *path); | ||
44 | |||
45 | #else /* CONFIG_TRACING */ | ||
46 | static inline int trace_seq_printf(struct trace_seq *s, const char *fmt, ...) | ||
47 | { | ||
48 | return 0; | ||
49 | } | ||
50 | static inline int | ||
51 | trace_seq_bprintf(struct trace_seq *s, const char *fmt, const u32 *binary) | ||
52 | { | ||
53 | return 0; | ||
54 | } | ||
55 | |||
56 | static inline void trace_print_seq(struct seq_file *m, struct trace_seq *s) | ||
57 | { | ||
58 | } | ||
59 | static inline ssize_t trace_seq_to_user(struct trace_seq *s, char __user *ubuf, | ||
60 | size_t cnt) | ||
61 | { | ||
62 | return 0; | ||
63 | } | ||
64 | static inline int trace_seq_puts(struct trace_seq *s, const char *str) | ||
65 | { | ||
66 | return 0; | ||
67 | } | ||
68 | static inline int trace_seq_putc(struct trace_seq *s, unsigned char c) | ||
69 | { | ||
70 | return 0; | ||
71 | } | ||
72 | static inline int | ||
73 | trace_seq_putmem(struct trace_seq *s, const void *mem, size_t len) | ||
74 | { | ||
75 | return 0; | ||
76 | } | ||
77 | static inline int trace_seq_putmem_hex(struct trace_seq *s, const void *mem, | ||
78 | size_t len) | ||
79 | { | ||
80 | return 0; | ||
81 | } | ||
82 | static inline void *trace_seq_reserve(struct trace_seq *s, size_t len) | ||
83 | { | ||
84 | return NULL; | ||
85 | } | ||
86 | static inline int trace_seq_path(struct trace_seq *s, struct path *path) | ||
87 | { | ||
88 | return 0; | ||
89 | } | ||
90 | #endif /* CONFIG_TRACING */ | ||
91 | |||
92 | #endif /* _LINUX_TRACE_SEQ_H */ | ||
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index d35a7ee7611f..14df7e635d43 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h | |||
@@ -31,6 +31,8 @@ struct tracepoint { | |||
31 | * Keep in sync with vmlinux.lds.h. | 31 | * Keep in sync with vmlinux.lds.h. |
32 | */ | 32 | */ |
33 | 33 | ||
34 | #ifndef DECLARE_TRACE | ||
35 | |||
34 | #define TP_PROTO(args...) args | 36 | #define TP_PROTO(args...) args |
35 | #define TP_ARGS(args...) args | 37 | #define TP_ARGS(args...) args |
36 | 38 | ||
@@ -114,6 +116,7 @@ static inline void tracepoint_update_probe_range(struct tracepoint *begin, | |||
114 | struct tracepoint *end) | 116 | struct tracepoint *end) |
115 | { } | 117 | { } |
116 | #endif /* CONFIG_TRACEPOINTS */ | 118 | #endif /* CONFIG_TRACEPOINTS */ |
119 | #endif /* DECLARE_TRACE */ | ||
117 | 120 | ||
118 | /* | 121 | /* |
119 | * Connect a probe to a tracepoint. | 122 | * Connect a probe to a tracepoint. |
@@ -154,10 +157,8 @@ static inline void tracepoint_synchronize_unregister(void) | |||
154 | } | 157 | } |
155 | 158 | ||
156 | #define PARAMS(args...) args | 159 | #define PARAMS(args...) args |
157 | #define TRACE_FORMAT(name, proto, args, fmt) \ | ||
158 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) | ||
159 | |||
160 | 160 | ||
161 | #ifndef TRACE_EVENT | ||
161 | /* | 162 | /* |
162 | * For use with the TRACE_EVENT macro: | 163 | * For use with the TRACE_EVENT macro: |
163 | * | 164 | * |
@@ -262,5 +263,6 @@ static inline void tracepoint_synchronize_unregister(void) | |||
262 | 263 | ||
263 | #define TRACE_EVENT(name, proto, args, struct, assign, print) \ | 264 | #define TRACE_EVENT(name, proto, args, struct, assign, print) \ |
264 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) | 265 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) |
266 | #endif | ||
265 | 267 | ||
266 | #endif | 268 | #endif |
diff --git a/include/trace/block.h b/include/trace/block.h deleted file mode 100644 index 25b7068b819e..000000000000 --- a/include/trace/block.h +++ /dev/null | |||
@@ -1,76 +0,0 @@ | |||
1 | #ifndef _TRACE_BLOCK_H | ||
2 | #define _TRACE_BLOCK_H | ||
3 | |||
4 | #include <linux/blkdev.h> | ||
5 | #include <linux/tracepoint.h> | ||
6 | |||
7 | DECLARE_TRACE(block_rq_abort, | ||
8 | TP_PROTO(struct request_queue *q, struct request *rq), | ||
9 | TP_ARGS(q, rq)); | ||
10 | |||
11 | DECLARE_TRACE(block_rq_insert, | ||
12 | TP_PROTO(struct request_queue *q, struct request *rq), | ||
13 | TP_ARGS(q, rq)); | ||
14 | |||
15 | DECLARE_TRACE(block_rq_issue, | ||
16 | TP_PROTO(struct request_queue *q, struct request *rq), | ||
17 | TP_ARGS(q, rq)); | ||
18 | |||
19 | DECLARE_TRACE(block_rq_requeue, | ||
20 | TP_PROTO(struct request_queue *q, struct request *rq), | ||
21 | TP_ARGS(q, rq)); | ||
22 | |||
23 | DECLARE_TRACE(block_rq_complete, | ||
24 | TP_PROTO(struct request_queue *q, struct request *rq), | ||
25 | TP_ARGS(q, rq)); | ||
26 | |||
27 | DECLARE_TRACE(block_bio_bounce, | ||
28 | TP_PROTO(struct request_queue *q, struct bio *bio), | ||
29 | TP_ARGS(q, bio)); | ||
30 | |||
31 | DECLARE_TRACE(block_bio_complete, | ||
32 | TP_PROTO(struct request_queue *q, struct bio *bio), | ||
33 | TP_ARGS(q, bio)); | ||
34 | |||
35 | DECLARE_TRACE(block_bio_backmerge, | ||
36 | TP_PROTO(struct request_queue *q, struct bio *bio), | ||
37 | TP_ARGS(q, bio)); | ||
38 | |||
39 | DECLARE_TRACE(block_bio_frontmerge, | ||
40 | TP_PROTO(struct request_queue *q, struct bio *bio), | ||
41 | TP_ARGS(q, bio)); | ||
42 | |||
43 | DECLARE_TRACE(block_bio_queue, | ||
44 | TP_PROTO(struct request_queue *q, struct bio *bio), | ||
45 | TP_ARGS(q, bio)); | ||
46 | |||
47 | DECLARE_TRACE(block_getrq, | ||
48 | TP_PROTO(struct request_queue *q, struct bio *bio, int rw), | ||
49 | TP_ARGS(q, bio, rw)); | ||
50 | |||
51 | DECLARE_TRACE(block_sleeprq, | ||
52 | TP_PROTO(struct request_queue *q, struct bio *bio, int rw), | ||
53 | TP_ARGS(q, bio, rw)); | ||
54 | |||
55 | DECLARE_TRACE(block_plug, | ||
56 | TP_PROTO(struct request_queue *q), | ||
57 | TP_ARGS(q)); | ||
58 | |||
59 | DECLARE_TRACE(block_unplug_timer, | ||
60 | TP_PROTO(struct request_queue *q), | ||
61 | TP_ARGS(q)); | ||
62 | |||
63 | DECLARE_TRACE(block_unplug_io, | ||
64 | TP_PROTO(struct request_queue *q), | ||
65 | TP_ARGS(q)); | ||
66 | |||
67 | DECLARE_TRACE(block_split, | ||
68 | TP_PROTO(struct request_queue *q, struct bio *bio, unsigned int pdu), | ||
69 | TP_ARGS(q, bio, pdu)); | ||
70 | |||
71 | DECLARE_TRACE(block_remap, | ||
72 | TP_PROTO(struct request_queue *q, struct bio *bio, dev_t dev, | ||
73 | sector_t from, sector_t to), | ||
74 | TP_ARGS(q, bio, dev, from, to)); | ||
75 | |||
76 | #endif | ||
diff --git a/include/trace/define_trace.h b/include/trace/define_trace.h new file mode 100644 index 000000000000..f7a7ae1e8f90 --- /dev/null +++ b/include/trace/define_trace.h | |||
@@ -0,0 +1,75 @@ | |||
1 | /* | ||
2 | * Trace files that want to automate creationg of all tracepoints defined | ||
3 | * in their file should include this file. The following are macros that the | ||
4 | * trace file may define: | ||
5 | * | ||
6 | * TRACE_SYSTEM defines the system the tracepoint is for | ||
7 | * | ||
8 | * TRACE_INCLUDE_FILE if the file name is something other than TRACE_SYSTEM.h | ||
9 | * This macro may be defined to tell define_trace.h what file to include. | ||
10 | * Note, leave off the ".h". | ||
11 | * | ||
12 | * TRACE_INCLUDE_PATH if the path is something other than core kernel include/trace | ||
13 | * then this macro can define the path to use. Note, the path is relative to | ||
14 | * define_trace.h, not the file including it. Full path names for out of tree | ||
15 | * modules must be used. | ||
16 | */ | ||
17 | |||
18 | #ifdef CREATE_TRACE_POINTS | ||
19 | |||
20 | /* Prevent recursion */ | ||
21 | #undef CREATE_TRACE_POINTS | ||
22 | |||
23 | #include <linux/stringify.h> | ||
24 | |||
25 | #undef TRACE_EVENT | ||
26 | #define TRACE_EVENT(name, proto, args, tstruct, assign, print) \ | ||
27 | DEFINE_TRACE(name) | ||
28 | |||
29 | #undef DECLARE_TRACE | ||
30 | #define DECLARE_TRACE(name, proto, args) \ | ||
31 | DEFINE_TRACE(name) | ||
32 | |||
33 | #undef TRACE_INCLUDE | ||
34 | #undef __TRACE_INCLUDE | ||
35 | |||
36 | #ifndef TRACE_INCLUDE_FILE | ||
37 | # define TRACE_INCLUDE_FILE TRACE_SYSTEM | ||
38 | # define UNDEF_TRACE_INCLUDE_FILE | ||
39 | #endif | ||
40 | |||
41 | #ifndef TRACE_INCLUDE_PATH | ||
42 | # define __TRACE_INCLUDE(system) <trace/events/system.h> | ||
43 | # define UNDEF_TRACE_INCLUDE_PATH | ||
44 | #else | ||
45 | # define __TRACE_INCLUDE(system) __stringify(TRACE_INCLUDE_PATH/system.h) | ||
46 | #endif | ||
47 | |||
48 | # define TRACE_INCLUDE(system) __TRACE_INCLUDE(system) | ||
49 | |||
50 | /* Let the trace headers be reread */ | ||
51 | #define TRACE_HEADER_MULTI_READ | ||
52 | |||
53 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | ||
54 | |||
55 | #ifdef CONFIG_EVENT_TRACING | ||
56 | #include <trace/ftrace.h> | ||
57 | #endif | ||
58 | |||
59 | #undef TRACE_HEADER_MULTI_READ | ||
60 | |||
61 | /* Only undef what we defined in this file */ | ||
62 | #ifdef UNDEF_TRACE_INCLUDE_FILE | ||
63 | # undef TRACE_INCLUDE_FILE | ||
64 | # undef UNDEF_TRACE_INCLUDE_FILE | ||
65 | #endif | ||
66 | |||
67 | #ifdef UNDEF_TRACE_INCLUDE_PATH | ||
68 | # undef TRACE_INCLUDE_PATH | ||
69 | # undef UNDEF_TRACE_INCLUDE_PATH | ||
70 | #endif | ||
71 | |||
72 | /* We may be processing more files */ | ||
73 | #define CREATE_TRACE_POINTS | ||
74 | |||
75 | #endif /* CREATE_TRACE_POINTS */ | ||
diff --git a/include/trace/events/block.h b/include/trace/events/block.h new file mode 100644 index 000000000000..53effd496a50 --- /dev/null +++ b/include/trace/events/block.h | |||
@@ -0,0 +1,498 @@ | |||
1 | #if !defined(_TRACE_BLOCK_H) || defined(TRACE_HEADER_MULTI_READ) | ||
2 | #define _TRACE_BLOCK_H | ||
3 | |||
4 | #include <linux/blktrace_api.h> | ||
5 | #include <linux/blkdev.h> | ||
6 | #include <linux/tracepoint.h> | ||
7 | |||
8 | #undef TRACE_SYSTEM | ||
9 | #define TRACE_SYSTEM block | ||
10 | |||
11 | TRACE_EVENT(block_rq_abort, | ||
12 | |||
13 | TP_PROTO(struct request_queue *q, struct request *rq), | ||
14 | |||
15 | TP_ARGS(q, rq), | ||
16 | |||
17 | TP_STRUCT__entry( | ||
18 | __field( dev_t, dev ) | ||
19 | __field( sector_t, sector ) | ||
20 | __field( unsigned int, nr_sector ) | ||
21 | __field( int, errors ) | ||
22 | __array( char, rwbs, 6 ) | ||
23 | __dynamic_array( char, cmd, blk_cmd_buf_len(rq) ) | ||
24 | ), | ||
25 | |||
26 | TP_fast_assign( | ||
27 | __entry->dev = rq->rq_disk ? disk_devt(rq->rq_disk) : 0; | ||
28 | __entry->sector = blk_pc_request(rq) ? 0 : rq->hard_sector; | ||
29 | __entry->nr_sector = blk_pc_request(rq) ? | ||
30 | 0 : rq->hard_nr_sectors; | ||
31 | __entry->errors = rq->errors; | ||
32 | |||
33 | blk_fill_rwbs_rq(__entry->rwbs, rq); | ||
34 | blk_dump_cmd(__get_str(cmd), rq); | ||
35 | ), | ||
36 | |||
37 | TP_printk("%d,%d %s (%s) %llu + %u [%d]", | ||
38 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
39 | __entry->rwbs, __get_str(cmd), | ||
40 | (unsigned long long)__entry->sector, | ||
41 | __entry->nr_sector, __entry->errors) | ||
42 | ); | ||
43 | |||
44 | TRACE_EVENT(block_rq_insert, | ||
45 | |||
46 | TP_PROTO(struct request_queue *q, struct request *rq), | ||
47 | |||
48 | TP_ARGS(q, rq), | ||
49 | |||
50 | TP_STRUCT__entry( | ||
51 | __field( dev_t, dev ) | ||
52 | __field( sector_t, sector ) | ||
53 | __field( unsigned int, nr_sector ) | ||
54 | __field( unsigned int, bytes ) | ||
55 | __array( char, rwbs, 6 ) | ||
56 | __array( char, comm, TASK_COMM_LEN ) | ||
57 | __dynamic_array( char, cmd, blk_cmd_buf_len(rq) ) | ||
58 | ), | ||
59 | |||
60 | TP_fast_assign( | ||
61 | __entry->dev = rq->rq_disk ? disk_devt(rq->rq_disk) : 0; | ||
62 | __entry->sector = blk_pc_request(rq) ? 0 : rq->hard_sector; | ||
63 | __entry->nr_sector = blk_pc_request(rq) ? | ||
64 | 0 : rq->hard_nr_sectors; | ||
65 | __entry->bytes = blk_pc_request(rq) ? rq->data_len : 0; | ||
66 | |||
67 | blk_fill_rwbs_rq(__entry->rwbs, rq); | ||
68 | blk_dump_cmd(__get_str(cmd), rq); | ||
69 | memcpy(__entry->comm, current->comm, TASK_COMM_LEN); | ||
70 | ), | ||
71 | |||
72 | TP_printk("%d,%d %s %u (%s) %llu + %u [%s]", | ||
73 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
74 | __entry->rwbs, __entry->bytes, __get_str(cmd), | ||
75 | (unsigned long long)__entry->sector, | ||
76 | __entry->nr_sector, __entry->comm) | ||
77 | ); | ||
78 | |||
79 | TRACE_EVENT(block_rq_issue, | ||
80 | |||
81 | TP_PROTO(struct request_queue *q, struct request *rq), | ||
82 | |||
83 | TP_ARGS(q, rq), | ||
84 | |||
85 | TP_STRUCT__entry( | ||
86 | __field( dev_t, dev ) | ||
87 | __field( sector_t, sector ) | ||
88 | __field( unsigned int, nr_sector ) | ||
89 | __field( unsigned int, bytes ) | ||
90 | __array( char, rwbs, 6 ) | ||
91 | __array( char, comm, TASK_COMM_LEN ) | ||
92 | __dynamic_array( char, cmd, blk_cmd_buf_len(rq) ) | ||
93 | ), | ||
94 | |||
95 | TP_fast_assign( | ||
96 | __entry->dev = rq->rq_disk ? disk_devt(rq->rq_disk) : 0; | ||
97 | __entry->sector = blk_pc_request(rq) ? 0 : rq->hard_sector; | ||
98 | __entry->nr_sector = blk_pc_request(rq) ? | ||
99 | 0 : rq->hard_nr_sectors; | ||
100 | __entry->bytes = blk_pc_request(rq) ? rq->data_len : 0; | ||
101 | |||
102 | blk_fill_rwbs_rq(__entry->rwbs, rq); | ||
103 | blk_dump_cmd(__get_str(cmd), rq); | ||
104 | memcpy(__entry->comm, current->comm, TASK_COMM_LEN); | ||
105 | ), | ||
106 | |||
107 | TP_printk("%d,%d %s %u (%s) %llu + %u [%s]", | ||
108 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
109 | __entry->rwbs, __entry->bytes, __get_str(cmd), | ||
110 | (unsigned long long)__entry->sector, | ||
111 | __entry->nr_sector, __entry->comm) | ||
112 | ); | ||
113 | |||
114 | TRACE_EVENT(block_rq_requeue, | ||
115 | |||
116 | TP_PROTO(struct request_queue *q, struct request *rq), | ||
117 | |||
118 | TP_ARGS(q, rq), | ||
119 | |||
120 | TP_STRUCT__entry( | ||
121 | __field( dev_t, dev ) | ||
122 | __field( sector_t, sector ) | ||
123 | __field( unsigned int, nr_sector ) | ||
124 | __field( int, errors ) | ||
125 | __array( char, rwbs, 6 ) | ||
126 | __dynamic_array( char, cmd, blk_cmd_buf_len(rq) ) | ||
127 | ), | ||
128 | |||
129 | TP_fast_assign( | ||
130 | __entry->dev = rq->rq_disk ? disk_devt(rq->rq_disk) : 0; | ||
131 | __entry->sector = blk_pc_request(rq) ? 0 : rq->hard_sector; | ||
132 | __entry->nr_sector = blk_pc_request(rq) ? | ||
133 | 0 : rq->hard_nr_sectors; | ||
134 | __entry->errors = rq->errors; | ||
135 | |||
136 | blk_fill_rwbs_rq(__entry->rwbs, rq); | ||
137 | blk_dump_cmd(__get_str(cmd), rq); | ||
138 | ), | ||
139 | |||
140 | TP_printk("%d,%d %s (%s) %llu + %u [%d]", | ||
141 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
142 | __entry->rwbs, __get_str(cmd), | ||
143 | (unsigned long long)__entry->sector, | ||
144 | __entry->nr_sector, __entry->errors) | ||
145 | ); | ||
146 | |||
147 | TRACE_EVENT(block_rq_complete, | ||
148 | |||
149 | TP_PROTO(struct request_queue *q, struct request *rq), | ||
150 | |||
151 | TP_ARGS(q, rq), | ||
152 | |||
153 | TP_STRUCT__entry( | ||
154 | __field( dev_t, dev ) | ||
155 | __field( sector_t, sector ) | ||
156 | __field( unsigned int, nr_sector ) | ||
157 | __field( int, errors ) | ||
158 | __array( char, rwbs, 6 ) | ||
159 | __dynamic_array( char, cmd, blk_cmd_buf_len(rq) ) | ||
160 | ), | ||
161 | |||
162 | TP_fast_assign( | ||
163 | __entry->dev = rq->rq_disk ? disk_devt(rq->rq_disk) : 0; | ||
164 | __entry->sector = blk_pc_request(rq) ? 0 : rq->hard_sector; | ||
165 | __entry->nr_sector = blk_pc_request(rq) ? | ||
166 | 0 : rq->hard_nr_sectors; | ||
167 | __entry->errors = rq->errors; | ||
168 | |||
169 | blk_fill_rwbs_rq(__entry->rwbs, rq); | ||
170 | blk_dump_cmd(__get_str(cmd), rq); | ||
171 | ), | ||
172 | |||
173 | TP_printk("%d,%d %s (%s) %llu + %u [%d]", | ||
174 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
175 | __entry->rwbs, __get_str(cmd), | ||
176 | (unsigned long long)__entry->sector, | ||
177 | __entry->nr_sector, __entry->errors) | ||
178 | ); | ||
179 | TRACE_EVENT(block_bio_bounce, | ||
180 | |||
181 | TP_PROTO(struct request_queue *q, struct bio *bio), | ||
182 | |||
183 | TP_ARGS(q, bio), | ||
184 | |||
185 | TP_STRUCT__entry( | ||
186 | __field( dev_t, dev ) | ||
187 | __field( sector_t, sector ) | ||
188 | __field( unsigned int, nr_sector ) | ||
189 | __array( char, rwbs, 6 ) | ||
190 | __array( char, comm, TASK_COMM_LEN ) | ||
191 | ), | ||
192 | |||
193 | TP_fast_assign( | ||
194 | __entry->dev = bio->bi_bdev->bd_dev; | ||
195 | __entry->sector = bio->bi_sector; | ||
196 | __entry->nr_sector = bio->bi_size >> 9; | ||
197 | blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size); | ||
198 | memcpy(__entry->comm, current->comm, TASK_COMM_LEN); | ||
199 | ), | ||
200 | |||
201 | TP_printk("%d,%d %s %llu + %u [%s]", | ||
202 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, | ||
203 | (unsigned long long)__entry->sector, | ||
204 | __entry->nr_sector, __entry->comm) | ||
205 | ); | ||
206 | |||
207 | TRACE_EVENT(block_bio_complete, | ||
208 | |||
209 | TP_PROTO(struct request_queue *q, struct bio *bio), | ||
210 | |||
211 | TP_ARGS(q, bio), | ||
212 | |||
213 | TP_STRUCT__entry( | ||
214 | __field( dev_t, dev ) | ||
215 | __field( sector_t, sector ) | ||
216 | __field( unsigned, nr_sector ) | ||
217 | __field( int, error ) | ||
218 | __array( char, rwbs, 6 ) | ||
219 | ), | ||
220 | |||
221 | TP_fast_assign( | ||
222 | __entry->dev = bio->bi_bdev->bd_dev; | ||
223 | __entry->sector = bio->bi_sector; | ||
224 | __entry->nr_sector = bio->bi_size >> 9; | ||
225 | blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size); | ||
226 | ), | ||
227 | |||
228 | TP_printk("%d,%d %s %llu + %u [%d]", | ||
229 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, | ||
230 | (unsigned long long)__entry->sector, | ||
231 | __entry->nr_sector, __entry->error) | ||
232 | ); | ||
233 | |||
234 | TRACE_EVENT(block_bio_backmerge, | ||
235 | |||
236 | TP_PROTO(struct request_queue *q, struct bio *bio), | ||
237 | |||
238 | TP_ARGS(q, bio), | ||
239 | |||
240 | TP_STRUCT__entry( | ||
241 | __field( dev_t, dev ) | ||
242 | __field( sector_t, sector ) | ||
243 | __field( unsigned int, nr_sector ) | ||
244 | __array( char, rwbs, 6 ) | ||
245 | __array( char, comm, TASK_COMM_LEN ) | ||
246 | ), | ||
247 | |||
248 | TP_fast_assign( | ||
249 | __entry->dev = bio->bi_bdev->bd_dev; | ||
250 | __entry->sector = bio->bi_sector; | ||
251 | __entry->nr_sector = bio->bi_size >> 9; | ||
252 | blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size); | ||
253 | memcpy(__entry->comm, current->comm, TASK_COMM_LEN); | ||
254 | ), | ||
255 | |||
256 | TP_printk("%d,%d %s %llu + %u [%s]", | ||
257 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, | ||
258 | (unsigned long long)__entry->sector, | ||
259 | __entry->nr_sector, __entry->comm) | ||
260 | ); | ||
261 | |||
262 | TRACE_EVENT(block_bio_frontmerge, | ||
263 | |||
264 | TP_PROTO(struct request_queue *q, struct bio *bio), | ||
265 | |||
266 | TP_ARGS(q, bio), | ||
267 | |||
268 | TP_STRUCT__entry( | ||
269 | __field( dev_t, dev ) | ||
270 | __field( sector_t, sector ) | ||
271 | __field( unsigned, nr_sector ) | ||
272 | __array( char, rwbs, 6 ) | ||
273 | __array( char, comm, TASK_COMM_LEN ) | ||
274 | ), | ||
275 | |||
276 | TP_fast_assign( | ||
277 | __entry->dev = bio->bi_bdev->bd_dev; | ||
278 | __entry->sector = bio->bi_sector; | ||
279 | __entry->nr_sector = bio->bi_size >> 9; | ||
280 | blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size); | ||
281 | memcpy(__entry->comm, current->comm, TASK_COMM_LEN); | ||
282 | ), | ||
283 | |||
284 | TP_printk("%d,%d %s %llu + %u [%s]", | ||
285 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, | ||
286 | (unsigned long long)__entry->sector, | ||
287 | __entry->nr_sector, __entry->comm) | ||
288 | ); | ||
289 | |||
290 | TRACE_EVENT(block_bio_queue, | ||
291 | |||
292 | TP_PROTO(struct request_queue *q, struct bio *bio), | ||
293 | |||
294 | TP_ARGS(q, bio), | ||
295 | |||
296 | TP_STRUCT__entry( | ||
297 | __field( dev_t, dev ) | ||
298 | __field( sector_t, sector ) | ||
299 | __field( unsigned int, nr_sector ) | ||
300 | __array( char, rwbs, 6 ) | ||
301 | __array( char, comm, TASK_COMM_LEN ) | ||
302 | ), | ||
303 | |||
304 | TP_fast_assign( | ||
305 | __entry->dev = bio->bi_bdev->bd_dev; | ||
306 | __entry->sector = bio->bi_sector; | ||
307 | __entry->nr_sector = bio->bi_size >> 9; | ||
308 | blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size); | ||
309 | memcpy(__entry->comm, current->comm, TASK_COMM_LEN); | ||
310 | ), | ||
311 | |||
312 | TP_printk("%d,%d %s %llu + %u [%s]", | ||
313 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, | ||
314 | (unsigned long long)__entry->sector, | ||
315 | __entry->nr_sector, __entry->comm) | ||
316 | ); | ||
317 | |||
318 | TRACE_EVENT(block_getrq, | ||
319 | |||
320 | TP_PROTO(struct request_queue *q, struct bio *bio, int rw), | ||
321 | |||
322 | TP_ARGS(q, bio, rw), | ||
323 | |||
324 | TP_STRUCT__entry( | ||
325 | __field( dev_t, dev ) | ||
326 | __field( sector_t, sector ) | ||
327 | __field( unsigned int, nr_sector ) | ||
328 | __array( char, rwbs, 6 ) | ||
329 | __array( char, comm, TASK_COMM_LEN ) | ||
330 | ), | ||
331 | |||
332 | TP_fast_assign( | ||
333 | __entry->dev = bio ? bio->bi_bdev->bd_dev : 0; | ||
334 | __entry->sector = bio ? bio->bi_sector : 0; | ||
335 | __entry->nr_sector = bio ? bio->bi_size >> 9 : 0; | ||
336 | blk_fill_rwbs(__entry->rwbs, | ||
337 | bio ? bio->bi_rw : 0, __entry->nr_sector); | ||
338 | memcpy(__entry->comm, current->comm, TASK_COMM_LEN); | ||
339 | ), | ||
340 | |||
341 | TP_printk("%d,%d %s %llu + %u [%s]", | ||
342 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, | ||
343 | (unsigned long long)__entry->sector, | ||
344 | __entry->nr_sector, __entry->comm) | ||
345 | ); | ||
346 | |||
347 | TRACE_EVENT(block_sleeprq, | ||
348 | |||
349 | TP_PROTO(struct request_queue *q, struct bio *bio, int rw), | ||
350 | |||
351 | TP_ARGS(q, bio, rw), | ||
352 | |||
353 | TP_STRUCT__entry( | ||
354 | __field( dev_t, dev ) | ||
355 | __field( sector_t, sector ) | ||
356 | __field( unsigned int, nr_sector ) | ||
357 | __array( char, rwbs, 6 ) | ||
358 | __array( char, comm, TASK_COMM_LEN ) | ||
359 | ), | ||
360 | |||
361 | TP_fast_assign( | ||
362 | __entry->dev = bio ? bio->bi_bdev->bd_dev : 0; | ||
363 | __entry->sector = bio ? bio->bi_sector : 0; | ||
364 | __entry->nr_sector = bio ? bio->bi_size >> 9 : 0; | ||
365 | blk_fill_rwbs(__entry->rwbs, | ||
366 | bio ? bio->bi_rw : 0, __entry->nr_sector); | ||
367 | memcpy(__entry->comm, current->comm, TASK_COMM_LEN); | ||
368 | ), | ||
369 | |||
370 | TP_printk("%d,%d %s %llu + %u [%s]", | ||
371 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, | ||
372 | (unsigned long long)__entry->sector, | ||
373 | __entry->nr_sector, __entry->comm) | ||
374 | ); | ||
375 | |||
376 | TRACE_EVENT(block_plug, | ||
377 | |||
378 | TP_PROTO(struct request_queue *q), | ||
379 | |||
380 | TP_ARGS(q), | ||
381 | |||
382 | TP_STRUCT__entry( | ||
383 | __array( char, comm, TASK_COMM_LEN ) | ||
384 | ), | ||
385 | |||
386 | TP_fast_assign( | ||
387 | memcpy(__entry->comm, current->comm, TASK_COMM_LEN); | ||
388 | ), | ||
389 | |||
390 | TP_printk("[%s]", __entry->comm) | ||
391 | ); | ||
392 | |||
393 | TRACE_EVENT(block_unplug_timer, | ||
394 | |||
395 | TP_PROTO(struct request_queue *q), | ||
396 | |||
397 | TP_ARGS(q), | ||
398 | |||
399 | TP_STRUCT__entry( | ||
400 | __field( int, nr_rq ) | ||
401 | __array( char, comm, TASK_COMM_LEN ) | ||
402 | ), | ||
403 | |||
404 | TP_fast_assign( | ||
405 | __entry->nr_rq = q->rq.count[READ] + q->rq.count[WRITE]; | ||
406 | memcpy(__entry->comm, current->comm, TASK_COMM_LEN); | ||
407 | ), | ||
408 | |||
409 | TP_printk("[%s] %d", __entry->comm, __entry->nr_rq) | ||
410 | ); | ||
411 | |||
412 | TRACE_EVENT(block_unplug_io, | ||
413 | |||
414 | TP_PROTO(struct request_queue *q), | ||
415 | |||
416 | TP_ARGS(q), | ||
417 | |||
418 | TP_STRUCT__entry( | ||
419 | __field( int, nr_rq ) | ||
420 | __array( char, comm, TASK_COMM_LEN ) | ||
421 | ), | ||
422 | |||
423 | TP_fast_assign( | ||
424 | __entry->nr_rq = q->rq.count[READ] + q->rq.count[WRITE]; | ||
425 | memcpy(__entry->comm, current->comm, TASK_COMM_LEN); | ||
426 | ), | ||
427 | |||
428 | TP_printk("[%s] %d", __entry->comm, __entry->nr_rq) | ||
429 | ); | ||
430 | |||
431 | TRACE_EVENT(block_split, | ||
432 | |||
433 | TP_PROTO(struct request_queue *q, struct bio *bio, | ||
434 | unsigned int new_sector), | ||
435 | |||
436 | TP_ARGS(q, bio, new_sector), | ||
437 | |||
438 | TP_STRUCT__entry( | ||
439 | __field( dev_t, dev ) | ||
440 | __field( sector_t, sector ) | ||
441 | __field( sector_t, new_sector ) | ||
442 | __array( char, rwbs, 6 ) | ||
443 | __array( char, comm, TASK_COMM_LEN ) | ||
444 | ), | ||
445 | |||
446 | TP_fast_assign( | ||
447 | __entry->dev = bio->bi_bdev->bd_dev; | ||
448 | __entry->sector = bio->bi_sector; | ||
449 | __entry->new_sector = new_sector; | ||
450 | blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size); | ||
451 | memcpy(__entry->comm, current->comm, TASK_COMM_LEN); | ||
452 | ), | ||
453 | |||
454 | TP_printk("%d,%d %s %llu / %llu [%s]", | ||
455 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, | ||
456 | (unsigned long long)__entry->sector, | ||
457 | (unsigned long long)__entry->new_sector, | ||
458 | __entry->comm) | ||
459 | ); | ||
460 | |||
461 | TRACE_EVENT(block_remap, | ||
462 | |||
463 | TP_PROTO(struct request_queue *q, struct bio *bio, dev_t dev, | ||
464 | sector_t from), | ||
465 | |||
466 | TP_ARGS(q, bio, dev, from), | ||
467 | |||
468 | TP_STRUCT__entry( | ||
469 | __field( dev_t, dev ) | ||
470 | __field( sector_t, sector ) | ||
471 | __field( unsigned int, nr_sector ) | ||
472 | __field( dev_t, old_dev ) | ||
473 | __field( sector_t, old_sector ) | ||
474 | __array( char, rwbs, 6 ) | ||
475 | ), | ||
476 | |||
477 | TP_fast_assign( | ||
478 | __entry->dev = bio->bi_bdev->bd_dev; | ||
479 | __entry->sector = bio->bi_sector; | ||
480 | __entry->nr_sector = bio->bi_size >> 9; | ||
481 | __entry->old_dev = dev; | ||
482 | __entry->old_sector = from; | ||
483 | blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size); | ||
484 | ), | ||
485 | |||
486 | TP_printk("%d,%d %s %llu + %u <- (%d,%d) %llu", | ||
487 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, | ||
488 | (unsigned long long)__entry->sector, | ||
489 | __entry->nr_sector, | ||
490 | MAJOR(__entry->old_dev), MINOR(__entry->old_dev), | ||
491 | (unsigned long long)__entry->old_sector) | ||
492 | ); | ||
493 | |||
494 | #endif /* _TRACE_BLOCK_H */ | ||
495 | |||
496 | /* This part must be outside protection */ | ||
497 | #include <trace/define_trace.h> | ||
498 | |||
diff --git a/include/trace/events/irq.h b/include/trace/events/irq.h new file mode 100644 index 000000000000..b0c7ede55eb1 --- /dev/null +++ b/include/trace/events/irq.h | |||
@@ -0,0 +1,145 @@ | |||
1 | #if !defined(_TRACE_IRQ_H) || defined(TRACE_HEADER_MULTI_READ) | ||
2 | #define _TRACE_IRQ_H | ||
3 | |||
4 | #include <linux/tracepoint.h> | ||
5 | #include <linux/interrupt.h> | ||
6 | |||
7 | #undef TRACE_SYSTEM | ||
8 | #define TRACE_SYSTEM irq | ||
9 | |||
10 | #define softirq_name(sirq) { sirq##_SOFTIRQ, #sirq } | ||
11 | #define show_softirq_name(val) \ | ||
12 | __print_symbolic(val, \ | ||
13 | softirq_name(HI), \ | ||
14 | softirq_name(TIMER), \ | ||
15 | softirq_name(NET_TX), \ | ||
16 | softirq_name(NET_RX), \ | ||
17 | softirq_name(BLOCK), \ | ||
18 | softirq_name(TASKLET), \ | ||
19 | softirq_name(SCHED), \ | ||
20 | softirq_name(HRTIMER), \ | ||
21 | softirq_name(RCU)) | ||
22 | |||
23 | /** | ||
24 | * irq_handler_entry - called immediately before the irq action handler | ||
25 | * @irq: irq number | ||
26 | * @action: pointer to struct irqaction | ||
27 | * | ||
28 | * The struct irqaction pointed to by @action contains various | ||
29 | * information about the handler, including the device name, | ||
30 | * @action->name, and the device id, @action->dev_id. When used in | ||
31 | * conjunction with the irq_handler_exit tracepoint, we can figure | ||
32 | * out irq handler latencies. | ||
33 | */ | ||
34 | TRACE_EVENT(irq_handler_entry, | ||
35 | |||
36 | TP_PROTO(int irq, struct irqaction *action), | ||
37 | |||
38 | TP_ARGS(irq, action), | ||
39 | |||
40 | TP_STRUCT__entry( | ||
41 | __field( int, irq ) | ||
42 | __string( name, action->name ) | ||
43 | ), | ||
44 | |||
45 | TP_fast_assign( | ||
46 | __entry->irq = irq; | ||
47 | __assign_str(name, action->name); | ||
48 | ), | ||
49 | |||
50 | TP_printk("irq=%d handler=%s", __entry->irq, __get_str(name)) | ||
51 | ); | ||
52 | |||
53 | /** | ||
54 | * irq_handler_exit - called immediately after the irq action handler returns | ||
55 | * @irq: irq number | ||
56 | * @action: pointer to struct irqaction | ||
57 | * @ret: return value | ||
58 | * | ||
59 | * If the @ret value is set to IRQ_HANDLED, then we know that the corresponding | ||
60 | * @action->handler scuccessully handled this irq. Otherwise, the irq might be | ||
61 | * a shared irq line, or the irq was not handled successfully. Can be used in | ||
62 | * conjunction with the irq_handler_entry to understand irq handler latencies. | ||
63 | */ | ||
64 | TRACE_EVENT(irq_handler_exit, | ||
65 | |||
66 | TP_PROTO(int irq, struct irqaction *action, int ret), | ||
67 | |||
68 | TP_ARGS(irq, action, ret), | ||
69 | |||
70 | TP_STRUCT__entry( | ||
71 | __field( int, irq ) | ||
72 | __field( int, ret ) | ||
73 | ), | ||
74 | |||
75 | TP_fast_assign( | ||
76 | __entry->irq = irq; | ||
77 | __entry->ret = ret; | ||
78 | ), | ||
79 | |||
80 | TP_printk("irq=%d return=%s", | ||
81 | __entry->irq, __entry->ret ? "handled" : "unhandled") | ||
82 | ); | ||
83 | |||
84 | /** | ||
85 | * softirq_entry - called immediately before the softirq handler | ||
86 | * @h: pointer to struct softirq_action | ||
87 | * @vec: pointer to first struct softirq_action in softirq_vec array | ||
88 | * | ||
89 | * The @h parameter, contains a pointer to the struct softirq_action | ||
90 | * which has a pointer to the action handler that is called. By subtracting | ||
91 | * the @vec pointer from the @h pointer, we can determine the softirq | ||
92 | * number. Also, when used in combination with the softirq_exit tracepoint | ||
93 | * we can determine the softirq latency. | ||
94 | */ | ||
95 | TRACE_EVENT(softirq_entry, | ||
96 | |||
97 | TP_PROTO(struct softirq_action *h, struct softirq_action *vec), | ||
98 | |||
99 | TP_ARGS(h, vec), | ||
100 | |||
101 | TP_STRUCT__entry( | ||
102 | __field( int, vec ) | ||
103 | ), | ||
104 | |||
105 | TP_fast_assign( | ||
106 | __entry->vec = (int)(h - vec); | ||
107 | ), | ||
108 | |||
109 | TP_printk("softirq=%d action=%s", __entry->vec, | ||
110 | show_softirq_name(__entry->vec)) | ||
111 | ); | ||
112 | |||
113 | /** | ||
114 | * softirq_exit - called immediately after the softirq handler returns | ||
115 | * @h: pointer to struct softirq_action | ||
116 | * @vec: pointer to first struct softirq_action in softirq_vec array | ||
117 | * | ||
118 | * The @h parameter contains a pointer to the struct softirq_action | ||
119 | * that has handled the softirq. By subtracting the @vec pointer from | ||
120 | * the @h pointer, we can determine the softirq number. Also, when used in | ||
121 | * combination with the softirq_entry tracepoint we can determine the softirq | ||
122 | * latency. | ||
123 | */ | ||
124 | TRACE_EVENT(softirq_exit, | ||
125 | |||
126 | TP_PROTO(struct softirq_action *h, struct softirq_action *vec), | ||
127 | |||
128 | TP_ARGS(h, vec), | ||
129 | |||
130 | TP_STRUCT__entry( | ||
131 | __field( int, vec ) | ||
132 | ), | ||
133 | |||
134 | TP_fast_assign( | ||
135 | __entry->vec = (int)(h - vec); | ||
136 | ), | ||
137 | |||
138 | TP_printk("softirq=%d action=%s", __entry->vec, | ||
139 | show_softirq_name(__entry->vec)) | ||
140 | ); | ||
141 | |||
142 | #endif /* _TRACE_IRQ_H */ | ||
143 | |||
144 | /* This part must be outside protection */ | ||
145 | #include <trace/define_trace.h> | ||
diff --git a/include/trace/events/kmem.h b/include/trace/events/kmem.h new file mode 100644 index 000000000000..9baba50d6512 --- /dev/null +++ b/include/trace/events/kmem.h | |||
@@ -0,0 +1,231 @@ | |||
1 | #if !defined(_TRACE_KMEM_H) || defined(TRACE_HEADER_MULTI_READ) | ||
2 | #define _TRACE_KMEM_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | #include <linux/tracepoint.h> | ||
6 | |||
7 | #undef TRACE_SYSTEM | ||
8 | #define TRACE_SYSTEM kmem | ||
9 | |||
10 | /* | ||
11 | * The order of these masks is important. Matching masks will be seen | ||
12 | * first and the left over flags will end up showing by themselves. | ||
13 | * | ||
14 | * For example, if we have GFP_KERNEL before GFP_USER we wil get: | ||
15 | * | ||
16 | * GFP_KERNEL|GFP_HARDWALL | ||
17 | * | ||
18 | * Thus most bits set go first. | ||
19 | */ | ||
20 | #define show_gfp_flags(flags) \ | ||
21 | (flags) ? __print_flags(flags, "|", \ | ||
22 | {(unsigned long)GFP_HIGHUSER_MOVABLE, "GFP_HIGHUSER_MOVABLE"}, \ | ||
23 | {(unsigned long)GFP_HIGHUSER, "GFP_HIGHUSER"}, \ | ||
24 | {(unsigned long)GFP_USER, "GFP_USER"}, \ | ||
25 | {(unsigned long)GFP_TEMPORARY, "GFP_TEMPORARY"}, \ | ||
26 | {(unsigned long)GFP_KERNEL, "GFP_KERNEL"}, \ | ||
27 | {(unsigned long)GFP_NOFS, "GFP_NOFS"}, \ | ||
28 | {(unsigned long)GFP_ATOMIC, "GFP_ATOMIC"}, \ | ||
29 | {(unsigned long)GFP_NOIO, "GFP_NOIO"}, \ | ||
30 | {(unsigned long)__GFP_HIGH, "GFP_HIGH"}, \ | ||
31 | {(unsigned long)__GFP_WAIT, "GFP_WAIT"}, \ | ||
32 | {(unsigned long)__GFP_IO, "GFP_IO"}, \ | ||
33 | {(unsigned long)__GFP_COLD, "GFP_COLD"}, \ | ||
34 | {(unsigned long)__GFP_NOWARN, "GFP_NOWARN"}, \ | ||
35 | {(unsigned long)__GFP_REPEAT, "GFP_REPEAT"}, \ | ||
36 | {(unsigned long)__GFP_NOFAIL, "GFP_NOFAIL"}, \ | ||
37 | {(unsigned long)__GFP_NORETRY, "GFP_NORETRY"}, \ | ||
38 | {(unsigned long)__GFP_COMP, "GFP_COMP"}, \ | ||
39 | {(unsigned long)__GFP_ZERO, "GFP_ZERO"}, \ | ||
40 | {(unsigned long)__GFP_NOMEMALLOC, "GFP_NOMEMALLOC"}, \ | ||
41 | {(unsigned long)__GFP_HARDWALL, "GFP_HARDWALL"}, \ | ||
42 | {(unsigned long)__GFP_THISNODE, "GFP_THISNODE"}, \ | ||
43 | {(unsigned long)__GFP_RECLAIMABLE, "GFP_RECLAIMABLE"}, \ | ||
44 | {(unsigned long)__GFP_MOVABLE, "GFP_MOVABLE"} \ | ||
45 | ) : "GFP_NOWAIT" | ||
46 | |||
47 | TRACE_EVENT(kmalloc, | ||
48 | |||
49 | TP_PROTO(unsigned long call_site, | ||
50 | const void *ptr, | ||
51 | size_t bytes_req, | ||
52 | size_t bytes_alloc, | ||
53 | gfp_t gfp_flags), | ||
54 | |||
55 | TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags), | ||
56 | |||
57 | TP_STRUCT__entry( | ||
58 | __field( unsigned long, call_site ) | ||
59 | __field( const void *, ptr ) | ||
60 | __field( size_t, bytes_req ) | ||
61 | __field( size_t, bytes_alloc ) | ||
62 | __field( gfp_t, gfp_flags ) | ||
63 | ), | ||
64 | |||
65 | TP_fast_assign( | ||
66 | __entry->call_site = call_site; | ||
67 | __entry->ptr = ptr; | ||
68 | __entry->bytes_req = bytes_req; | ||
69 | __entry->bytes_alloc = bytes_alloc; | ||
70 | __entry->gfp_flags = gfp_flags; | ||
71 | ), | ||
72 | |||
73 | TP_printk("call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%s", | ||
74 | __entry->call_site, | ||
75 | __entry->ptr, | ||
76 | __entry->bytes_req, | ||
77 | __entry->bytes_alloc, | ||
78 | show_gfp_flags(__entry->gfp_flags)) | ||
79 | ); | ||
80 | |||
81 | TRACE_EVENT(kmem_cache_alloc, | ||
82 | |||
83 | TP_PROTO(unsigned long call_site, | ||
84 | const void *ptr, | ||
85 | size_t bytes_req, | ||
86 | size_t bytes_alloc, | ||
87 | gfp_t gfp_flags), | ||
88 | |||
89 | TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags), | ||
90 | |||
91 | TP_STRUCT__entry( | ||
92 | __field( unsigned long, call_site ) | ||
93 | __field( const void *, ptr ) | ||
94 | __field( size_t, bytes_req ) | ||
95 | __field( size_t, bytes_alloc ) | ||
96 | __field( gfp_t, gfp_flags ) | ||
97 | ), | ||
98 | |||
99 | TP_fast_assign( | ||
100 | __entry->call_site = call_site; | ||
101 | __entry->ptr = ptr; | ||
102 | __entry->bytes_req = bytes_req; | ||
103 | __entry->bytes_alloc = bytes_alloc; | ||
104 | __entry->gfp_flags = gfp_flags; | ||
105 | ), | ||
106 | |||
107 | TP_printk("call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%s", | ||
108 | __entry->call_site, | ||
109 | __entry->ptr, | ||
110 | __entry->bytes_req, | ||
111 | __entry->bytes_alloc, | ||
112 | show_gfp_flags(__entry->gfp_flags)) | ||
113 | ); | ||
114 | |||
115 | TRACE_EVENT(kmalloc_node, | ||
116 | |||
117 | TP_PROTO(unsigned long call_site, | ||
118 | const void *ptr, | ||
119 | size_t bytes_req, | ||
120 | size_t bytes_alloc, | ||
121 | gfp_t gfp_flags, | ||
122 | int node), | ||
123 | |||
124 | TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags, node), | ||
125 | |||
126 | TP_STRUCT__entry( | ||
127 | __field( unsigned long, call_site ) | ||
128 | __field( const void *, ptr ) | ||
129 | __field( size_t, bytes_req ) | ||
130 | __field( size_t, bytes_alloc ) | ||
131 | __field( gfp_t, gfp_flags ) | ||
132 | __field( int, node ) | ||
133 | ), | ||
134 | |||
135 | TP_fast_assign( | ||
136 | __entry->call_site = call_site; | ||
137 | __entry->ptr = ptr; | ||
138 | __entry->bytes_req = bytes_req; | ||
139 | __entry->bytes_alloc = bytes_alloc; | ||
140 | __entry->gfp_flags = gfp_flags; | ||
141 | __entry->node = node; | ||
142 | ), | ||
143 | |||
144 | TP_printk("call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%s node=%d", | ||
145 | __entry->call_site, | ||
146 | __entry->ptr, | ||
147 | __entry->bytes_req, | ||
148 | __entry->bytes_alloc, | ||
149 | show_gfp_flags(__entry->gfp_flags), | ||
150 | __entry->node) | ||
151 | ); | ||
152 | |||
153 | TRACE_EVENT(kmem_cache_alloc_node, | ||
154 | |||
155 | TP_PROTO(unsigned long call_site, | ||
156 | const void *ptr, | ||
157 | size_t bytes_req, | ||
158 | size_t bytes_alloc, | ||
159 | gfp_t gfp_flags, | ||
160 | int node), | ||
161 | |||
162 | TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags, node), | ||
163 | |||
164 | TP_STRUCT__entry( | ||
165 | __field( unsigned long, call_site ) | ||
166 | __field( const void *, ptr ) | ||
167 | __field( size_t, bytes_req ) | ||
168 | __field( size_t, bytes_alloc ) | ||
169 | __field( gfp_t, gfp_flags ) | ||
170 | __field( int, node ) | ||
171 | ), | ||
172 | |||
173 | TP_fast_assign( | ||
174 | __entry->call_site = call_site; | ||
175 | __entry->ptr = ptr; | ||
176 | __entry->bytes_req = bytes_req; | ||
177 | __entry->bytes_alloc = bytes_alloc; | ||
178 | __entry->gfp_flags = gfp_flags; | ||
179 | __entry->node = node; | ||
180 | ), | ||
181 | |||
182 | TP_printk("call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%s node=%d", | ||
183 | __entry->call_site, | ||
184 | __entry->ptr, | ||
185 | __entry->bytes_req, | ||
186 | __entry->bytes_alloc, | ||
187 | show_gfp_flags(__entry->gfp_flags), | ||
188 | __entry->node) | ||
189 | ); | ||
190 | |||
191 | TRACE_EVENT(kfree, | ||
192 | |||
193 | TP_PROTO(unsigned long call_site, const void *ptr), | ||
194 | |||
195 | TP_ARGS(call_site, ptr), | ||
196 | |||
197 | TP_STRUCT__entry( | ||
198 | __field( unsigned long, call_site ) | ||
199 | __field( const void *, ptr ) | ||
200 | ), | ||
201 | |||
202 | TP_fast_assign( | ||
203 | __entry->call_site = call_site; | ||
204 | __entry->ptr = ptr; | ||
205 | ), | ||
206 | |||
207 | TP_printk("call_site=%lx ptr=%p", __entry->call_site, __entry->ptr) | ||
208 | ); | ||
209 | |||
210 | TRACE_EVENT(kmem_cache_free, | ||
211 | |||
212 | TP_PROTO(unsigned long call_site, const void *ptr), | ||
213 | |||
214 | TP_ARGS(call_site, ptr), | ||
215 | |||
216 | TP_STRUCT__entry( | ||
217 | __field( unsigned long, call_site ) | ||
218 | __field( const void *, ptr ) | ||
219 | ), | ||
220 | |||
221 | TP_fast_assign( | ||
222 | __entry->call_site = call_site; | ||
223 | __entry->ptr = ptr; | ||
224 | ), | ||
225 | |||
226 | TP_printk("call_site=%lx ptr=%p", __entry->call_site, __entry->ptr) | ||
227 | ); | ||
228 | #endif /* _TRACE_KMEM_H */ | ||
229 | |||
230 | /* This part must be outside protection */ | ||
231 | #include <trace/define_trace.h> | ||
diff --git a/include/trace/events/lockdep.h b/include/trace/events/lockdep.h new file mode 100644 index 000000000000..0e956c9dfd7e --- /dev/null +++ b/include/trace/events/lockdep.h | |||
@@ -0,0 +1,96 @@ | |||
1 | #if !defined(_TRACE_LOCKDEP_H) || defined(TRACE_HEADER_MULTI_READ) | ||
2 | #define _TRACE_LOCKDEP_H | ||
3 | |||
4 | #include <linux/lockdep.h> | ||
5 | #include <linux/tracepoint.h> | ||
6 | |||
7 | #undef TRACE_SYSTEM | ||
8 | #define TRACE_SYSTEM lockdep | ||
9 | |||
10 | #ifdef CONFIG_LOCKDEP | ||
11 | |||
12 | TRACE_EVENT(lock_acquire, | ||
13 | |||
14 | TP_PROTO(struct lockdep_map *lock, unsigned int subclass, | ||
15 | int trylock, int read, int check, | ||
16 | struct lockdep_map *next_lock, unsigned long ip), | ||
17 | |||
18 | TP_ARGS(lock, subclass, trylock, read, check, next_lock, ip), | ||
19 | |||
20 | TP_STRUCT__entry( | ||
21 | __field(unsigned int, flags) | ||
22 | __string(name, lock->name) | ||
23 | ), | ||
24 | |||
25 | TP_fast_assign( | ||
26 | __entry->flags = (trylock ? 1 : 0) | (read ? 2 : 0); | ||
27 | __assign_str(name, lock->name); | ||
28 | ), | ||
29 | |||
30 | TP_printk("%s%s%s", (__entry->flags & 1) ? "try " : "", | ||
31 | (__entry->flags & 2) ? "read " : "", | ||
32 | __get_str(name)) | ||
33 | ); | ||
34 | |||
35 | TRACE_EVENT(lock_release, | ||
36 | |||
37 | TP_PROTO(struct lockdep_map *lock, int nested, unsigned long ip), | ||
38 | |||
39 | TP_ARGS(lock, nested, ip), | ||
40 | |||
41 | TP_STRUCT__entry( | ||
42 | __string(name, lock->name) | ||
43 | ), | ||
44 | |||
45 | TP_fast_assign( | ||
46 | __assign_str(name, lock->name); | ||
47 | ), | ||
48 | |||
49 | TP_printk("%s", __get_str(name)) | ||
50 | ); | ||
51 | |||
52 | #ifdef CONFIG_LOCK_STAT | ||
53 | |||
54 | TRACE_EVENT(lock_contended, | ||
55 | |||
56 | TP_PROTO(struct lockdep_map *lock, unsigned long ip), | ||
57 | |||
58 | TP_ARGS(lock, ip), | ||
59 | |||
60 | TP_STRUCT__entry( | ||
61 | __string(name, lock->name) | ||
62 | ), | ||
63 | |||
64 | TP_fast_assign( | ||
65 | __assign_str(name, lock->name); | ||
66 | ), | ||
67 | |||
68 | TP_printk("%s", __get_str(name)) | ||
69 | ); | ||
70 | |||
71 | TRACE_EVENT(lock_acquired, | ||
72 | TP_PROTO(struct lockdep_map *lock, unsigned long ip, s64 waittime), | ||
73 | |||
74 | TP_ARGS(lock, ip, waittime), | ||
75 | |||
76 | TP_STRUCT__entry( | ||
77 | __string(name, lock->name) | ||
78 | __field(unsigned long, wait_usec) | ||
79 | __field(unsigned long, wait_nsec_rem) | ||
80 | ), | ||
81 | TP_fast_assign( | ||
82 | __assign_str(name, lock->name); | ||
83 | __entry->wait_nsec_rem = do_div(waittime, NSEC_PER_USEC); | ||
84 | __entry->wait_usec = (unsigned long) waittime; | ||
85 | ), | ||
86 | TP_printk("%s (%lu.%03lu us)", __get_str(name), __entry->wait_usec, | ||
87 | __entry->wait_nsec_rem) | ||
88 | ); | ||
89 | |||
90 | #endif | ||
91 | #endif | ||
92 | |||
93 | #endif /* _TRACE_LOCKDEP_H */ | ||
94 | |||
95 | /* This part must be outside protection */ | ||
96 | #include <trace/define_trace.h> | ||
diff --git a/include/trace/sched_event_types.h b/include/trace/events/sched.h index 63547dc1125f..24ab5bcff7b2 100644 --- a/include/trace/sched_event_types.h +++ b/include/trace/events/sched.h | |||
@@ -1,9 +1,8 @@ | |||
1 | #if !defined(_TRACE_SCHED_H) || defined(TRACE_HEADER_MULTI_READ) | ||
2 | #define _TRACE_SCHED_H | ||
1 | 3 | ||
2 | /* use <trace/sched.h> instead */ | 4 | #include <linux/sched.h> |
3 | #ifndef TRACE_EVENT | 5 | #include <linux/tracepoint.h> |
4 | # error Do not include this file directly. | ||
5 | # error Unless you know what you are doing. | ||
6 | #endif | ||
7 | 6 | ||
8 | #undef TRACE_SYSTEM | 7 | #undef TRACE_SYSTEM |
9 | #define TRACE_SYSTEM sched | 8 | #define TRACE_SYSTEM sched |
@@ -157,6 +156,7 @@ TRACE_EVENT(sched_switch, | |||
157 | __array( char, prev_comm, TASK_COMM_LEN ) | 156 | __array( char, prev_comm, TASK_COMM_LEN ) |
158 | __field( pid_t, prev_pid ) | 157 | __field( pid_t, prev_pid ) |
159 | __field( int, prev_prio ) | 158 | __field( int, prev_prio ) |
159 | __field( long, prev_state ) | ||
160 | __array( char, next_comm, TASK_COMM_LEN ) | 160 | __array( char, next_comm, TASK_COMM_LEN ) |
161 | __field( pid_t, next_pid ) | 161 | __field( pid_t, next_pid ) |
162 | __field( int, next_prio ) | 162 | __field( int, next_prio ) |
@@ -166,13 +166,19 @@ TRACE_EVENT(sched_switch, | |||
166 | memcpy(__entry->next_comm, next->comm, TASK_COMM_LEN); | 166 | memcpy(__entry->next_comm, next->comm, TASK_COMM_LEN); |
167 | __entry->prev_pid = prev->pid; | 167 | __entry->prev_pid = prev->pid; |
168 | __entry->prev_prio = prev->prio; | 168 | __entry->prev_prio = prev->prio; |
169 | __entry->prev_state = prev->state; | ||
169 | memcpy(__entry->prev_comm, prev->comm, TASK_COMM_LEN); | 170 | memcpy(__entry->prev_comm, prev->comm, TASK_COMM_LEN); |
170 | __entry->next_pid = next->pid; | 171 | __entry->next_pid = next->pid; |
171 | __entry->next_prio = next->prio; | 172 | __entry->next_prio = next->prio; |
172 | ), | 173 | ), |
173 | 174 | ||
174 | TP_printk("task %s:%d [%d] ==> %s:%d [%d]", | 175 | TP_printk("task %s:%d [%d] (%s) ==> %s:%d [%d]", |
175 | __entry->prev_comm, __entry->prev_pid, __entry->prev_prio, | 176 | __entry->prev_comm, __entry->prev_pid, __entry->prev_prio, |
177 | __entry->prev_state ? | ||
178 | __print_flags(__entry->prev_state, "|", | ||
179 | { 1, "S"} , { 2, "D" }, { 4, "T" }, { 8, "t" }, | ||
180 | { 16, "Z" }, { 32, "X" }, { 64, "x" }, | ||
181 | { 128, "W" }) : "R", | ||
176 | __entry->next_comm, __entry->next_pid, __entry->next_prio) | 182 | __entry->next_comm, __entry->next_pid, __entry->next_prio) |
177 | ); | 183 | ); |
178 | 184 | ||
@@ -181,9 +187,9 @@ TRACE_EVENT(sched_switch, | |||
181 | */ | 187 | */ |
182 | TRACE_EVENT(sched_migrate_task, | 188 | TRACE_EVENT(sched_migrate_task, |
183 | 189 | ||
184 | TP_PROTO(struct task_struct *p, int orig_cpu, int dest_cpu), | 190 | TP_PROTO(struct task_struct *p, int dest_cpu), |
185 | 191 | ||
186 | TP_ARGS(p, orig_cpu, dest_cpu), | 192 | TP_ARGS(p, dest_cpu), |
187 | 193 | ||
188 | TP_STRUCT__entry( | 194 | TP_STRUCT__entry( |
189 | __array( char, comm, TASK_COMM_LEN ) | 195 | __array( char, comm, TASK_COMM_LEN ) |
@@ -197,7 +203,7 @@ TRACE_EVENT(sched_migrate_task, | |||
197 | memcpy(__entry->comm, p->comm, TASK_COMM_LEN); | 203 | memcpy(__entry->comm, p->comm, TASK_COMM_LEN); |
198 | __entry->pid = p->pid; | 204 | __entry->pid = p->pid; |
199 | __entry->prio = p->prio; | 205 | __entry->prio = p->prio; |
200 | __entry->orig_cpu = orig_cpu; | 206 | __entry->orig_cpu = task_cpu(p); |
201 | __entry->dest_cpu = dest_cpu; | 207 | __entry->dest_cpu = dest_cpu; |
202 | ), | 208 | ), |
203 | 209 | ||
@@ -334,4 +340,7 @@ TRACE_EVENT(sched_signal_send, | |||
334 | __entry->sig, __entry->comm, __entry->pid) | 340 | __entry->sig, __entry->comm, __entry->pid) |
335 | ); | 341 | ); |
336 | 342 | ||
337 | #undef TRACE_SYSTEM | 343 | #endif /* _TRACE_SCHED_H */ |
344 | |||
345 | /* This part must be outside protection */ | ||
346 | #include <trace/define_trace.h> | ||
diff --git a/include/trace/events/skb.h b/include/trace/events/skb.h new file mode 100644 index 000000000000..1e8fabb57c06 --- /dev/null +++ b/include/trace/events/skb.h | |||
@@ -0,0 +1,40 @@ | |||
1 | #if !defined(_TRACE_SKB_H) || defined(TRACE_HEADER_MULTI_READ) | ||
2 | #define _TRACE_SKB_H | ||
3 | |||
4 | #include <linux/skbuff.h> | ||
5 | #include <linux/tracepoint.h> | ||
6 | |||
7 | #undef TRACE_SYSTEM | ||
8 | #define TRACE_SYSTEM skb | ||
9 | |||
10 | /* | ||
11 | * Tracepoint for free an sk_buff: | ||
12 | */ | ||
13 | TRACE_EVENT(kfree_skb, | ||
14 | |||
15 | TP_PROTO(struct sk_buff *skb, void *location), | ||
16 | |||
17 | TP_ARGS(skb, location), | ||
18 | |||
19 | TP_STRUCT__entry( | ||
20 | __field( void *, skbaddr ) | ||
21 | __field( unsigned short, protocol ) | ||
22 | __field( void *, location ) | ||
23 | ), | ||
24 | |||
25 | TP_fast_assign( | ||
26 | __entry->skbaddr = skb; | ||
27 | if (skb) { | ||
28 | __entry->protocol = ntohs(skb->protocol); | ||
29 | } | ||
30 | __entry->location = location; | ||
31 | ), | ||
32 | |||
33 | TP_printk("skbaddr=%p protocol=%u location=%p", | ||
34 | __entry->skbaddr, __entry->protocol, __entry->location) | ||
35 | ); | ||
36 | |||
37 | #endif /* _TRACE_SKB_H */ | ||
38 | |||
39 | /* This part must be outside protection */ | ||
40 | #include <trace/define_trace.h> | ||
diff --git a/include/trace/events/workqueue.h b/include/trace/events/workqueue.h new file mode 100644 index 000000000000..035f1bff288e --- /dev/null +++ b/include/trace/events/workqueue.h | |||
@@ -0,0 +1,100 @@ | |||
1 | #if !defined(_TRACE_WORKQUEUE_H) || defined(TRACE_HEADER_MULTI_READ) | ||
2 | #define _TRACE_WORKQUEUE_H | ||
3 | |||
4 | #include <linux/workqueue.h> | ||
5 | #include <linux/sched.h> | ||
6 | #include <linux/tracepoint.h> | ||
7 | |||
8 | #undef TRACE_SYSTEM | ||
9 | #define TRACE_SYSTEM workqueue | ||
10 | |||
11 | TRACE_EVENT(workqueue_insertion, | ||
12 | |||
13 | TP_PROTO(struct task_struct *wq_thread, struct work_struct *work), | ||
14 | |||
15 | TP_ARGS(wq_thread, work), | ||
16 | |||
17 | TP_STRUCT__entry( | ||
18 | __array(char, thread_comm, TASK_COMM_LEN) | ||
19 | __field(pid_t, thread_pid) | ||
20 | __field(work_func_t, func) | ||
21 | ), | ||
22 | |||
23 | TP_fast_assign( | ||
24 | memcpy(__entry->thread_comm, wq_thread->comm, TASK_COMM_LEN); | ||
25 | __entry->thread_pid = wq_thread->pid; | ||
26 | __entry->func = work->func; | ||
27 | ), | ||
28 | |||
29 | TP_printk("thread=%s:%d func=%pF", __entry->thread_comm, | ||
30 | __entry->thread_pid, __entry->func) | ||
31 | ); | ||
32 | |||
33 | TRACE_EVENT(workqueue_execution, | ||
34 | |||
35 | TP_PROTO(struct task_struct *wq_thread, struct work_struct *work), | ||
36 | |||
37 | TP_ARGS(wq_thread, work), | ||
38 | |||
39 | TP_STRUCT__entry( | ||
40 | __array(char, thread_comm, TASK_COMM_LEN) | ||
41 | __field(pid_t, thread_pid) | ||
42 | __field(work_func_t, func) | ||
43 | ), | ||
44 | |||
45 | TP_fast_assign( | ||
46 | memcpy(__entry->thread_comm, wq_thread->comm, TASK_COMM_LEN); | ||
47 | __entry->thread_pid = wq_thread->pid; | ||
48 | __entry->func = work->func; | ||
49 | ), | ||
50 | |||
51 | TP_printk("thread=%s:%d func=%pF", __entry->thread_comm, | ||
52 | __entry->thread_pid, __entry->func) | ||
53 | ); | ||
54 | |||
55 | /* Trace the creation of one workqueue thread on a cpu */ | ||
56 | TRACE_EVENT(workqueue_creation, | ||
57 | |||
58 | TP_PROTO(struct task_struct *wq_thread, int cpu), | ||
59 | |||
60 | TP_ARGS(wq_thread, cpu), | ||
61 | |||
62 | TP_STRUCT__entry( | ||
63 | __array(char, thread_comm, TASK_COMM_LEN) | ||
64 | __field(pid_t, thread_pid) | ||
65 | __field(int, cpu) | ||
66 | ), | ||
67 | |||
68 | TP_fast_assign( | ||
69 | memcpy(__entry->thread_comm, wq_thread->comm, TASK_COMM_LEN); | ||
70 | __entry->thread_pid = wq_thread->pid; | ||
71 | __entry->cpu = cpu; | ||
72 | ), | ||
73 | |||
74 | TP_printk("thread=%s:%d cpu=%d", __entry->thread_comm, | ||
75 | __entry->thread_pid, __entry->cpu) | ||
76 | ); | ||
77 | |||
78 | TRACE_EVENT(workqueue_destruction, | ||
79 | |||
80 | TP_PROTO(struct task_struct *wq_thread), | ||
81 | |||
82 | TP_ARGS(wq_thread), | ||
83 | |||
84 | TP_STRUCT__entry( | ||
85 | __array(char, thread_comm, TASK_COMM_LEN) | ||
86 | __field(pid_t, thread_pid) | ||
87 | ), | ||
88 | |||
89 | TP_fast_assign( | ||
90 | memcpy(__entry->thread_comm, wq_thread->comm, TASK_COMM_LEN); | ||
91 | __entry->thread_pid = wq_thread->pid; | ||
92 | ), | ||
93 | |||
94 | TP_printk("thread=%s:%d", __entry->thread_comm, __entry->thread_pid) | ||
95 | ); | ||
96 | |||
97 | #endif /* _TRACE_WORKQUEUE_H */ | ||
98 | |||
99 | /* This part must be outside protection */ | ||
100 | #include <trace/define_trace.h> | ||
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h new file mode 100644 index 000000000000..1867553c61e5 --- /dev/null +++ b/include/trace/ftrace.h | |||
@@ -0,0 +1,591 @@ | |||
1 | /* | ||
2 | * Stage 1 of the trace events. | ||
3 | * | ||
4 | * Override the macros in <trace/trace_events.h> to include the following: | ||
5 | * | ||
6 | * struct ftrace_raw_<call> { | ||
7 | * struct trace_entry ent; | ||
8 | * <type> <item>; | ||
9 | * <type2> <item2>[<len>]; | ||
10 | * [...] | ||
11 | * }; | ||
12 | * | ||
13 | * The <type> <item> is created by the __field(type, item) macro or | ||
14 | * the __array(type2, item2, len) macro. | ||
15 | * We simply do "type item;", and that will create the fields | ||
16 | * in the structure. | ||
17 | */ | ||
18 | |||
19 | #include <linux/ftrace_event.h> | ||
20 | |||
21 | #undef __field | ||
22 | #define __field(type, item) type item; | ||
23 | |||
24 | #undef __array | ||
25 | #define __array(type, item, len) type item[len]; | ||
26 | |||
27 | #undef __dynamic_array | ||
28 | #define __dynamic_array(type, item, len) unsigned short __data_loc_##item; | ||
29 | |||
30 | #undef __string | ||
31 | #define __string(item, src) __dynamic_array(char, item, -1) | ||
32 | |||
33 | #undef TP_STRUCT__entry | ||
34 | #define TP_STRUCT__entry(args...) args | ||
35 | |||
36 | #undef TRACE_EVENT | ||
37 | #define TRACE_EVENT(name, proto, args, tstruct, assign, print) \ | ||
38 | struct ftrace_raw_##name { \ | ||
39 | struct trace_entry ent; \ | ||
40 | tstruct \ | ||
41 | char __data[0]; \ | ||
42 | }; \ | ||
43 | static struct ftrace_event_call event_##name | ||
44 | |||
45 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | ||
46 | |||
47 | |||
48 | /* | ||
49 | * Stage 2 of the trace events. | ||
50 | * | ||
51 | * Include the following: | ||
52 | * | ||
53 | * struct ftrace_data_offsets_<call> { | ||
54 | * int <item1>; | ||
55 | * int <item2>; | ||
56 | * [...] | ||
57 | * }; | ||
58 | * | ||
59 | * The __dynamic_array() macro will create each int <item>, this is | ||
60 | * to keep the offset of each array from the beginning of the event. | ||
61 | */ | ||
62 | |||
63 | #undef __field | ||
64 | #define __field(type, item); | ||
65 | |||
66 | #undef __array | ||
67 | #define __array(type, item, len) | ||
68 | |||
69 | #undef __dynamic_array | ||
70 | #define __dynamic_array(type, item, len) int item; | ||
71 | |||
72 | #undef __string | ||
73 | #define __string(item, src) __dynamic_array(char, item, -1) | ||
74 | |||
75 | #undef TRACE_EVENT | ||
76 | #define TRACE_EVENT(call, proto, args, tstruct, assign, print) \ | ||
77 | struct ftrace_data_offsets_##call { \ | ||
78 | tstruct; \ | ||
79 | }; | ||
80 | |||
81 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | ||
82 | |||
83 | /* | ||
84 | * Setup the showing format of trace point. | ||
85 | * | ||
86 | * int | ||
87 | * ftrace_format_##call(struct trace_seq *s) | ||
88 | * { | ||
89 | * struct ftrace_raw_##call field; | ||
90 | * int ret; | ||
91 | * | ||
92 | * ret = trace_seq_printf(s, #type " " #item ";" | ||
93 | * " offset:%u; size:%u;\n", | ||
94 | * offsetof(struct ftrace_raw_##call, item), | ||
95 | * sizeof(field.type)); | ||
96 | * | ||
97 | * } | ||
98 | */ | ||
99 | |||
100 | #undef TP_STRUCT__entry | ||
101 | #define TP_STRUCT__entry(args...) args | ||
102 | |||
103 | #undef __field | ||
104 | #define __field(type, item) \ | ||
105 | ret = trace_seq_printf(s, "\tfield:" #type " " #item ";\t" \ | ||
106 | "offset:%u;\tsize:%u;\n", \ | ||
107 | (unsigned int)offsetof(typeof(field), item), \ | ||
108 | (unsigned int)sizeof(field.item)); \ | ||
109 | if (!ret) \ | ||
110 | return 0; | ||
111 | |||
112 | #undef __array | ||
113 | #define __array(type, item, len) \ | ||
114 | ret = trace_seq_printf(s, "\tfield:" #type " " #item "[" #len "];\t" \ | ||
115 | "offset:%u;\tsize:%u;\n", \ | ||
116 | (unsigned int)offsetof(typeof(field), item), \ | ||
117 | (unsigned int)sizeof(field.item)); \ | ||
118 | if (!ret) \ | ||
119 | return 0; | ||
120 | |||
121 | #undef __dynamic_array | ||
122 | #define __dynamic_array(type, item, len) \ | ||
123 | ret = trace_seq_printf(s, "\tfield:__data_loc " #item ";\t" \ | ||
124 | "offset:%u;\tsize:%u;\n", \ | ||
125 | (unsigned int)offsetof(typeof(field), \ | ||
126 | __data_loc_##item), \ | ||
127 | (unsigned int)sizeof(field.__data_loc_##item)); \ | ||
128 | if (!ret) \ | ||
129 | return 0; | ||
130 | |||
131 | #undef __string | ||
132 | #define __string(item, src) __dynamic_array(char, item, -1) | ||
133 | |||
134 | #undef __entry | ||
135 | #define __entry REC | ||
136 | |||
137 | #undef __print_symbolic | ||
138 | #undef __get_dynamic_array | ||
139 | #undef __get_str | ||
140 | |||
141 | #undef TP_printk | ||
142 | #define TP_printk(fmt, args...) "%s, %s\n", #fmt, __stringify(args) | ||
143 | |||
144 | #undef TP_fast_assign | ||
145 | #define TP_fast_assign(args...) args | ||
146 | |||
147 | #undef TRACE_EVENT | ||
148 | #define TRACE_EVENT(call, proto, args, tstruct, func, print) \ | ||
149 | static int \ | ||
150 | ftrace_format_##call(struct trace_seq *s) \ | ||
151 | { \ | ||
152 | struct ftrace_raw_##call field __attribute__((unused)); \ | ||
153 | int ret = 0; \ | ||
154 | \ | ||
155 | tstruct; \ | ||
156 | \ | ||
157 | trace_seq_printf(s, "\nprint fmt: " print); \ | ||
158 | \ | ||
159 | return ret; \ | ||
160 | } | ||
161 | |||
162 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | ||
163 | |||
164 | /* | ||
165 | * Stage 3 of the trace events. | ||
166 | * | ||
167 | * Override the macros in <trace/trace_events.h> to include the following: | ||
168 | * | ||
169 | * enum print_line_t | ||
170 | * ftrace_raw_output_<call>(struct trace_iterator *iter, int flags) | ||
171 | * { | ||
172 | * struct trace_seq *s = &iter->seq; | ||
173 | * struct ftrace_raw_<call> *field; <-- defined in stage 1 | ||
174 | * struct trace_entry *entry; | ||
175 | * struct trace_seq *p; | ||
176 | * int ret; | ||
177 | * | ||
178 | * entry = iter->ent; | ||
179 | * | ||
180 | * if (entry->type != event_<call>.id) { | ||
181 | * WARN_ON_ONCE(1); | ||
182 | * return TRACE_TYPE_UNHANDLED; | ||
183 | * } | ||
184 | * | ||
185 | * field = (typeof(field))entry; | ||
186 | * | ||
187 | * p = get_cpu_var(ftrace_event_seq); | ||
188 | * trace_seq_init(p); | ||
189 | * ret = trace_seq_printf(s, <TP_printk> "\n"); | ||
190 | * put_cpu(); | ||
191 | * if (!ret) | ||
192 | * return TRACE_TYPE_PARTIAL_LINE; | ||
193 | * | ||
194 | * return TRACE_TYPE_HANDLED; | ||
195 | * } | ||
196 | * | ||
197 | * This is the method used to print the raw event to the trace | ||
198 | * output format. Note, this is not needed if the data is read | ||
199 | * in binary. | ||
200 | */ | ||
201 | |||
202 | #undef __entry | ||
203 | #define __entry field | ||
204 | |||
205 | #undef TP_printk | ||
206 | #define TP_printk(fmt, args...) fmt "\n", args | ||
207 | |||
208 | #undef __get_dynamic_array | ||
209 | #define __get_dynamic_array(field) \ | ||
210 | ((void *)__entry + __entry->__data_loc_##field) | ||
211 | |||
212 | #undef __get_str | ||
213 | #define __get_str(field) (char *)__get_dynamic_array(field) | ||
214 | |||
215 | #undef __print_flags | ||
216 | #define __print_flags(flag, delim, flag_array...) \ | ||
217 | ({ \ | ||
218 | static const struct trace_print_flags flags[] = \ | ||
219 | { flag_array, { -1, NULL }}; \ | ||
220 | ftrace_print_flags_seq(p, delim, flag, flags); \ | ||
221 | }) | ||
222 | |||
223 | #undef __print_symbolic | ||
224 | #define __print_symbolic(value, symbol_array...) \ | ||
225 | ({ \ | ||
226 | static const struct trace_print_flags symbols[] = \ | ||
227 | { symbol_array, { -1, NULL }}; \ | ||
228 | ftrace_print_symbols_seq(p, value, symbols); \ | ||
229 | }) | ||
230 | |||
231 | #undef TRACE_EVENT | ||
232 | #define TRACE_EVENT(call, proto, args, tstruct, assign, print) \ | ||
233 | enum print_line_t \ | ||
234 | ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \ | ||
235 | { \ | ||
236 | struct trace_seq *s = &iter->seq; \ | ||
237 | struct ftrace_raw_##call *field; \ | ||
238 | struct trace_entry *entry; \ | ||
239 | struct trace_seq *p; \ | ||
240 | int ret; \ | ||
241 | \ | ||
242 | entry = iter->ent; \ | ||
243 | \ | ||
244 | if (entry->type != event_##call.id) { \ | ||
245 | WARN_ON_ONCE(1); \ | ||
246 | return TRACE_TYPE_UNHANDLED; \ | ||
247 | } \ | ||
248 | \ | ||
249 | field = (typeof(field))entry; \ | ||
250 | \ | ||
251 | p = &get_cpu_var(ftrace_event_seq); \ | ||
252 | trace_seq_init(p); \ | ||
253 | ret = trace_seq_printf(s, #call ": " print); \ | ||
254 | put_cpu(); \ | ||
255 | if (!ret) \ | ||
256 | return TRACE_TYPE_PARTIAL_LINE; \ | ||
257 | \ | ||
258 | return TRACE_TYPE_HANDLED; \ | ||
259 | } | ||
260 | |||
261 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | ||
262 | |||
263 | #undef __field | ||
264 | #define __field(type, item) \ | ||
265 | ret = trace_define_field(event_call, #type, #item, \ | ||
266 | offsetof(typeof(field), item), \ | ||
267 | sizeof(field.item), is_signed_type(type)); \ | ||
268 | if (ret) \ | ||
269 | return ret; | ||
270 | |||
271 | #undef __array | ||
272 | #define __array(type, item, len) \ | ||
273 | BUILD_BUG_ON(len > MAX_FILTER_STR_VAL); \ | ||
274 | ret = trace_define_field(event_call, #type "[" #len "]", #item, \ | ||
275 | offsetof(typeof(field), item), \ | ||
276 | sizeof(field.item), 0); \ | ||
277 | if (ret) \ | ||
278 | return ret; | ||
279 | |||
280 | #undef __dynamic_array | ||
281 | #define __dynamic_array(type, item, len) \ | ||
282 | ret = trace_define_field(event_call, "__data_loc" "[" #type "]", #item,\ | ||
283 | offsetof(typeof(field), __data_loc_##item), \ | ||
284 | sizeof(field.__data_loc_##item), 0); | ||
285 | |||
286 | #undef __string | ||
287 | #define __string(item, src) __dynamic_array(char, item, -1) | ||
288 | |||
289 | #undef TRACE_EVENT | ||
290 | #define TRACE_EVENT(call, proto, args, tstruct, func, print) \ | ||
291 | int \ | ||
292 | ftrace_define_fields_##call(void) \ | ||
293 | { \ | ||
294 | struct ftrace_raw_##call field; \ | ||
295 | struct ftrace_event_call *event_call = &event_##call; \ | ||
296 | int ret; \ | ||
297 | \ | ||
298 | __common_field(int, type, 1); \ | ||
299 | __common_field(unsigned char, flags, 0); \ | ||
300 | __common_field(unsigned char, preempt_count, 0); \ | ||
301 | __common_field(int, pid, 1); \ | ||
302 | __common_field(int, tgid, 1); \ | ||
303 | \ | ||
304 | tstruct; \ | ||
305 | \ | ||
306 | return ret; \ | ||
307 | } | ||
308 | |||
309 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | ||
310 | |||
311 | /* | ||
312 | * remember the offset of each array from the beginning of the event. | ||
313 | */ | ||
314 | |||
315 | #undef __entry | ||
316 | #define __entry entry | ||
317 | |||
318 | #undef __field | ||
319 | #define __field(type, item) | ||
320 | |||
321 | #undef __array | ||
322 | #define __array(type, item, len) | ||
323 | |||
324 | #undef __dynamic_array | ||
325 | #define __dynamic_array(type, item, len) \ | ||
326 | __data_offsets->item = __data_size + \ | ||
327 | offsetof(typeof(*entry), __data); \ | ||
328 | __data_size += (len) * sizeof(type); | ||
329 | |||
330 | #undef __string | ||
331 | #define __string(item, src) __dynamic_array(char, item, strlen(src) + 1) \ | ||
332 | |||
333 | #undef TRACE_EVENT | ||
334 | #define TRACE_EVENT(call, proto, args, tstruct, assign, print) \ | ||
335 | static inline int ftrace_get_offsets_##call( \ | ||
336 | struct ftrace_data_offsets_##call *__data_offsets, proto) \ | ||
337 | { \ | ||
338 | int __data_size = 0; \ | ||
339 | struct ftrace_raw_##call __maybe_unused *entry; \ | ||
340 | \ | ||
341 | tstruct; \ | ||
342 | \ | ||
343 | return __data_size; \ | ||
344 | } | ||
345 | |||
346 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | ||
347 | |||
348 | /* | ||
349 | * Stage 4 of the trace events. | ||
350 | * | ||
351 | * Override the macros in <trace/trace_events.h> to include the following: | ||
352 | * | ||
353 | * static void ftrace_event_<call>(proto) | ||
354 | * { | ||
355 | * event_trace_printk(_RET_IP_, "<call>: " <fmt>); | ||
356 | * } | ||
357 | * | ||
358 | * static int ftrace_reg_event_<call>(void) | ||
359 | * { | ||
360 | * int ret; | ||
361 | * | ||
362 | * ret = register_trace_<call>(ftrace_event_<call>); | ||
363 | * if (!ret) | ||
364 | * pr_info("event trace: Could not activate trace point " | ||
365 | * "probe to <call>"); | ||
366 | * return ret; | ||
367 | * } | ||
368 | * | ||
369 | * static void ftrace_unreg_event_<call>(void) | ||
370 | * { | ||
371 | * unregister_trace_<call>(ftrace_event_<call>); | ||
372 | * } | ||
373 | * | ||
374 | * | ||
375 | * For those macros defined with TRACE_EVENT: | ||
376 | * | ||
377 | * static struct ftrace_event_call event_<call>; | ||
378 | * | ||
379 | * static void ftrace_raw_event_<call>(proto) | ||
380 | * { | ||
381 | * struct ring_buffer_event *event; | ||
382 | * struct ftrace_raw_<call> *entry; <-- defined in stage 1 | ||
383 | * unsigned long irq_flags; | ||
384 | * int pc; | ||
385 | * | ||
386 | * local_save_flags(irq_flags); | ||
387 | * pc = preempt_count(); | ||
388 | * | ||
389 | * event = trace_current_buffer_lock_reserve(event_<call>.id, | ||
390 | * sizeof(struct ftrace_raw_<call>), | ||
391 | * irq_flags, pc); | ||
392 | * if (!event) | ||
393 | * return; | ||
394 | * entry = ring_buffer_event_data(event); | ||
395 | * | ||
396 | * <assign>; <-- Here we assign the entries by the __field and | ||
397 | * __array macros. | ||
398 | * | ||
399 | * trace_current_buffer_unlock_commit(event, irq_flags, pc); | ||
400 | * } | ||
401 | * | ||
402 | * static int ftrace_raw_reg_event_<call>(void) | ||
403 | * { | ||
404 | * int ret; | ||
405 | * | ||
406 | * ret = register_trace_<call>(ftrace_raw_event_<call>); | ||
407 | * if (!ret) | ||
408 | * pr_info("event trace: Could not activate trace point " | ||
409 | * "probe to <call>"); | ||
410 | * return ret; | ||
411 | * } | ||
412 | * | ||
413 | * static void ftrace_unreg_event_<call>(void) | ||
414 | * { | ||
415 | * unregister_trace_<call>(ftrace_raw_event_<call>); | ||
416 | * } | ||
417 | * | ||
418 | * static struct trace_event ftrace_event_type_<call> = { | ||
419 | * .trace = ftrace_raw_output_<call>, <-- stage 2 | ||
420 | * }; | ||
421 | * | ||
422 | * static int ftrace_raw_init_event_<call>(void) | ||
423 | * { | ||
424 | * int id; | ||
425 | * | ||
426 | * id = register_ftrace_event(&ftrace_event_type_<call>); | ||
427 | * if (!id) | ||
428 | * return -ENODEV; | ||
429 | * event_<call>.id = id; | ||
430 | * return 0; | ||
431 | * } | ||
432 | * | ||
433 | * static struct ftrace_event_call __used | ||
434 | * __attribute__((__aligned__(4))) | ||
435 | * __attribute__((section("_ftrace_events"))) event_<call> = { | ||
436 | * .name = "<call>", | ||
437 | * .system = "<system>", | ||
438 | * .raw_init = ftrace_raw_init_event_<call>, | ||
439 | * .regfunc = ftrace_reg_event_<call>, | ||
440 | * .unregfunc = ftrace_unreg_event_<call>, | ||
441 | * .show_format = ftrace_format_<call>, | ||
442 | * } | ||
443 | * | ||
444 | */ | ||
445 | |||
446 | #undef TP_FMT | ||
447 | #define TP_FMT(fmt, args...) fmt "\n", ##args | ||
448 | |||
449 | #ifdef CONFIG_EVENT_PROFILE | ||
450 | #define _TRACE_PROFILE(call, proto, args) \ | ||
451 | static void ftrace_profile_##call(proto) \ | ||
452 | { \ | ||
453 | extern void perf_tpcounter_event(int); \ | ||
454 | perf_tpcounter_event(event_##call.id); \ | ||
455 | } \ | ||
456 | \ | ||
457 | static int ftrace_profile_enable_##call(struct ftrace_event_call *event_call) \ | ||
458 | { \ | ||
459 | int ret = 0; \ | ||
460 | \ | ||
461 | if (!atomic_inc_return(&event_call->profile_count)) \ | ||
462 | ret = register_trace_##call(ftrace_profile_##call); \ | ||
463 | \ | ||
464 | return ret; \ | ||
465 | } \ | ||
466 | \ | ||
467 | static void ftrace_profile_disable_##call(struct ftrace_event_call *event_call)\ | ||
468 | { \ | ||
469 | if (atomic_add_negative(-1, &event_call->profile_count)) \ | ||
470 | unregister_trace_##call(ftrace_profile_##call); \ | ||
471 | } | ||
472 | |||
473 | #define _TRACE_PROFILE_INIT(call) \ | ||
474 | .profile_count = ATOMIC_INIT(-1), \ | ||
475 | .profile_enable = ftrace_profile_enable_##call, \ | ||
476 | .profile_disable = ftrace_profile_disable_##call, | ||
477 | |||
478 | #else | ||
479 | #define _TRACE_PROFILE(call, proto, args) | ||
480 | #define _TRACE_PROFILE_INIT(call) | ||
481 | #endif | ||
482 | |||
483 | #undef __entry | ||
484 | #define __entry entry | ||
485 | |||
486 | #undef __field | ||
487 | #define __field(type, item) | ||
488 | |||
489 | #undef __array | ||
490 | #define __array(type, item, len) | ||
491 | |||
492 | #undef __dynamic_array | ||
493 | #define __dynamic_array(type, item, len) \ | ||
494 | __entry->__data_loc_##item = __data_offsets.item; | ||
495 | |||
496 | #undef __string | ||
497 | #define __string(item, src) __dynamic_array(char, item, -1) \ | ||
498 | |||
499 | #undef __assign_str | ||
500 | #define __assign_str(dst, src) \ | ||
501 | strcpy(__get_str(dst), src); | ||
502 | |||
503 | #undef TRACE_EVENT | ||
504 | #define TRACE_EVENT(call, proto, args, tstruct, assign, print) \ | ||
505 | _TRACE_PROFILE(call, PARAMS(proto), PARAMS(args)) \ | ||
506 | \ | ||
507 | static struct ftrace_event_call event_##call; \ | ||
508 | \ | ||
509 | static void ftrace_raw_event_##call(proto) \ | ||
510 | { \ | ||
511 | struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\ | ||
512 | struct ftrace_event_call *event_call = &event_##call; \ | ||
513 | struct ring_buffer_event *event; \ | ||
514 | struct ftrace_raw_##call *entry; \ | ||
515 | unsigned long irq_flags; \ | ||
516 | int __data_size; \ | ||
517 | int pc; \ | ||
518 | \ | ||
519 | local_save_flags(irq_flags); \ | ||
520 | pc = preempt_count(); \ | ||
521 | \ | ||
522 | __data_size = ftrace_get_offsets_##call(&__data_offsets, args); \ | ||
523 | \ | ||
524 | event = trace_current_buffer_lock_reserve(event_##call.id, \ | ||
525 | sizeof(*entry) + __data_size, \ | ||
526 | irq_flags, pc); \ | ||
527 | if (!event) \ | ||
528 | return; \ | ||
529 | entry = ring_buffer_event_data(event); \ | ||
530 | \ | ||
531 | \ | ||
532 | tstruct \ | ||
533 | \ | ||
534 | { assign; } \ | ||
535 | \ | ||
536 | if (!filter_current_check_discard(event_call, entry, event)) \ | ||
537 | trace_nowake_buffer_unlock_commit(event, irq_flags, pc); \ | ||
538 | } \ | ||
539 | \ | ||
540 | static int ftrace_raw_reg_event_##call(void) \ | ||
541 | { \ | ||
542 | int ret; \ | ||
543 | \ | ||
544 | ret = register_trace_##call(ftrace_raw_event_##call); \ | ||
545 | if (ret) \ | ||
546 | pr_info("event trace: Could not activate trace point " \ | ||
547 | "probe to " #call "\n"); \ | ||
548 | return ret; \ | ||
549 | } \ | ||
550 | \ | ||
551 | static void ftrace_raw_unreg_event_##call(void) \ | ||
552 | { \ | ||
553 | unregister_trace_##call(ftrace_raw_event_##call); \ | ||
554 | } \ | ||
555 | \ | ||
556 | static struct trace_event ftrace_event_type_##call = { \ | ||
557 | .trace = ftrace_raw_output_##call, \ | ||
558 | }; \ | ||
559 | \ | ||
560 | static int ftrace_raw_init_event_##call(void) \ | ||
561 | { \ | ||
562 | int id; \ | ||
563 | \ | ||
564 | id = register_ftrace_event(&ftrace_event_type_##call); \ | ||
565 | if (!id) \ | ||
566 | return -ENODEV; \ | ||
567 | event_##call.id = id; \ | ||
568 | INIT_LIST_HEAD(&event_##call.fields); \ | ||
569 | init_preds(&event_##call); \ | ||
570 | return 0; \ | ||
571 | } \ | ||
572 | \ | ||
573 | static struct ftrace_event_call __used \ | ||
574 | __attribute__((__aligned__(4))) \ | ||
575 | __attribute__((section("_ftrace_events"))) event_##call = { \ | ||
576 | .name = #call, \ | ||
577 | .system = __stringify(TRACE_SYSTEM), \ | ||
578 | .event = &ftrace_event_type_##call, \ | ||
579 | .raw_init = ftrace_raw_init_event_##call, \ | ||
580 | .regfunc = ftrace_raw_reg_event_##call, \ | ||
581 | .unregfunc = ftrace_raw_unreg_event_##call, \ | ||
582 | .show_format = ftrace_format_##call, \ | ||
583 | .define_fields = ftrace_define_fields_##call, \ | ||
584 | _TRACE_PROFILE_INIT(call) \ | ||
585 | } | ||
586 | |||
587 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | ||
588 | |||
589 | #undef _TRACE_PROFILE | ||
590 | #undef _TRACE_PROFILE_INIT | ||
591 | |||
diff --git a/include/trace/irq.h b/include/trace/irq.h deleted file mode 100644 index ff5d4495dc37..000000000000 --- a/include/trace/irq.h +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | #ifndef _TRACE_IRQ_H | ||
2 | #define _TRACE_IRQ_H | ||
3 | |||
4 | #include <linux/interrupt.h> | ||
5 | #include <linux/tracepoint.h> | ||
6 | |||
7 | #include <trace/irq_event_types.h> | ||
8 | |||
9 | #endif | ||
diff --git a/include/trace/irq_event_types.h b/include/trace/irq_event_types.h deleted file mode 100644 index 85964ebd47ec..000000000000 --- a/include/trace/irq_event_types.h +++ /dev/null | |||
@@ -1,55 +0,0 @@ | |||
1 | |||
2 | /* use <trace/irq.h> instead */ | ||
3 | #ifndef TRACE_FORMAT | ||
4 | # error Do not include this file directly. | ||
5 | # error Unless you know what you are doing. | ||
6 | #endif | ||
7 | |||
8 | #undef TRACE_SYSTEM | ||
9 | #define TRACE_SYSTEM irq | ||
10 | |||
11 | /* | ||
12 | * Tracepoint for entry of interrupt handler: | ||
13 | */ | ||
14 | TRACE_FORMAT(irq_handler_entry, | ||
15 | TP_PROTO(int irq, struct irqaction *action), | ||
16 | TP_ARGS(irq, action), | ||
17 | TP_FMT("irq=%d handler=%s", irq, action->name) | ||
18 | ); | ||
19 | |||
20 | /* | ||
21 | * Tracepoint for return of an interrupt handler: | ||
22 | */ | ||
23 | TRACE_EVENT(irq_handler_exit, | ||
24 | |||
25 | TP_PROTO(int irq, struct irqaction *action, int ret), | ||
26 | |||
27 | TP_ARGS(irq, action, ret), | ||
28 | |||
29 | TP_STRUCT__entry( | ||
30 | __field( int, irq ) | ||
31 | __field( int, ret ) | ||
32 | ), | ||
33 | |||
34 | TP_fast_assign( | ||
35 | __entry->irq = irq; | ||
36 | __entry->ret = ret; | ||
37 | ), | ||
38 | |||
39 | TP_printk("irq=%d return=%s", | ||
40 | __entry->irq, __entry->ret ? "handled" : "unhandled") | ||
41 | ); | ||
42 | |||
43 | TRACE_FORMAT(softirq_entry, | ||
44 | TP_PROTO(struct softirq_action *h, struct softirq_action *vec), | ||
45 | TP_ARGS(h, vec), | ||
46 | TP_FMT("softirq=%d action=%s", (int)(h - vec), softirq_to_name[h-vec]) | ||
47 | ); | ||
48 | |||
49 | TRACE_FORMAT(softirq_exit, | ||
50 | TP_PROTO(struct softirq_action *h, struct softirq_action *vec), | ||
51 | TP_ARGS(h, vec), | ||
52 | TP_FMT("softirq=%d action=%s", (int)(h - vec), softirq_to_name[h-vec]) | ||
53 | ); | ||
54 | |||
55 | #undef TRACE_SYSTEM | ||
diff --git a/include/trace/kmemtrace.h b/include/trace/kmemtrace.h deleted file mode 100644 index 28ee69f9cd46..000000000000 --- a/include/trace/kmemtrace.h +++ /dev/null | |||
@@ -1,63 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2008 Eduard - Gabriel Munteanu | ||
3 | * | ||
4 | * This file is released under GPL version 2. | ||
5 | */ | ||
6 | |||
7 | #ifndef _LINUX_KMEMTRACE_H | ||
8 | #define _LINUX_KMEMTRACE_H | ||
9 | |||
10 | #ifdef __KERNEL__ | ||
11 | |||
12 | #include <linux/tracepoint.h> | ||
13 | #include <linux/types.h> | ||
14 | |||
15 | #ifdef CONFIG_KMEMTRACE | ||
16 | extern void kmemtrace_init(void); | ||
17 | #else | ||
18 | static inline void kmemtrace_init(void) | ||
19 | { | ||
20 | } | ||
21 | #endif | ||
22 | |||
23 | DECLARE_TRACE(kmalloc, | ||
24 | TP_PROTO(unsigned long call_site, | ||
25 | const void *ptr, | ||
26 | size_t bytes_req, | ||
27 | size_t bytes_alloc, | ||
28 | gfp_t gfp_flags), | ||
29 | TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags)); | ||
30 | DECLARE_TRACE(kmem_cache_alloc, | ||
31 | TP_PROTO(unsigned long call_site, | ||
32 | const void *ptr, | ||
33 | size_t bytes_req, | ||
34 | size_t bytes_alloc, | ||
35 | gfp_t gfp_flags), | ||
36 | TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags)); | ||
37 | DECLARE_TRACE(kmalloc_node, | ||
38 | TP_PROTO(unsigned long call_site, | ||
39 | const void *ptr, | ||
40 | size_t bytes_req, | ||
41 | size_t bytes_alloc, | ||
42 | gfp_t gfp_flags, | ||
43 | int node), | ||
44 | TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags, node)); | ||
45 | DECLARE_TRACE(kmem_cache_alloc_node, | ||
46 | TP_PROTO(unsigned long call_site, | ||
47 | const void *ptr, | ||
48 | size_t bytes_req, | ||
49 | size_t bytes_alloc, | ||
50 | gfp_t gfp_flags, | ||
51 | int node), | ||
52 | TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags, node)); | ||
53 | DECLARE_TRACE(kfree, | ||
54 | TP_PROTO(unsigned long call_site, const void *ptr), | ||
55 | TP_ARGS(call_site, ptr)); | ||
56 | DECLARE_TRACE(kmem_cache_free, | ||
57 | TP_PROTO(unsigned long call_site, const void *ptr), | ||
58 | TP_ARGS(call_site, ptr)); | ||
59 | |||
60 | #endif /* __KERNEL__ */ | ||
61 | |||
62 | #endif /* _LINUX_KMEMTRACE_H */ | ||
63 | |||
diff --git a/include/trace/lockdep.h b/include/trace/lockdep.h deleted file mode 100644 index 5ca67df87f2a..000000000000 --- a/include/trace/lockdep.h +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | #ifndef _TRACE_LOCKDEP_H | ||
2 | #define _TRACE_LOCKDEP_H | ||
3 | |||
4 | #include <linux/lockdep.h> | ||
5 | #include <linux/tracepoint.h> | ||
6 | |||
7 | #include <trace/lockdep_event_types.h> | ||
8 | |||
9 | #endif | ||
diff --git a/include/trace/lockdep_event_types.h b/include/trace/lockdep_event_types.h deleted file mode 100644 index adccfcd2ec8f..000000000000 --- a/include/trace/lockdep_event_types.h +++ /dev/null | |||
@@ -1,44 +0,0 @@ | |||
1 | |||
2 | #ifndef TRACE_FORMAT | ||
3 | # error Do not include this file directly. | ||
4 | # error Unless you know what you are doing. | ||
5 | #endif | ||
6 | |||
7 | #undef TRACE_SYSTEM | ||
8 | #define TRACE_SYSTEM lock | ||
9 | |||
10 | #ifdef CONFIG_LOCKDEP | ||
11 | |||
12 | TRACE_FORMAT(lock_acquire, | ||
13 | TP_PROTO(struct lockdep_map *lock, unsigned int subclass, | ||
14 | int trylock, int read, int check, | ||
15 | struct lockdep_map *next_lock, unsigned long ip), | ||
16 | TP_ARGS(lock, subclass, trylock, read, check, next_lock, ip), | ||
17 | TP_FMT("%s%s%s", trylock ? "try " : "", | ||
18 | read ? "read " : "", lock->name) | ||
19 | ); | ||
20 | |||
21 | TRACE_FORMAT(lock_release, | ||
22 | TP_PROTO(struct lockdep_map *lock, int nested, unsigned long ip), | ||
23 | TP_ARGS(lock, nested, ip), | ||
24 | TP_FMT("%s", lock->name) | ||
25 | ); | ||
26 | |||
27 | #ifdef CONFIG_LOCK_STAT | ||
28 | |||
29 | TRACE_FORMAT(lock_contended, | ||
30 | TP_PROTO(struct lockdep_map *lock, unsigned long ip), | ||
31 | TP_ARGS(lock, ip), | ||
32 | TP_FMT("%s", lock->name) | ||
33 | ); | ||
34 | |||
35 | TRACE_FORMAT(lock_acquired, | ||
36 | TP_PROTO(struct lockdep_map *lock, unsigned long ip), | ||
37 | TP_ARGS(lock, ip), | ||
38 | TP_FMT("%s", lock->name) | ||
39 | ); | ||
40 | |||
41 | #endif | ||
42 | #endif | ||
43 | |||
44 | #undef TRACE_SYSTEM | ||
diff --git a/include/trace/sched.h b/include/trace/sched.h deleted file mode 100644 index 4e372a1a29bf..000000000000 --- a/include/trace/sched.h +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | #ifndef _TRACE_SCHED_H | ||
2 | #define _TRACE_SCHED_H | ||
3 | |||
4 | #include <linux/sched.h> | ||
5 | #include <linux/tracepoint.h> | ||
6 | |||
7 | #include <trace/sched_event_types.h> | ||
8 | |||
9 | #endif | ||
diff --git a/include/trace/skb.h b/include/trace/skb.h deleted file mode 100644 index b66206d9be72..000000000000 --- a/include/trace/skb.h +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | #ifndef _TRACE_SKB_H_ | ||
2 | #define _TRACE_SKB_H_ | ||
3 | |||
4 | #include <linux/skbuff.h> | ||
5 | #include <linux/tracepoint.h> | ||
6 | |||
7 | DECLARE_TRACE(kfree_skb, | ||
8 | TP_PROTO(struct sk_buff *skb, void *location), | ||
9 | TP_ARGS(skb, location)); | ||
10 | |||
11 | #endif | ||
diff --git a/include/trace/trace_event_types.h b/include/trace/trace_event_types.h deleted file mode 100644 index df56f5694be6..000000000000 --- a/include/trace/trace_event_types.h +++ /dev/null | |||
@@ -1,5 +0,0 @@ | |||
1 | /* trace/<type>_event_types.h here */ | ||
2 | |||
3 | #include <trace/sched_event_types.h> | ||
4 | #include <trace/irq_event_types.h> | ||
5 | #include <trace/lockdep_event_types.h> | ||
diff --git a/include/trace/trace_events.h b/include/trace/trace_events.h deleted file mode 100644 index fd13750ca4ba..000000000000 --- a/include/trace/trace_events.h +++ /dev/null | |||
@@ -1,5 +0,0 @@ | |||
1 | /* trace/<type>.h here */ | ||
2 | |||
3 | #include <trace/sched.h> | ||
4 | #include <trace/irq.h> | ||
5 | #include <trace/lockdep.h> | ||
diff --git a/include/trace/workqueue.h b/include/trace/workqueue.h deleted file mode 100644 index 7626523deeba..000000000000 --- a/include/trace/workqueue.h +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | #ifndef __TRACE_WORKQUEUE_H | ||
2 | #define __TRACE_WORKQUEUE_H | ||
3 | |||
4 | #include <linux/tracepoint.h> | ||
5 | #include <linux/workqueue.h> | ||
6 | #include <linux/sched.h> | ||
7 | |||
8 | DECLARE_TRACE(workqueue_insertion, | ||
9 | TP_PROTO(struct task_struct *wq_thread, struct work_struct *work), | ||
10 | TP_ARGS(wq_thread, work)); | ||
11 | |||
12 | DECLARE_TRACE(workqueue_execution, | ||
13 | TP_PROTO(struct task_struct *wq_thread, struct work_struct *work), | ||
14 | TP_ARGS(wq_thread, work)); | ||
15 | |||
16 | /* Trace the creation of one workqueue thread on a cpu */ | ||
17 | DECLARE_TRACE(workqueue_creation, | ||
18 | TP_PROTO(struct task_struct *wq_thread, int cpu), | ||
19 | TP_ARGS(wq_thread, cpu)); | ||
20 | |||
21 | DECLARE_TRACE(workqueue_destruction, | ||
22 | TP_PROTO(struct task_struct *wq_thread), | ||
23 | TP_ARGS(wq_thread)); | ||
24 | |||
25 | #endif /* __TRACE_WORKQUEUE_H */ | ||