aboutsummaryrefslogtreecommitdiffstats
path: root/include/trace/events
diff options
context:
space:
mode:
Diffstat (limited to 'include/trace/events')
-rw-r--r--include/trace/events/asoc.h260
-rw-r--r--include/trace/events/bkl.h61
-rw-r--r--include/trace/events/block.h48
-rw-r--r--include/trace/events/btrfs.h667
-rw-r--r--include/trace/events/compaction.h74
-rw-r--r--include/trace/events/ext4.h828
-rw-r--r--include/trace/events/gfpflags.h6
-rw-r--r--include/trace/events/gpio.h56
-rw-r--r--include/trace/events/irq.h56
-rw-r--r--include/trace/events/kvm.h121
-rw-r--r--include/trace/events/mce.h8
-rw-r--r--include/trace/events/module.h15
-rw-r--r--include/trace/events/napi.h25
-rw-r--r--include/trace/events/net.h84
-rw-r--r--include/trace/events/power.h178
-rw-r--r--include/trace/events/regulator.h141
-rw-r--r--include/trace/events/sched.h29
-rw-r--r--include/trace/events/scsi.h28
-rw-r--r--include/trace/events/skb.h23
-rw-r--r--include/trace/events/syscalls.h4
-rw-r--r--include/trace/events/vmscan.h127
-rw-r--r--include/trace/events/workqueue.h77
-rw-r--r--include/trace/events/writeback.h38
23 files changed, 2657 insertions, 297 deletions
diff --git a/include/trace/events/asoc.h b/include/trace/events/asoc.h
new file mode 100644
index 000000000000..ae973d2e27a1
--- /dev/null
+++ b/include/trace/events/asoc.h
@@ -0,0 +1,260 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM asoc
3
4#if !defined(_TRACE_ASOC_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_ASOC_H
6
7#include <linux/ktime.h>
8#include <linux/tracepoint.h>
9
10struct snd_soc_jack;
11struct snd_soc_codec;
12struct snd_soc_card;
13struct snd_soc_dapm_widget;
14
15/*
16 * Log register events
17 */
18DECLARE_EVENT_CLASS(snd_soc_reg,
19
20 TP_PROTO(struct snd_soc_codec *codec, unsigned int reg,
21 unsigned int val),
22
23 TP_ARGS(codec, reg, val),
24
25 TP_STRUCT__entry(
26 __string( name, codec->name )
27 __field( int, id )
28 __field( unsigned int, reg )
29 __field( unsigned int, val )
30 ),
31
32 TP_fast_assign(
33 __assign_str(name, codec->name);
34 __entry->id = codec->id;
35 __entry->reg = reg;
36 __entry->val = val;
37 ),
38
39 TP_printk("codec=%s.%d reg=%x val=%x", __get_str(name),
40 (int)__entry->id, (unsigned int)__entry->reg,
41 (unsigned int)__entry->val)
42);
43
44DEFINE_EVENT(snd_soc_reg, snd_soc_reg_write,
45
46 TP_PROTO(struct snd_soc_codec *codec, unsigned int reg,
47 unsigned int val),
48
49 TP_ARGS(codec, reg, val)
50
51);
52
53DEFINE_EVENT(snd_soc_reg, snd_soc_reg_read,
54
55 TP_PROTO(struct snd_soc_codec *codec, unsigned int reg,
56 unsigned int val),
57
58 TP_ARGS(codec, reg, val)
59
60);
61
62DECLARE_EVENT_CLASS(snd_soc_card,
63
64 TP_PROTO(struct snd_soc_card *card, int val),
65
66 TP_ARGS(card, val),
67
68 TP_STRUCT__entry(
69 __string( name, card->name )
70 __field( int, val )
71 ),
72
73 TP_fast_assign(
74 __assign_str(name, card->name);
75 __entry->val = val;
76 ),
77
78 TP_printk("card=%s val=%d", __get_str(name), (int)__entry->val)
79);
80
81DEFINE_EVENT(snd_soc_card, snd_soc_bias_level_start,
82
83 TP_PROTO(struct snd_soc_card *card, int val),
84
85 TP_ARGS(card, val)
86
87);
88
89DEFINE_EVENT(snd_soc_card, snd_soc_bias_level_done,
90
91 TP_PROTO(struct snd_soc_card *card, int val),
92
93 TP_ARGS(card, val)
94
95);
96
97DECLARE_EVENT_CLASS(snd_soc_dapm_basic,
98
99 TP_PROTO(struct snd_soc_card *card),
100
101 TP_ARGS(card),
102
103 TP_STRUCT__entry(
104 __string( name, card->name )
105 ),
106
107 TP_fast_assign(
108 __assign_str(name, card->name);
109 ),
110
111 TP_printk("card=%s", __get_str(name))
112);
113
114DEFINE_EVENT(snd_soc_dapm_basic, snd_soc_dapm_start,
115
116 TP_PROTO(struct snd_soc_card *card),
117
118 TP_ARGS(card)
119
120);
121
122DEFINE_EVENT(snd_soc_dapm_basic, snd_soc_dapm_done,
123
124 TP_PROTO(struct snd_soc_card *card),
125
126 TP_ARGS(card)
127
128);
129
130DECLARE_EVENT_CLASS(snd_soc_dapm_widget,
131
132 TP_PROTO(struct snd_soc_dapm_widget *w, int val),
133
134 TP_ARGS(w, val),
135
136 TP_STRUCT__entry(
137 __string( name, w->name )
138 __field( int, val )
139 ),
140
141 TP_fast_assign(
142 __assign_str(name, w->name);
143 __entry->val = val;
144 ),
145
146 TP_printk("widget=%s val=%d", __get_str(name),
147 (int)__entry->val)
148);
149
150DEFINE_EVENT(snd_soc_dapm_widget, snd_soc_dapm_widget_power,
151
152 TP_PROTO(struct snd_soc_dapm_widget *w, int val),
153
154 TP_ARGS(w, val)
155
156);
157
158DEFINE_EVENT(snd_soc_dapm_widget, snd_soc_dapm_widget_event_start,
159
160 TP_PROTO(struct snd_soc_dapm_widget *w, int val),
161
162 TP_ARGS(w, val)
163
164);
165
166DEFINE_EVENT(snd_soc_dapm_widget, snd_soc_dapm_widget_event_done,
167
168 TP_PROTO(struct snd_soc_dapm_widget *w, int val),
169
170 TP_ARGS(w, val)
171
172);
173
174TRACE_EVENT(snd_soc_jack_irq,
175
176 TP_PROTO(const char *name),
177
178 TP_ARGS(name),
179
180 TP_STRUCT__entry(
181 __string( name, name )
182 ),
183
184 TP_fast_assign(
185 __assign_str(name, name);
186 ),
187
188 TP_printk("%s", __get_str(name))
189);
190
191TRACE_EVENT(snd_soc_jack_report,
192
193 TP_PROTO(struct snd_soc_jack *jack, int mask, int val),
194
195 TP_ARGS(jack, mask, val),
196
197 TP_STRUCT__entry(
198 __string( name, jack->jack->name )
199 __field( int, mask )
200 __field( int, val )
201 ),
202
203 TP_fast_assign(
204 __assign_str(name, jack->jack->name);
205 __entry->mask = mask;
206 __entry->val = val;
207 ),
208
209 TP_printk("jack=%s %x/%x", __get_str(name), (int)__entry->val,
210 (int)__entry->mask)
211);
212
213TRACE_EVENT(snd_soc_jack_notify,
214
215 TP_PROTO(struct snd_soc_jack *jack, int val),
216
217 TP_ARGS(jack, val),
218
219 TP_STRUCT__entry(
220 __string( name, jack->jack->name )
221 __field( int, val )
222 ),
223
224 TP_fast_assign(
225 __assign_str(name, jack->jack->name);
226 __entry->val = val;
227 ),
228
229 TP_printk("jack=%s %x", __get_str(name), (int)__entry->val)
230);
231
232TRACE_EVENT(snd_soc_cache_sync,
233
234 TP_PROTO(struct snd_soc_codec *codec, const char *type,
235 const char *status),
236
237 TP_ARGS(codec, type, status),
238
239 TP_STRUCT__entry(
240 __string( name, codec->name )
241 __string( status, status )
242 __string( type, type )
243 __field( int, id )
244 ),
245
246 TP_fast_assign(
247 __assign_str(name, codec->name);
248 __assign_str(status, status);
249 __assign_str(type, type);
250 __entry->id = codec->id;
251 ),
252
253 TP_printk("codec=%s.%d type=%s status=%s", __get_str(name),
254 (int)__entry->id, __get_str(type), __get_str(status))
255);
256
257#endif /* _TRACE_ASOC_H */
258
259/* This part must be outside protection */
260#include <trace/define_trace.h>
diff --git a/include/trace/events/bkl.h b/include/trace/events/bkl.h
deleted file mode 100644
index 1af72dc24278..000000000000
--- a/include/trace/events/bkl.h
+++ /dev/null
@@ -1,61 +0,0 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM bkl
3
4#if !defined(_TRACE_BKL_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_BKL_H
6
7#include <linux/tracepoint.h>
8
9TRACE_EVENT(lock_kernel,
10
11 TP_PROTO(const char *func, const char *file, int line),
12
13 TP_ARGS(func, file, line),
14
15 TP_STRUCT__entry(
16 __field( int, depth )
17 __field_ext( const char *, func, FILTER_PTR_STRING )
18 __field_ext( const char *, file, FILTER_PTR_STRING )
19 __field( int, line )
20 ),
21
22 TP_fast_assign(
23 /* We want to record the lock_depth after lock is acquired */
24 __entry->depth = current->lock_depth + 1;
25 __entry->func = func;
26 __entry->file = file;
27 __entry->line = line;
28 ),
29
30 TP_printk("depth=%d file:line=%s:%d func=%s()", __entry->depth,
31 __entry->file, __entry->line, __entry->func)
32);
33
34TRACE_EVENT(unlock_kernel,
35
36 TP_PROTO(const char *func, const char *file, int line),
37
38 TP_ARGS(func, file, line),
39
40 TP_STRUCT__entry(
41 __field(int, depth )
42 __field(const char *, func )
43 __field(const char *, file )
44 __field(int, line )
45 ),
46
47 TP_fast_assign(
48 __entry->depth = current->lock_depth;
49 __entry->func = func;
50 __entry->file = file;
51 __entry->line = line;
52 ),
53
54 TP_printk("depth=%d file:line=%s:%d func=%s()", __entry->depth,
55 __entry->file, __entry->line, __entry->func)
56);
57
58#endif /* _TRACE_BKL_H */
59
60/* This part must be outside protection */
61#include <trace/define_trace.h>
diff --git a/include/trace/events/block.h b/include/trace/events/block.h
index d8ce278515c3..bf366547da25 100644
--- a/include/trace/events/block.h
+++ b/include/trace/events/block.h
@@ -31,7 +31,7 @@ DECLARE_EVENT_CLASS(block_rq_with_error,
31 0 : blk_rq_sectors(rq); 31 0 : blk_rq_sectors(rq);
32 __entry->errors = rq->errors; 32 __entry->errors = rq->errors;
33 33
34 blk_fill_rwbs_rq(__entry->rwbs, rq); 34 blk_fill_rwbs(__entry->rwbs, rq->cmd_flags, blk_rq_bytes(rq));
35 blk_dump_cmd(__get_str(cmd), rq); 35 blk_dump_cmd(__get_str(cmd), rq);
36 ), 36 ),
37 37
@@ -118,7 +118,7 @@ DECLARE_EVENT_CLASS(block_rq,
118 __entry->bytes = (rq->cmd_type == REQ_TYPE_BLOCK_PC) ? 118 __entry->bytes = (rq->cmd_type == REQ_TYPE_BLOCK_PC) ?
119 blk_rq_bytes(rq) : 0; 119 blk_rq_bytes(rq) : 0;
120 120
121 blk_fill_rwbs_rq(__entry->rwbs, rq); 121 blk_fill_rwbs(__entry->rwbs, rq->cmd_flags, blk_rq_bytes(rq));
122 blk_dump_cmd(__get_str(cmd), rq); 122 blk_dump_cmd(__get_str(cmd), rq);
123 memcpy(__entry->comm, current->comm, TASK_COMM_LEN); 123 memcpy(__entry->comm, current->comm, TASK_COMM_LEN);
124 ), 124 ),
@@ -206,15 +206,16 @@ TRACE_EVENT(block_bio_bounce,
206 * block_bio_complete - completed all work on the block operation 206 * block_bio_complete - completed all work on the block operation
207 * @q: queue holding the block operation 207 * @q: queue holding the block operation
208 * @bio: block operation completed 208 * @bio: block operation completed
209 * @error: io error value
209 * 210 *
210 * This tracepoint indicates there is no further work to do on this 211 * This tracepoint indicates there is no further work to do on this
211 * block IO operation @bio. 212 * block IO operation @bio.
212 */ 213 */
213TRACE_EVENT(block_bio_complete, 214TRACE_EVENT(block_bio_complete,
214 215
215 TP_PROTO(struct request_queue *q, struct bio *bio), 216 TP_PROTO(struct request_queue *q, struct bio *bio, int error),
216 217
217 TP_ARGS(q, bio), 218 TP_ARGS(q, bio, error),
218 219
219 TP_STRUCT__entry( 220 TP_STRUCT__entry(
220 __field( dev_t, dev ) 221 __field( dev_t, dev )
@@ -228,6 +229,7 @@ TRACE_EVENT(block_bio_complete,
228 __entry->dev = bio->bi_bdev->bd_dev; 229 __entry->dev = bio->bi_bdev->bd_dev;
229 __entry->sector = bio->bi_sector; 230 __entry->sector = bio->bi_sector;
230 __entry->nr_sector = bio->bi_size >> 9; 231 __entry->nr_sector = bio->bi_size >> 9;
232 __entry->error = error;
231 blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size); 233 blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size);
232 ), 234 ),
233 235
@@ -399,9 +401,9 @@ TRACE_EVENT(block_plug,
399 401
400DECLARE_EVENT_CLASS(block_unplug, 402DECLARE_EVENT_CLASS(block_unplug,
401 403
402 TP_PROTO(struct request_queue *q), 404 TP_PROTO(struct request_queue *q, unsigned int depth, bool explicit),
403 405
404 TP_ARGS(q), 406 TP_ARGS(q, depth, explicit),
405 407
406 TP_STRUCT__entry( 408 TP_STRUCT__entry(
407 __field( int, nr_rq ) 409 __field( int, nr_rq )
@@ -409,7 +411,7 @@ DECLARE_EVENT_CLASS(block_unplug,
409 ), 411 ),
410 412
411 TP_fast_assign( 413 TP_fast_assign(
412 __entry->nr_rq = q->rq.count[READ] + q->rq.count[WRITE]; 414 __entry->nr_rq = depth;
413 memcpy(__entry->comm, current->comm, TASK_COMM_LEN); 415 memcpy(__entry->comm, current->comm, TASK_COMM_LEN);
414 ), 416 ),
415 417
@@ -417,31 +419,19 @@ DECLARE_EVENT_CLASS(block_unplug,
417); 419);
418 420
419/** 421/**
420 * block_unplug_timer - timed release of operations requests in queue to device driver 422 * block_unplug - release of operations requests in request queue
421 * @q: request queue to unplug
422 *
423 * Unplug the request queue @q because a timer expired and allow block
424 * operation requests to be sent to the device driver.
425 */
426DEFINE_EVENT(block_unplug, block_unplug_timer,
427
428 TP_PROTO(struct request_queue *q),
429
430 TP_ARGS(q)
431);
432
433/**
434 * block_unplug_io - release of operations requests in request queue
435 * @q: request queue to unplug 423 * @q: request queue to unplug
424 * @depth: number of requests just added to the queue
425 * @explicit: whether this was an explicit unplug, or one from schedule()
436 * 426 *
437 * Unplug request queue @q because device driver is scheduled to work 427 * Unplug request queue @q because device driver is scheduled to work
438 * on elements in the request queue. 428 * on elements in the request queue.
439 */ 429 */
440DEFINE_EVENT(block_unplug, block_unplug_io, 430DEFINE_EVENT(block_unplug, block_unplug,
441 431
442 TP_PROTO(struct request_queue *q), 432 TP_PROTO(struct request_queue *q, unsigned int depth, bool explicit),
443 433
444 TP_ARGS(q) 434 TP_ARGS(q, depth, explicit)
445); 435);
446 436
447/** 437/**
@@ -486,16 +476,16 @@ TRACE_EVENT(block_split,
486); 476);
487 477
488/** 478/**
489 * block_remap - map request for a partition to the raw device 479 * block_bio_remap - map request for a logical device to the raw device
490 * @q: queue holding the operation 480 * @q: queue holding the operation
491 * @bio: revised operation 481 * @bio: revised operation
492 * @dev: device for the operation 482 * @dev: device for the operation
493 * @from: original sector for the operation 483 * @from: original sector for the operation
494 * 484 *
495 * An operation for a partition on a block device has been mapped to the 485 * An operation for a logical device has been mapped to the
496 * raw block device. 486 * raw block device.
497 */ 487 */
498TRACE_EVENT(block_remap, 488TRACE_EVENT(block_bio_remap,
499 489
500 TP_PROTO(struct request_queue *q, struct bio *bio, dev_t dev, 490 TP_PROTO(struct request_queue *q, struct bio *bio, dev_t dev,
501 sector_t from), 491 sector_t from),
@@ -561,7 +551,7 @@ TRACE_EVENT(block_rq_remap,
561 __entry->nr_sector = blk_rq_sectors(rq); 551 __entry->nr_sector = blk_rq_sectors(rq);
562 __entry->old_dev = dev; 552 __entry->old_dev = dev;
563 __entry->old_sector = from; 553 __entry->old_sector = from;
564 blk_fill_rwbs_rq(__entry->rwbs, rq); 554 blk_fill_rwbs(__entry->rwbs, rq->cmd_flags, blk_rq_bytes(rq));
565 ), 555 ),
566 556
567 TP_printk("%d,%d %s %llu + %u <- (%d,%d) %llu", 557 TP_printk("%d,%d %s %llu + %u <- (%d,%d) %llu",
diff --git a/include/trace/events/btrfs.h b/include/trace/events/btrfs.h
new file mode 100644
index 000000000000..4114129f0794
--- /dev/null
+++ b/include/trace/events/btrfs.h
@@ -0,0 +1,667 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM btrfs
3
4#if !defined(_TRACE_BTRFS_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_BTRFS_H
6
7#include <linux/writeback.h>
8#include <linux/tracepoint.h>
9
10struct btrfs_root;
11struct btrfs_fs_info;
12struct btrfs_inode;
13struct extent_map;
14struct btrfs_ordered_extent;
15struct btrfs_delayed_ref_node;
16struct btrfs_delayed_tree_ref;
17struct btrfs_delayed_data_ref;
18struct btrfs_delayed_ref_head;
19struct map_lookup;
20struct extent_buffer;
21
22#define show_ref_type(type) \
23 __print_symbolic(type, \
24 { BTRFS_TREE_BLOCK_REF_KEY, "TREE_BLOCK_REF" }, \
25 { BTRFS_EXTENT_DATA_REF_KEY, "EXTENT_DATA_REF" }, \
26 { BTRFS_EXTENT_REF_V0_KEY, "EXTENT_REF_V0" }, \
27 { BTRFS_SHARED_BLOCK_REF_KEY, "SHARED_BLOCK_REF" }, \
28 { BTRFS_SHARED_DATA_REF_KEY, "SHARED_DATA_REF" })
29
30#define __show_root_type(obj) \
31 __print_symbolic_u64(obj, \
32 { BTRFS_ROOT_TREE_OBJECTID, "ROOT_TREE" }, \
33 { BTRFS_EXTENT_TREE_OBJECTID, "EXTENT_TREE" }, \
34 { BTRFS_CHUNK_TREE_OBJECTID, "CHUNK_TREE" }, \
35 { BTRFS_DEV_TREE_OBJECTID, "DEV_TREE" }, \
36 { BTRFS_FS_TREE_OBJECTID, "FS_TREE" }, \
37 { BTRFS_ROOT_TREE_DIR_OBJECTID, "ROOT_TREE_DIR" }, \
38 { BTRFS_CSUM_TREE_OBJECTID, "CSUM_TREE" }, \
39 { BTRFS_TREE_LOG_OBJECTID, "TREE_LOG" }, \
40 { BTRFS_TREE_RELOC_OBJECTID, "TREE_RELOC" }, \
41 { BTRFS_DATA_RELOC_TREE_OBJECTID, "DATA_RELOC_TREE" })
42
43#define show_root_type(obj) \
44 obj, ((obj >= BTRFS_DATA_RELOC_TREE_OBJECTID) || \
45 (obj <= BTRFS_CSUM_TREE_OBJECTID )) ? __show_root_type(obj) : "-"
46
47TRACE_EVENT(btrfs_transaction_commit,
48
49 TP_PROTO(struct btrfs_root *root),
50
51 TP_ARGS(root),
52
53 TP_STRUCT__entry(
54 __field( u64, generation )
55 __field( u64, root_objectid )
56 ),
57
58 TP_fast_assign(
59 __entry->generation = root->fs_info->generation;
60 __entry->root_objectid = root->root_key.objectid;
61 ),
62
63 TP_printk("root = %llu(%s), gen = %llu",
64 show_root_type(__entry->root_objectid),
65 (unsigned long long)__entry->generation)
66);
67
68DECLARE_EVENT_CLASS(btrfs__inode,
69
70 TP_PROTO(struct inode *inode),
71
72 TP_ARGS(inode),
73
74 TP_STRUCT__entry(
75 __field( ino_t, ino )
76 __field( blkcnt_t, blocks )
77 __field( u64, disk_i_size )
78 __field( u64, generation )
79 __field( u64, last_trans )
80 __field( u64, logged_trans )
81 __field( u64, root_objectid )
82 ),
83
84 TP_fast_assign(
85 __entry->ino = inode->i_ino;
86 __entry->blocks = inode->i_blocks;
87 __entry->disk_i_size = BTRFS_I(inode)->disk_i_size;
88 __entry->generation = BTRFS_I(inode)->generation;
89 __entry->last_trans = BTRFS_I(inode)->last_trans;
90 __entry->logged_trans = BTRFS_I(inode)->logged_trans;
91 __entry->root_objectid =
92 BTRFS_I(inode)->root->root_key.objectid;
93 ),
94
95 TP_printk("root = %llu(%s), gen = %llu, ino = %lu, blocks = %llu, "
96 "disk_i_size = %llu, last_trans = %llu, logged_trans = %llu",
97 show_root_type(__entry->root_objectid),
98 (unsigned long long)__entry->generation,
99 (unsigned long)__entry->ino,
100 (unsigned long long)__entry->blocks,
101 (unsigned long long)__entry->disk_i_size,
102 (unsigned long long)__entry->last_trans,
103 (unsigned long long)__entry->logged_trans)
104);
105
106DEFINE_EVENT(btrfs__inode, btrfs_inode_new,
107
108 TP_PROTO(struct inode *inode),
109
110 TP_ARGS(inode)
111);
112
113DEFINE_EVENT(btrfs__inode, btrfs_inode_request,
114
115 TP_PROTO(struct inode *inode),
116
117 TP_ARGS(inode)
118);
119
120DEFINE_EVENT(btrfs__inode, btrfs_inode_evict,
121
122 TP_PROTO(struct inode *inode),
123
124 TP_ARGS(inode)
125);
126
127#define __show_map_type(type) \
128 __print_symbolic_u64(type, \
129 { EXTENT_MAP_LAST_BYTE, "LAST_BYTE" }, \
130 { EXTENT_MAP_HOLE, "HOLE" }, \
131 { EXTENT_MAP_INLINE, "INLINE" }, \
132 { EXTENT_MAP_DELALLOC, "DELALLOC" })
133
134#define show_map_type(type) \
135 type, (type >= EXTENT_MAP_LAST_BYTE) ? "-" : __show_map_type(type)
136
137#define show_map_flags(flag) \
138 __print_flags(flag, "|", \
139 { EXTENT_FLAG_PINNED, "PINNED" }, \
140 { EXTENT_FLAG_COMPRESSED, "COMPRESSED" }, \
141 { EXTENT_FLAG_VACANCY, "VACANCY" }, \
142 { EXTENT_FLAG_PREALLOC, "PREALLOC" })
143
144TRACE_EVENT(btrfs_get_extent,
145
146 TP_PROTO(struct btrfs_root *root, struct extent_map *map),
147
148 TP_ARGS(root, map),
149
150 TP_STRUCT__entry(
151 __field( u64, root_objectid )
152 __field( u64, start )
153 __field( u64, len )
154 __field( u64, orig_start )
155 __field( u64, block_start )
156 __field( u64, block_len )
157 __field( unsigned long, flags )
158 __field( int, refs )
159 __field( unsigned int, compress_type )
160 ),
161
162 TP_fast_assign(
163 __entry->root_objectid = root->root_key.objectid;
164 __entry->start = map->start;
165 __entry->len = map->len;
166 __entry->orig_start = map->orig_start;
167 __entry->block_start = map->block_start;
168 __entry->block_len = map->block_len;
169 __entry->flags = map->flags;
170 __entry->refs = atomic_read(&map->refs);
171 __entry->compress_type = map->compress_type;
172 ),
173
174 TP_printk("root = %llu(%s), start = %llu, len = %llu, "
175 "orig_start = %llu, block_start = %llu(%s), "
176 "block_len = %llu, flags = %s, refs = %u, "
177 "compress_type = %u",
178 show_root_type(__entry->root_objectid),
179 (unsigned long long)__entry->start,
180 (unsigned long long)__entry->len,
181 (unsigned long long)__entry->orig_start,
182 show_map_type(__entry->block_start),
183 (unsigned long long)__entry->block_len,
184 show_map_flags(__entry->flags),
185 __entry->refs, __entry->compress_type)
186);
187
188#define show_ordered_flags(flags) \
189 __print_symbolic(flags, \
190 { BTRFS_ORDERED_IO_DONE, "IO_DONE" }, \
191 { BTRFS_ORDERED_COMPLETE, "COMPLETE" }, \
192 { BTRFS_ORDERED_NOCOW, "NOCOW" }, \
193 { BTRFS_ORDERED_COMPRESSED, "COMPRESSED" }, \
194 { BTRFS_ORDERED_PREALLOC, "PREALLOC" }, \
195 { BTRFS_ORDERED_DIRECT, "DIRECT" })
196
197DECLARE_EVENT_CLASS(btrfs__ordered_extent,
198
199 TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
200
201 TP_ARGS(inode, ordered),
202
203 TP_STRUCT__entry(
204 __field( ino_t, ino )
205 __field( u64, file_offset )
206 __field( u64, start )
207 __field( u64, len )
208 __field( u64, disk_len )
209 __field( u64, bytes_left )
210 __field( unsigned long, flags )
211 __field( int, compress_type )
212 __field( int, refs )
213 __field( u64, root_objectid )
214 ),
215
216 TP_fast_assign(
217 __entry->ino = inode->i_ino;
218 __entry->file_offset = ordered->file_offset;
219 __entry->start = ordered->start;
220 __entry->len = ordered->len;
221 __entry->disk_len = ordered->disk_len;
222 __entry->bytes_left = ordered->bytes_left;
223 __entry->flags = ordered->flags;
224 __entry->compress_type = ordered->compress_type;
225 __entry->refs = atomic_read(&ordered->refs);
226 __entry->root_objectid =
227 BTRFS_I(inode)->root->root_key.objectid;
228 ),
229
230 TP_printk("root = %llu(%s), ino = %llu, file_offset = %llu, "
231 "start = %llu, len = %llu, disk_len = %llu, "
232 "bytes_left = %llu, flags = %s, compress_type = %d, "
233 "refs = %d",
234 show_root_type(__entry->root_objectid),
235 (unsigned long long)__entry->ino,
236 (unsigned long long)__entry->file_offset,
237 (unsigned long long)__entry->start,
238 (unsigned long long)__entry->len,
239 (unsigned long long)__entry->disk_len,
240 (unsigned long long)__entry->bytes_left,
241 show_ordered_flags(__entry->flags),
242 __entry->compress_type, __entry->refs)
243);
244
245DEFINE_EVENT(btrfs__ordered_extent, btrfs_ordered_extent_add,
246
247 TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
248
249 TP_ARGS(inode, ordered)
250);
251
252DEFINE_EVENT(btrfs__ordered_extent, btrfs_ordered_extent_remove,
253
254 TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
255
256 TP_ARGS(inode, ordered)
257);
258
259DEFINE_EVENT(btrfs__ordered_extent, btrfs_ordered_extent_start,
260
261 TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
262
263 TP_ARGS(inode, ordered)
264);
265
266DEFINE_EVENT(btrfs__ordered_extent, btrfs_ordered_extent_put,
267
268 TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
269
270 TP_ARGS(inode, ordered)
271);
272
273DECLARE_EVENT_CLASS(btrfs__writepage,
274
275 TP_PROTO(struct page *page, struct inode *inode,
276 struct writeback_control *wbc),
277
278 TP_ARGS(page, inode, wbc),
279
280 TP_STRUCT__entry(
281 __field( ino_t, ino )
282 __field( pgoff_t, index )
283 __field( long, nr_to_write )
284 __field( long, pages_skipped )
285 __field( loff_t, range_start )
286 __field( loff_t, range_end )
287 __field( char, nonblocking )
288 __field( char, for_kupdate )
289 __field( char, for_reclaim )
290 __field( char, range_cyclic )
291 __field( pgoff_t, writeback_index )
292 __field( u64, root_objectid )
293 ),
294
295 TP_fast_assign(
296 __entry->ino = inode->i_ino;
297 __entry->index = page->index;
298 __entry->nr_to_write = wbc->nr_to_write;
299 __entry->pages_skipped = wbc->pages_skipped;
300 __entry->range_start = wbc->range_start;
301 __entry->range_end = wbc->range_end;
302 __entry->nonblocking = wbc->nonblocking;
303 __entry->for_kupdate = wbc->for_kupdate;
304 __entry->for_reclaim = wbc->for_reclaim;
305 __entry->range_cyclic = wbc->range_cyclic;
306 __entry->writeback_index = inode->i_mapping->writeback_index;
307 __entry->root_objectid =
308 BTRFS_I(inode)->root->root_key.objectid;
309 ),
310
311 TP_printk("root = %llu(%s), ino = %lu, page_index = %lu, "
312 "nr_to_write = %ld, pages_skipped = %ld, range_start = %llu, "
313 "range_end = %llu, nonblocking = %d, for_kupdate = %d, "
314 "for_reclaim = %d, range_cyclic = %d, writeback_index = %lu",
315 show_root_type(__entry->root_objectid),
316 (unsigned long)__entry->ino, __entry->index,
317 __entry->nr_to_write, __entry->pages_skipped,
318 __entry->range_start, __entry->range_end,
319 __entry->nonblocking, __entry->for_kupdate,
320 __entry->for_reclaim, __entry->range_cyclic,
321 (unsigned long)__entry->writeback_index)
322);
323
324DEFINE_EVENT(btrfs__writepage, __extent_writepage,
325
326 TP_PROTO(struct page *page, struct inode *inode,
327 struct writeback_control *wbc),
328
329 TP_ARGS(page, inode, wbc)
330);
331
332TRACE_EVENT(btrfs_writepage_end_io_hook,
333
334 TP_PROTO(struct page *page, u64 start, u64 end, int uptodate),
335
336 TP_ARGS(page, start, end, uptodate),
337
338 TP_STRUCT__entry(
339 __field( ino_t, ino )
340 __field( pgoff_t, index )
341 __field( u64, start )
342 __field( u64, end )
343 __field( int, uptodate )
344 __field( u64, root_objectid )
345 ),
346
347 TP_fast_assign(
348 __entry->ino = page->mapping->host->i_ino;
349 __entry->index = page->index;
350 __entry->start = start;
351 __entry->end = end;
352 __entry->uptodate = uptodate;
353 __entry->root_objectid =
354 BTRFS_I(page->mapping->host)->root->root_key.objectid;
355 ),
356
357 TP_printk("root = %llu(%s), ino = %lu, page_index = %lu, start = %llu, "
358 "end = %llu, uptodate = %d",
359 show_root_type(__entry->root_objectid),
360 (unsigned long)__entry->ino, (unsigned long)__entry->index,
361 (unsigned long long)__entry->start,
362 (unsigned long long)__entry->end, __entry->uptodate)
363);
364
365TRACE_EVENT(btrfs_sync_file,
366
367 TP_PROTO(struct file *file, int datasync),
368
369 TP_ARGS(file, datasync),
370
371 TP_STRUCT__entry(
372 __field( ino_t, ino )
373 __field( ino_t, parent )
374 __field( int, datasync )
375 __field( u64, root_objectid )
376 ),
377
378 TP_fast_assign(
379 struct dentry *dentry = file->f_path.dentry;
380 struct inode *inode = dentry->d_inode;
381
382 __entry->ino = inode->i_ino;
383 __entry->parent = dentry->d_parent->d_inode->i_ino;
384 __entry->datasync = datasync;
385 __entry->root_objectid =
386 BTRFS_I(inode)->root->root_key.objectid;
387 ),
388
389 TP_printk("root = %llu(%s), ino = %ld, parent = %ld, datasync = %d",
390 show_root_type(__entry->root_objectid),
391 (unsigned long)__entry->ino, (unsigned long)__entry->parent,
392 __entry->datasync)
393);
394
395TRACE_EVENT(btrfs_sync_fs,
396
397 TP_PROTO(int wait),
398
399 TP_ARGS(wait),
400
401 TP_STRUCT__entry(
402 __field( int, wait )
403 ),
404
405 TP_fast_assign(
406 __entry->wait = wait;
407 ),
408
409 TP_printk("wait = %d", __entry->wait)
410);
411
412#define show_ref_action(action) \
413 __print_symbolic(action, \
414 { BTRFS_ADD_DELAYED_REF, "ADD_DELAYED_REF" }, \
415 { BTRFS_DROP_DELAYED_REF, "DROP_DELAYED_REF" }, \
416 { BTRFS_ADD_DELAYED_EXTENT, "ADD_DELAYED_EXTENT" }, \
417 { BTRFS_UPDATE_DELAYED_HEAD, "UPDATE_DELAYED_HEAD" })
418
419
420TRACE_EVENT(btrfs_delayed_tree_ref,
421
422 TP_PROTO(struct btrfs_delayed_ref_node *ref,
423 struct btrfs_delayed_tree_ref *full_ref,
424 int action),
425
426 TP_ARGS(ref, full_ref, action),
427
428 TP_STRUCT__entry(
429 __field( u64, bytenr )
430 __field( u64, num_bytes )
431 __field( int, action )
432 __field( u64, parent )
433 __field( u64, ref_root )
434 __field( int, level )
435 __field( int, type )
436 ),
437
438 TP_fast_assign(
439 __entry->bytenr = ref->bytenr;
440 __entry->num_bytes = ref->num_bytes;
441 __entry->action = action;
442 __entry->parent = full_ref->parent;
443 __entry->ref_root = full_ref->root;
444 __entry->level = full_ref->level;
445 __entry->type = ref->type;
446 ),
447
448 TP_printk("bytenr = %llu, num_bytes = %llu, action = %s, "
449 "parent = %llu(%s), ref_root = %llu(%s), level = %d, "
450 "type = %s",
451 (unsigned long long)__entry->bytenr,
452 (unsigned long long)__entry->num_bytes,
453 show_ref_action(__entry->action),
454 show_root_type(__entry->parent),
455 show_root_type(__entry->ref_root),
456 __entry->level, show_ref_type(__entry->type))
457);
458
459TRACE_EVENT(btrfs_delayed_data_ref,
460
461 TP_PROTO(struct btrfs_delayed_ref_node *ref,
462 struct btrfs_delayed_data_ref *full_ref,
463 int action),
464
465 TP_ARGS(ref, full_ref, action),
466
467 TP_STRUCT__entry(
468 __field( u64, bytenr )
469 __field( u64, num_bytes )
470 __field( int, action )
471 __field( u64, parent )
472 __field( u64, ref_root )
473 __field( u64, owner )
474 __field( u64, offset )
475 __field( int, type )
476 ),
477
478 TP_fast_assign(
479 __entry->bytenr = ref->bytenr;
480 __entry->num_bytes = ref->num_bytes;
481 __entry->action = action;
482 __entry->parent = full_ref->parent;
483 __entry->ref_root = full_ref->root;
484 __entry->owner = full_ref->objectid;
485 __entry->offset = full_ref->offset;
486 __entry->type = ref->type;
487 ),
488
489 TP_printk("bytenr = %llu, num_bytes = %llu, action = %s, "
490 "parent = %llu(%s), ref_root = %llu(%s), owner = %llu, "
491 "offset = %llu, type = %s",
492 (unsigned long long)__entry->bytenr,
493 (unsigned long long)__entry->num_bytes,
494 show_ref_action(__entry->action),
495 show_root_type(__entry->parent),
496 show_root_type(__entry->ref_root),
497 (unsigned long long)__entry->owner,
498 (unsigned long long)__entry->offset,
499 show_ref_type(__entry->type))
500);
501
502TRACE_EVENT(btrfs_delayed_ref_head,
503
504 TP_PROTO(struct btrfs_delayed_ref_node *ref,
505 struct btrfs_delayed_ref_head *head_ref,
506 int action),
507
508 TP_ARGS(ref, head_ref, action),
509
510 TP_STRUCT__entry(
511 __field( u64, bytenr )
512 __field( u64, num_bytes )
513 __field( int, action )
514 __field( int, is_data )
515 ),
516
517 TP_fast_assign(
518 __entry->bytenr = ref->bytenr;
519 __entry->num_bytes = ref->num_bytes;
520 __entry->action = action;
521 __entry->is_data = head_ref->is_data;
522 ),
523
524 TP_printk("bytenr = %llu, num_bytes = %llu, action = %s, is_data = %d",
525 (unsigned long long)__entry->bytenr,
526 (unsigned long long)__entry->num_bytes,
527 show_ref_action(__entry->action),
528 __entry->is_data)
529);
530
531#define show_chunk_type(type) \
532 __print_flags(type, "|", \
533 { BTRFS_BLOCK_GROUP_DATA, "DATA" }, \
534 { BTRFS_BLOCK_GROUP_SYSTEM, "SYSTEM"}, \
535 { BTRFS_BLOCK_GROUP_METADATA, "METADATA"}, \
536 { BTRFS_BLOCK_GROUP_RAID0, "RAID0" }, \
537 { BTRFS_BLOCK_GROUP_RAID1, "RAID1" }, \
538 { BTRFS_BLOCK_GROUP_DUP, "DUP" }, \
539 { BTRFS_BLOCK_GROUP_RAID10, "RAID10"})
540
541DECLARE_EVENT_CLASS(btrfs__chunk,
542
543 TP_PROTO(struct btrfs_root *root, struct map_lookup *map,
544 u64 offset, u64 size),
545
546 TP_ARGS(root, map, offset, size),
547
548 TP_STRUCT__entry(
549 __field( int, num_stripes )
550 __field( u64, type )
551 __field( int, sub_stripes )
552 __field( u64, offset )
553 __field( u64, size )
554 __field( u64, root_objectid )
555 ),
556
557 TP_fast_assign(
558 __entry->num_stripes = map->num_stripes;
559 __entry->type = map->type;
560 __entry->sub_stripes = map->sub_stripes;
561 __entry->offset = offset;
562 __entry->size = size;
563 __entry->root_objectid = root->root_key.objectid;
564 ),
565
566 TP_printk("root = %llu(%s), offset = %llu, size = %llu, "
567 "num_stripes = %d, sub_stripes = %d, type = %s",
568 show_root_type(__entry->root_objectid),
569 (unsigned long long)__entry->offset,
570 (unsigned long long)__entry->size,
571 __entry->num_stripes, __entry->sub_stripes,
572 show_chunk_type(__entry->type))
573);
574
575DEFINE_EVENT(btrfs__chunk, btrfs_chunk_alloc,
576
577 TP_PROTO(struct btrfs_root *root, struct map_lookup *map,
578 u64 offset, u64 size),
579
580 TP_ARGS(root, map, offset, size)
581);
582
583DEFINE_EVENT(btrfs__chunk, btrfs_chunk_free,
584
585 TP_PROTO(struct btrfs_root *root, struct map_lookup *map,
586 u64 offset, u64 size),
587
588 TP_ARGS(root, map, offset, size)
589);
590
591TRACE_EVENT(btrfs_cow_block,
592
593 TP_PROTO(struct btrfs_root *root, struct extent_buffer *buf,
594 struct extent_buffer *cow),
595
596 TP_ARGS(root, buf, cow),
597
598 TP_STRUCT__entry(
599 __field( u64, root_objectid )
600 __field( u64, buf_start )
601 __field( int, refs )
602 __field( u64, cow_start )
603 __field( int, buf_level )
604 __field( int, cow_level )
605 ),
606
607 TP_fast_assign(
608 __entry->root_objectid = root->root_key.objectid;
609 __entry->buf_start = buf->start;
610 __entry->refs = atomic_read(&buf->refs);
611 __entry->cow_start = cow->start;
612 __entry->buf_level = btrfs_header_level(buf);
613 __entry->cow_level = btrfs_header_level(cow);
614 ),
615
616 TP_printk("root = %llu(%s), refs = %d, orig_buf = %llu "
617 "(orig_level = %d), cow_buf = %llu (cow_level = %d)",
618 show_root_type(__entry->root_objectid),
619 __entry->refs,
620 (unsigned long long)__entry->buf_start,
621 __entry->buf_level,
622 (unsigned long long)__entry->cow_start,
623 __entry->cow_level)
624);
625
626DECLARE_EVENT_CLASS(btrfs__reserved_extent,
627
628 TP_PROTO(struct btrfs_root *root, u64 start, u64 len),
629
630 TP_ARGS(root, start, len),
631
632 TP_STRUCT__entry(
633 __field( u64, root_objectid )
634 __field( u64, start )
635 __field( u64, len )
636 ),
637
638 TP_fast_assign(
639 __entry->root_objectid = root->root_key.objectid;
640 __entry->start = start;
641 __entry->len = len;
642 ),
643
644 TP_printk("root = %llu(%s), start = %llu, len = %llu",
645 show_root_type(__entry->root_objectid),
646 (unsigned long long)__entry->start,
647 (unsigned long long)__entry->len)
648);
649
650DEFINE_EVENT(btrfs__reserved_extent, btrfs_reserved_extent_alloc,
651
652 TP_PROTO(struct btrfs_root *root, u64 start, u64 len),
653
654 TP_ARGS(root, start, len)
655);
656
657DEFINE_EVENT(btrfs__reserved_extent, btrfs_reserved_extent_free,
658
659 TP_PROTO(struct btrfs_root *root, u64 start, u64 len),
660
661 TP_ARGS(root, start, len)
662);
663
664#endif /* _TRACE_BTRFS_H */
665
666/* This part must be outside protection */
667#include <trace/define_trace.h>
diff --git a/include/trace/events/compaction.h b/include/trace/events/compaction.h
new file mode 100644
index 000000000000..388bcdd26d46
--- /dev/null
+++ b/include/trace/events/compaction.h
@@ -0,0 +1,74 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM compaction
3
4#if !defined(_TRACE_COMPACTION_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_COMPACTION_H
6
7#include <linux/types.h>
8#include <linux/tracepoint.h>
9#include "gfpflags.h"
10
11DECLARE_EVENT_CLASS(mm_compaction_isolate_template,
12
13 TP_PROTO(unsigned long nr_scanned,
14 unsigned long nr_taken),
15
16 TP_ARGS(nr_scanned, nr_taken),
17
18 TP_STRUCT__entry(
19 __field(unsigned long, nr_scanned)
20 __field(unsigned long, nr_taken)
21 ),
22
23 TP_fast_assign(
24 __entry->nr_scanned = nr_scanned;
25 __entry->nr_taken = nr_taken;
26 ),
27
28 TP_printk("nr_scanned=%lu nr_taken=%lu",
29 __entry->nr_scanned,
30 __entry->nr_taken)
31);
32
33DEFINE_EVENT(mm_compaction_isolate_template, mm_compaction_isolate_migratepages,
34
35 TP_PROTO(unsigned long nr_scanned,
36 unsigned long nr_taken),
37
38 TP_ARGS(nr_scanned, nr_taken)
39);
40
41DEFINE_EVENT(mm_compaction_isolate_template, mm_compaction_isolate_freepages,
42 TP_PROTO(unsigned long nr_scanned,
43 unsigned long nr_taken),
44
45 TP_ARGS(nr_scanned, nr_taken)
46);
47
48TRACE_EVENT(mm_compaction_migratepages,
49
50 TP_PROTO(unsigned long nr_migrated,
51 unsigned long nr_failed),
52
53 TP_ARGS(nr_migrated, nr_failed),
54
55 TP_STRUCT__entry(
56 __field(unsigned long, nr_migrated)
57 __field(unsigned long, nr_failed)
58 ),
59
60 TP_fast_assign(
61 __entry->nr_migrated = nr_migrated;
62 __entry->nr_failed = nr_failed;
63 ),
64
65 TP_printk("nr_migrated=%lu nr_failed=%lu",
66 __entry->nr_migrated,
67 __entry->nr_failed)
68);
69
70
71#endif /* _TRACE_COMPACTION_H */
72
73/* This part must be outside protection */
74#include <trace/define_trace.h>
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h
index 01e9e0076a92..5ce2b2f5f524 100644
--- a/include/trace/events/ext4.h
+++ b/include/trace/events/ext4.h
@@ -26,7 +26,7 @@ TRACE_EVENT(ext4_free_inode,
26 __field( umode_t, mode ) 26 __field( umode_t, mode )
27 __field( uid_t, uid ) 27 __field( uid_t, uid )
28 __field( gid_t, gid ) 28 __field( gid_t, gid )
29 __field( blkcnt_t, blocks ) 29 __field( __u64, blocks )
30 ), 30 ),
31 31
32 TP_fast_assign( 32 TP_fast_assign(
@@ -38,10 +38,10 @@ TRACE_EVENT(ext4_free_inode,
38 __entry->blocks = inode->i_blocks; 38 __entry->blocks = inode->i_blocks;
39 ), 39 ),
40 40
41 TP_printk("dev %s ino %lu mode 0%o uid %u gid %u blocks %llu", 41 TP_printk("dev %d,%d ino %lu mode 0%o uid %u gid %u blocks %llu",
42 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 42 MAJOR(__entry->dev), MINOR(__entry->dev),
43 __entry->mode, __entry->uid, __entry->gid, 43 (unsigned long) __entry->ino, __entry->mode,
44 (unsigned long long) __entry->blocks) 44 __entry->uid, __entry->gid, __entry->blocks)
45); 45);
46 46
47TRACE_EVENT(ext4_request_inode, 47TRACE_EVENT(ext4_request_inode,
@@ -61,9 +61,9 @@ TRACE_EVENT(ext4_request_inode,
61 __entry->mode = mode; 61 __entry->mode = mode;
62 ), 62 ),
63 63
64 TP_printk("dev %s dir %lu mode 0%o", 64 TP_printk("dev %d,%d dir %lu mode 0%o",
65 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->dir, 65 MAJOR(__entry->dev), MINOR(__entry->dev),
66 __entry->mode) 66 (unsigned long) __entry->dir, __entry->mode)
67); 67);
68 68
69TRACE_EVENT(ext4_allocate_inode, 69TRACE_EVENT(ext4_allocate_inode,
@@ -85,11 +85,101 @@ TRACE_EVENT(ext4_allocate_inode,
85 __entry->mode = mode; 85 __entry->mode = mode;
86 ), 86 ),
87 87
88 TP_printk("dev %s ino %lu dir %lu mode 0%o", 88 TP_printk("dev %d,%d ino %lu dir %lu mode 0%o",
89 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 89 MAJOR(__entry->dev), MINOR(__entry->dev),
90 (unsigned long) __entry->ino,
90 (unsigned long) __entry->dir, __entry->mode) 91 (unsigned long) __entry->dir, __entry->mode)
91); 92);
92 93
94TRACE_EVENT(ext4_evict_inode,
95 TP_PROTO(struct inode *inode),
96
97 TP_ARGS(inode),
98
99 TP_STRUCT__entry(
100 __field( dev_t, dev )
101 __field( ino_t, ino )
102 __field( int, nlink )
103 ),
104
105 TP_fast_assign(
106 __entry->dev = inode->i_sb->s_dev;
107 __entry->ino = inode->i_ino;
108 __entry->nlink = inode->i_nlink;
109 ),
110
111 TP_printk("dev %d,%d ino %lu nlink %d",
112 MAJOR(__entry->dev), MINOR(__entry->dev),
113 (unsigned long) __entry->ino, __entry->nlink)
114);
115
116TRACE_EVENT(ext4_drop_inode,
117 TP_PROTO(struct inode *inode, int drop),
118
119 TP_ARGS(inode, drop),
120
121 TP_STRUCT__entry(
122 __field( dev_t, dev )
123 __field( ino_t, ino )
124 __field( int, drop )
125 ),
126
127 TP_fast_assign(
128 __entry->dev = inode->i_sb->s_dev;
129 __entry->ino = inode->i_ino;
130 __entry->drop = drop;
131 ),
132
133 TP_printk("dev %d,%d ino %lu drop %d",
134 MAJOR(__entry->dev), MINOR(__entry->dev),
135 (unsigned long) __entry->ino, __entry->drop)
136);
137
138TRACE_EVENT(ext4_mark_inode_dirty,
139 TP_PROTO(struct inode *inode, unsigned long IP),
140
141 TP_ARGS(inode, IP),
142
143 TP_STRUCT__entry(
144 __field( dev_t, dev )
145 __field( ino_t, ino )
146 __field(unsigned long, ip )
147 ),
148
149 TP_fast_assign(
150 __entry->dev = inode->i_sb->s_dev;
151 __entry->ino = inode->i_ino;
152 __entry->ip = IP;
153 ),
154
155 TP_printk("dev %d,%d ino %lu caller %pF",
156 MAJOR(__entry->dev), MINOR(__entry->dev),
157 (unsigned long) __entry->ino, (void *)__entry->ip)
158);
159
160TRACE_EVENT(ext4_begin_ordered_truncate,
161 TP_PROTO(struct inode *inode, loff_t new_size),
162
163 TP_ARGS(inode, new_size),
164
165 TP_STRUCT__entry(
166 __field( dev_t, dev )
167 __field( ino_t, ino )
168 __field( loff_t, new_size )
169 ),
170
171 TP_fast_assign(
172 __entry->dev = inode->i_sb->s_dev;
173 __entry->ino = inode->i_ino;
174 __entry->new_size = new_size;
175 ),
176
177 TP_printk("dev %d,%d ino %lu new_size %lld",
178 MAJOR(__entry->dev), MINOR(__entry->dev),
179 (unsigned long) __entry->ino,
180 __entry->new_size)
181);
182
93DECLARE_EVENT_CLASS(ext4__write_begin, 183DECLARE_EVENT_CLASS(ext4__write_begin,
94 184
95 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, 185 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
@@ -113,8 +203,9 @@ DECLARE_EVENT_CLASS(ext4__write_begin,
113 __entry->flags = flags; 203 __entry->flags = flags;
114 ), 204 ),
115 205
116 TP_printk("dev %s ino %lu pos %llu len %u flags %u", 206 TP_printk("dev %d,%d ino %lu pos %lld len %u flags %u",
117 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 207 MAJOR(__entry->dev), MINOR(__entry->dev),
208 (unsigned long) __entry->ino,
118 __entry->pos, __entry->len, __entry->flags) 209 __entry->pos, __entry->len, __entry->flags)
119); 210);
120 211
@@ -156,8 +247,9 @@ DECLARE_EVENT_CLASS(ext4__write_end,
156 __entry->copied = copied; 247 __entry->copied = copied;
157 ), 248 ),
158 249
159 TP_printk("dev %s ino %lu pos %llu len %u copied %u", 250 TP_printk("dev %d,%d ino %lu pos %lld len %u copied %u",
160 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 251 MAJOR(__entry->dev), MINOR(__entry->dev),
252 (unsigned long) __entry->ino,
161 __entry->pos, __entry->len, __entry->copied) 253 __entry->pos, __entry->len, __entry->copied)
162); 254);
163 255
@@ -193,29 +285,6 @@ DEFINE_EVENT(ext4__write_end, ext4_da_write_end,
193 TP_ARGS(inode, pos, len, copied) 285 TP_ARGS(inode, pos, len, copied)
194); 286);
195 287
196TRACE_EVENT(ext4_writepage,
197 TP_PROTO(struct inode *inode, struct page *page),
198
199 TP_ARGS(inode, page),
200
201 TP_STRUCT__entry(
202 __field( dev_t, dev )
203 __field( ino_t, ino )
204 __field( pgoff_t, index )
205
206 ),
207
208 TP_fast_assign(
209 __entry->dev = inode->i_sb->s_dev;
210 __entry->ino = inode->i_ino;
211 __entry->index = page->index;
212 ),
213
214 TP_printk("dev %s ino %lu page_index %lu",
215 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
216 __entry->index)
217);
218
219TRACE_EVENT(ext4_da_writepages, 288TRACE_EVENT(ext4_da_writepages,
220 TP_PROTO(struct inode *inode, struct writeback_control *wbc), 289 TP_PROTO(struct inode *inode, struct writeback_control *wbc),
221 290
@@ -228,9 +297,8 @@ TRACE_EVENT(ext4_da_writepages,
228 __field( long, pages_skipped ) 297 __field( long, pages_skipped )
229 __field( loff_t, range_start ) 298 __field( loff_t, range_start )
230 __field( loff_t, range_end ) 299 __field( loff_t, range_end )
231 __field( char, nonblocking ) 300 __field( int, sync_mode )
232 __field( char, for_kupdate ) 301 __field( char, for_kupdate )
233 __field( char, for_reclaim )
234 __field( char, range_cyclic ) 302 __field( char, range_cyclic )
235 __field( pgoff_t, writeback_index ) 303 __field( pgoff_t, writeback_index )
236 ), 304 ),
@@ -242,20 +310,20 @@ TRACE_EVENT(ext4_da_writepages,
242 __entry->pages_skipped = wbc->pages_skipped; 310 __entry->pages_skipped = wbc->pages_skipped;
243 __entry->range_start = wbc->range_start; 311 __entry->range_start = wbc->range_start;
244 __entry->range_end = wbc->range_end; 312 __entry->range_end = wbc->range_end;
245 __entry->nonblocking = wbc->nonblocking; 313 __entry->sync_mode = wbc->sync_mode;
246 __entry->for_kupdate = wbc->for_kupdate; 314 __entry->for_kupdate = wbc->for_kupdate;
247 __entry->for_reclaim = wbc->for_reclaim;
248 __entry->range_cyclic = wbc->range_cyclic; 315 __entry->range_cyclic = wbc->range_cyclic;
249 __entry->writeback_index = inode->i_mapping->writeback_index; 316 __entry->writeback_index = inode->i_mapping->writeback_index;
250 ), 317 ),
251 318
252 TP_printk("dev %s ino %lu nr_to_write %ld pages_skipped %ld range_start %llu range_end %llu nonblocking %d for_kupdate %d for_reclaim %d range_cyclic %d writeback_index %lu", 319 TP_printk("dev %d,%d ino %lu nr_to_write %ld pages_skipped %ld "
253 jbd2_dev_to_name(__entry->dev), 320 "range_start %lld range_end %lld sync_mode %d"
321 "for_kupdate %d range_cyclic %d writeback_index %lu",
322 MAJOR(__entry->dev), MINOR(__entry->dev),
254 (unsigned long) __entry->ino, __entry->nr_to_write, 323 (unsigned long) __entry->ino, __entry->nr_to_write,
255 __entry->pages_skipped, __entry->range_start, 324 __entry->pages_skipped, __entry->range_start,
256 __entry->range_end, __entry->nonblocking, 325 __entry->range_end, __entry->sync_mode,
257 __entry->for_kupdate, __entry->for_reclaim, 326 __entry->for_kupdate, __entry->range_cyclic,
258 __entry->range_cyclic,
259 (unsigned long) __entry->writeback_index) 327 (unsigned long) __entry->writeback_index)
260); 328);
261 329
@@ -273,6 +341,7 @@ TRACE_EVENT(ext4_da_write_pages,
273 __field( unsigned long, first_page ) 341 __field( unsigned long, first_page )
274 __field( int, io_done ) 342 __field( int, io_done )
275 __field( int, pages_written ) 343 __field( int, pages_written )
344 __field( int, sync_mode )
276 ), 345 ),
277 346
278 TP_fast_assign( 347 TP_fast_assign(
@@ -284,13 +353,18 @@ TRACE_EVENT(ext4_da_write_pages,
284 __entry->first_page = mpd->first_page; 353 __entry->first_page = mpd->first_page;
285 __entry->io_done = mpd->io_done; 354 __entry->io_done = mpd->io_done;
286 __entry->pages_written = mpd->pages_written; 355 __entry->pages_written = mpd->pages_written;
356 __entry->sync_mode = mpd->wbc->sync_mode;
287 ), 357 ),
288 358
289 TP_printk("dev %s ino %lu b_blocknr %llu b_size %u b_state 0x%04x first_page %lu io_done %d pages_written %d", 359 TP_printk("dev %d,%d ino %lu b_blocknr %llu b_size %u b_state 0x%04x "
290 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 360 "first_page %lu io_done %d pages_written %d sync_mode %d",
361 MAJOR(__entry->dev), MINOR(__entry->dev),
362 (unsigned long) __entry->ino,
291 __entry->b_blocknr, __entry->b_size, 363 __entry->b_blocknr, __entry->b_size,
292 __entry->b_state, __entry->first_page, 364 __entry->b_state, __entry->first_page,
293 __entry->io_done, __entry->pages_written) 365 __entry->io_done, __entry->pages_written,
366 __entry->sync_mode
367 )
294); 368);
295 369
296TRACE_EVENT(ext4_da_writepages_result, 370TRACE_EVENT(ext4_da_writepages_result,
@@ -305,6 +379,7 @@ TRACE_EVENT(ext4_da_writepages_result,
305 __field( int, ret ) 379 __field( int, ret )
306 __field( int, pages_written ) 380 __field( int, pages_written )
307 __field( long, pages_skipped ) 381 __field( long, pages_skipped )
382 __field( int, sync_mode )
308 __field( char, more_io ) 383 __field( char, more_io )
309 __field( pgoff_t, writeback_index ) 384 __field( pgoff_t, writeback_index )
310 ), 385 ),
@@ -315,18 +390,91 @@ TRACE_EVENT(ext4_da_writepages_result,
315 __entry->ret = ret; 390 __entry->ret = ret;
316 __entry->pages_written = pages_written; 391 __entry->pages_written = pages_written;
317 __entry->pages_skipped = wbc->pages_skipped; 392 __entry->pages_skipped = wbc->pages_skipped;
393 __entry->sync_mode = wbc->sync_mode;
318 __entry->more_io = wbc->more_io; 394 __entry->more_io = wbc->more_io;
319 __entry->writeback_index = inode->i_mapping->writeback_index; 395 __entry->writeback_index = inode->i_mapping->writeback_index;
320 ), 396 ),
321 397
322 TP_printk("dev %s ino %lu ret %d pages_written %d pages_skipped %ld more_io %d writeback_index %lu", 398 TP_printk("dev %d,%d ino %lu ret %d pages_written %d pages_skipped %ld "
323 jbd2_dev_to_name(__entry->dev), 399 " more_io %d sync_mode %d writeback_index %lu",
400 MAJOR(__entry->dev), MINOR(__entry->dev),
324 (unsigned long) __entry->ino, __entry->ret, 401 (unsigned long) __entry->ino, __entry->ret,
325 __entry->pages_written, __entry->pages_skipped, 402 __entry->pages_written, __entry->pages_skipped,
326 __entry->more_io, 403 __entry->more_io, __entry->sync_mode,
327 (unsigned long) __entry->writeback_index) 404 (unsigned long) __entry->writeback_index)
328); 405);
329 406
407DECLARE_EVENT_CLASS(ext4__page_op,
408 TP_PROTO(struct page *page),
409
410 TP_ARGS(page),
411
412 TP_STRUCT__entry(
413 __field( pgoff_t, index )
414 __field( ino_t, ino )
415 __field( dev_t, dev )
416
417 ),
418
419 TP_fast_assign(
420 __entry->index = page->index;
421 __entry->ino = page->mapping->host->i_ino;
422 __entry->dev = page->mapping->host->i_sb->s_dev;
423 ),
424
425 TP_printk("dev %d,%d ino %lu page_index %lu",
426 MAJOR(__entry->dev), MINOR(__entry->dev),
427 (unsigned long) __entry->ino,
428 (unsigned long) __entry->index)
429);
430
431DEFINE_EVENT(ext4__page_op, ext4_writepage,
432
433 TP_PROTO(struct page *page),
434
435 TP_ARGS(page)
436);
437
438DEFINE_EVENT(ext4__page_op, ext4_readpage,
439
440 TP_PROTO(struct page *page),
441
442 TP_ARGS(page)
443);
444
445DEFINE_EVENT(ext4__page_op, ext4_releasepage,
446
447 TP_PROTO(struct page *page),
448
449 TP_ARGS(page)
450);
451
452TRACE_EVENT(ext4_invalidatepage,
453 TP_PROTO(struct page *page, unsigned long offset),
454
455 TP_ARGS(page, offset),
456
457 TP_STRUCT__entry(
458 __field( pgoff_t, index )
459 __field( unsigned long, offset )
460 __field( ino_t, ino )
461 __field( dev_t, dev )
462
463 ),
464
465 TP_fast_assign(
466 __entry->index = page->index;
467 __entry->offset = offset;
468 __entry->ino = page->mapping->host->i_ino;
469 __entry->dev = page->mapping->host->i_sb->s_dev;
470 ),
471
472 TP_printk("dev %d,%d ino %lu page_index %lu offset %lu",
473 MAJOR(__entry->dev), MINOR(__entry->dev),
474 (unsigned long) __entry->ino,
475 (unsigned long) __entry->index, __entry->offset)
476);
477
330TRACE_EVENT(ext4_discard_blocks, 478TRACE_EVENT(ext4_discard_blocks,
331 TP_PROTO(struct super_block *sb, unsigned long long blk, 479 TP_PROTO(struct super_block *sb, unsigned long long blk,
332 unsigned long long count), 480 unsigned long long count),
@@ -346,8 +494,9 @@ TRACE_EVENT(ext4_discard_blocks,
346 __entry->count = count; 494 __entry->count = count;
347 ), 495 ),
348 496
349 TP_printk("dev %s blk %llu count %llu", 497 TP_printk("dev %d,%d blk %llu count %llu",
350 jbd2_dev_to_name(__entry->dev), __entry->blk, __entry->count) 498 MAJOR(__entry->dev), MINOR(__entry->dev),
499 __entry->blk, __entry->count)
351); 500);
352 501
353DECLARE_EVENT_CLASS(ext4__mb_new_pa, 502DECLARE_EVENT_CLASS(ext4__mb_new_pa,
@@ -373,8 +522,9 @@ DECLARE_EVENT_CLASS(ext4__mb_new_pa,
373 __entry->pa_lstart = pa->pa_lstart; 522 __entry->pa_lstart = pa->pa_lstart;
374 ), 523 ),
375 524
376 TP_printk("dev %s ino %lu pstart %llu len %u lstart %llu", 525 TP_printk("dev %d,%d ino %lu pstart %llu len %u lstart %llu",
377 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 526 MAJOR(__entry->dev), MINOR(__entry->dev),
527 (unsigned long) __entry->ino,
378 __entry->pa_pstart, __entry->pa_len, __entry->pa_lstart) 528 __entry->pa_pstart, __entry->pa_len, __entry->pa_lstart)
379); 529);
380 530
@@ -395,12 +545,10 @@ DEFINE_EVENT(ext4__mb_new_pa, ext4_mb_new_group_pa,
395); 545);
396 546
397TRACE_EVENT(ext4_mb_release_inode_pa, 547TRACE_EVENT(ext4_mb_release_inode_pa,
398 TP_PROTO(struct super_block *sb, 548 TP_PROTO(struct ext4_prealloc_space *pa,
399 struct ext4_allocation_context *ac,
400 struct ext4_prealloc_space *pa,
401 unsigned long long block, unsigned int count), 549 unsigned long long block, unsigned int count),
402 550
403 TP_ARGS(sb, ac, pa, block, count), 551 TP_ARGS(pa, block, count),
404 552
405 TP_STRUCT__entry( 553 TP_STRUCT__entry(
406 __field( dev_t, dev ) 554 __field( dev_t, dev )
@@ -411,43 +559,39 @@ TRACE_EVENT(ext4_mb_release_inode_pa,
411 ), 559 ),
412 560
413 TP_fast_assign( 561 TP_fast_assign(
414 __entry->dev = sb->s_dev; 562 __entry->dev = pa->pa_inode->i_sb->s_dev;
415 __entry->ino = (ac && ac->ac_inode) ? 563 __entry->ino = pa->pa_inode->i_ino;
416 ac->ac_inode->i_ino : 0;
417 __entry->block = block; 564 __entry->block = block;
418 __entry->count = count; 565 __entry->count = count;
419 ), 566 ),
420 567
421 TP_printk("dev %s ino %lu block %llu count %u", 568 TP_printk("dev %d,%d ino %lu block %llu count %u",
422 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 569 MAJOR(__entry->dev), MINOR(__entry->dev),
570 (unsigned long) __entry->ino,
423 __entry->block, __entry->count) 571 __entry->block, __entry->count)
424); 572);
425 573
426TRACE_EVENT(ext4_mb_release_group_pa, 574TRACE_EVENT(ext4_mb_release_group_pa,
427 TP_PROTO(struct super_block *sb, 575 TP_PROTO(struct ext4_prealloc_space *pa),
428 struct ext4_allocation_context *ac,
429 struct ext4_prealloc_space *pa),
430 576
431 TP_ARGS(sb, ac, pa), 577 TP_ARGS(pa),
432 578
433 TP_STRUCT__entry( 579 TP_STRUCT__entry(
434 __field( dev_t, dev ) 580 __field( dev_t, dev )
435 __field( ino_t, ino )
436 __field( __u64, pa_pstart ) 581 __field( __u64, pa_pstart )
437 __field( __u32, pa_len ) 582 __field( __u32, pa_len )
438 583
439 ), 584 ),
440 585
441 TP_fast_assign( 586 TP_fast_assign(
442 __entry->dev = sb->s_dev; 587 __entry->dev = pa->pa_inode->i_sb->s_dev;
443 __entry->ino = (ac && ac->ac_inode) ?
444 ac->ac_inode->i_ino : 0;
445 __entry->pa_pstart = pa->pa_pstart; 588 __entry->pa_pstart = pa->pa_pstart;
446 __entry->pa_len = pa->pa_len; 589 __entry->pa_len = pa->pa_len;
447 ), 590 ),
448 591
449 TP_printk("dev %s pstart %llu len %u", 592 TP_printk("dev %d,%d pstart %llu len %u",
450 jbd2_dev_to_name(__entry->dev), __entry->pa_pstart, __entry->pa_len) 593 MAJOR(__entry->dev), MINOR(__entry->dev),
594 __entry->pa_pstart, __entry->pa_len)
451); 595);
452 596
453TRACE_EVENT(ext4_discard_preallocations, 597TRACE_EVENT(ext4_discard_preallocations,
@@ -466,8 +610,9 @@ TRACE_EVENT(ext4_discard_preallocations,
466 __entry->ino = inode->i_ino; 610 __entry->ino = inode->i_ino;
467 ), 611 ),
468 612
469 TP_printk("dev %s ino %lu", 613 TP_printk("dev %d,%d ino %lu",
470 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino) 614 MAJOR(__entry->dev), MINOR(__entry->dev),
615 (unsigned long) __entry->ino)
471); 616);
472 617
473TRACE_EVENT(ext4_mb_discard_preallocations, 618TRACE_EVENT(ext4_mb_discard_preallocations,
@@ -486,8 +631,9 @@ TRACE_EVENT(ext4_mb_discard_preallocations,
486 __entry->needed = needed; 631 __entry->needed = needed;
487 ), 632 ),
488 633
489 TP_printk("dev %s needed %d", 634 TP_printk("dev %d,%d needed %d",
490 jbd2_dev_to_name(__entry->dev), __entry->needed) 635 MAJOR(__entry->dev), MINOR(__entry->dev),
636 __entry->needed)
491); 637);
492 638
493TRACE_EVENT(ext4_request_blocks, 639TRACE_EVENT(ext4_request_blocks,
@@ -500,10 +646,10 @@ TRACE_EVENT(ext4_request_blocks,
500 __field( ino_t, ino ) 646 __field( ino_t, ino )
501 __field( unsigned int, flags ) 647 __field( unsigned int, flags )
502 __field( unsigned int, len ) 648 __field( unsigned int, len )
503 __field( __u64, logical ) 649 __field( __u32, logical )
650 __field( __u32, lleft )
651 __field( __u32, lright )
504 __field( __u64, goal ) 652 __field( __u64, goal )
505 __field( __u64, lleft )
506 __field( __u64, lright )
507 __field( __u64, pleft ) 653 __field( __u64, pleft )
508 __field( __u64, pright ) 654 __field( __u64, pright )
509 ), 655 ),
@@ -521,15 +667,13 @@ TRACE_EVENT(ext4_request_blocks,
521 __entry->pright = ar->pright; 667 __entry->pright = ar->pright;
522 ), 668 ),
523 669
524 TP_printk("dev %s ino %lu flags %u len %u lblk %llu goal %llu lleft %llu lright %llu pleft %llu pright %llu ", 670 TP_printk("dev %d,%d ino %lu flags %u len %u lblk %u goal %llu "
525 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 671 "lleft %u lright %u pleft %llu pright %llu ",
526 __entry->flags, __entry->len, 672 MAJOR(__entry->dev), MINOR(__entry->dev),
527 (unsigned long long) __entry->logical, 673 (unsigned long) __entry->ino, __entry->flags,
528 (unsigned long long) __entry->goal, 674 __entry->len, __entry->logical, __entry->goal,
529 (unsigned long long) __entry->lleft, 675 __entry->lleft, __entry->lright, __entry->pleft,
530 (unsigned long long) __entry->lright, 676 __entry->pright)
531 (unsigned long long) __entry->pleft,
532 (unsigned long long) __entry->pright)
533); 677);
534 678
535TRACE_EVENT(ext4_allocate_blocks, 679TRACE_EVENT(ext4_allocate_blocks,
@@ -543,10 +687,10 @@ TRACE_EVENT(ext4_allocate_blocks,
543 __field( __u64, block ) 687 __field( __u64, block )
544 __field( unsigned int, flags ) 688 __field( unsigned int, flags )
545 __field( unsigned int, len ) 689 __field( unsigned int, len )
546 __field( __u64, logical ) 690 __field( __u32, logical )
691 __field( __u32, lleft )
692 __field( __u32, lright )
547 __field( __u64, goal ) 693 __field( __u64, goal )
548 __field( __u64, lleft )
549 __field( __u64, lright )
550 __field( __u64, pleft ) 694 __field( __u64, pleft )
551 __field( __u64, pright ) 695 __field( __u64, pright )
552 ), 696 ),
@@ -565,15 +709,13 @@ TRACE_EVENT(ext4_allocate_blocks,
565 __entry->pright = ar->pright; 709 __entry->pright = ar->pright;
566 ), 710 ),
567 711
568 TP_printk("dev %s ino %lu flags %u len %u block %llu lblk %llu goal %llu lleft %llu lright %llu pleft %llu pright %llu ", 712 TP_printk("dev %d,%d ino %lu flags %u len %u block %llu lblk %u "
569 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 713 "goal %llu lleft %u lright %u pleft %llu pright %llu",
570 __entry->flags, __entry->len, __entry->block, 714 MAJOR(__entry->dev), MINOR(__entry->dev),
571 (unsigned long long) __entry->logical, 715 (unsigned long) __entry->ino, __entry->flags,
572 (unsigned long long) __entry->goal, 716 __entry->len, __entry->block, __entry->logical,
573 (unsigned long long) __entry->lleft, 717 __entry->goal, __entry->lleft, __entry->lright,
574 (unsigned long long) __entry->lright, 718 __entry->pleft, __entry->pright)
575 (unsigned long long) __entry->pleft,
576 (unsigned long long) __entry->pright)
577); 719);
578 720
579TRACE_EVENT(ext4_free_blocks, 721TRACE_EVENT(ext4_free_blocks,
@@ -585,10 +727,10 @@ TRACE_EVENT(ext4_free_blocks,
585 TP_STRUCT__entry( 727 TP_STRUCT__entry(
586 __field( dev_t, dev ) 728 __field( dev_t, dev )
587 __field( ino_t, ino ) 729 __field( ino_t, ino )
588 __field( umode_t, mode ) 730 __field( umode_t, mode )
589 __field( __u64, block ) 731 __field( __u64, block )
590 __field( unsigned long, count ) 732 __field( unsigned long, count )
591 __field( int, flags ) 733 __field( int, flags )
592 ), 734 ),
593 735
594 TP_fast_assign( 736 TP_fast_assign(
@@ -600,13 +742,14 @@ TRACE_EVENT(ext4_free_blocks,
600 __entry->flags = flags; 742 __entry->flags = flags;
601 ), 743 ),
602 744
603 TP_printk("dev %s ino %lu mode 0%o block %llu count %lu flags %d", 745 TP_printk("dev %d,%d ino %lu mode 0%o block %llu count %lu flags %d",
604 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 746 MAJOR(__entry->dev), MINOR(__entry->dev),
747 (unsigned long) __entry->ino,
605 __entry->mode, __entry->block, __entry->count, 748 __entry->mode, __entry->block, __entry->count,
606 __entry->flags) 749 __entry->flags)
607); 750);
608 751
609TRACE_EVENT(ext4_sync_file, 752TRACE_EVENT(ext4_sync_file_enter,
610 TP_PROTO(struct file *file, int datasync), 753 TP_PROTO(struct file *file, int datasync),
611 754
612 TP_ARGS(file, datasync), 755 TP_ARGS(file, datasync),
@@ -627,11 +770,35 @@ TRACE_EVENT(ext4_sync_file,
627 __entry->parent = dentry->d_parent->d_inode->i_ino; 770 __entry->parent = dentry->d_parent->d_inode->i_ino;
628 ), 771 ),
629 772
630 TP_printk("dev %s ino %ld parent %ld datasync %d ", 773 TP_printk("dev %d,%d ino %lu parent %lu datasync %d ",
631 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 774 MAJOR(__entry->dev), MINOR(__entry->dev),
775 (unsigned long) __entry->ino,
632 (unsigned long) __entry->parent, __entry->datasync) 776 (unsigned long) __entry->parent, __entry->datasync)
633); 777);
634 778
779TRACE_EVENT(ext4_sync_file_exit,
780 TP_PROTO(struct inode *inode, int ret),
781
782 TP_ARGS(inode, ret),
783
784 TP_STRUCT__entry(
785 __field( int, ret )
786 __field( ino_t, ino )
787 __field( dev_t, dev )
788 ),
789
790 TP_fast_assign(
791 __entry->ret = ret;
792 __entry->ino = inode->i_ino;
793 __entry->dev = inode->i_sb->s_dev;
794 ),
795
796 TP_printk("dev %d,%d ino %lu ret %d",
797 MAJOR(__entry->dev), MINOR(__entry->dev),
798 (unsigned long) __entry->ino,
799 __entry->ret)
800);
801
635TRACE_EVENT(ext4_sync_fs, 802TRACE_EVENT(ext4_sync_fs,
636 TP_PROTO(struct super_block *sb, int wait), 803 TP_PROTO(struct super_block *sb, int wait),
637 804
@@ -648,7 +815,8 @@ TRACE_EVENT(ext4_sync_fs,
648 __entry->wait = wait; 815 __entry->wait = wait;
649 ), 816 ),
650 817
651 TP_printk("dev %s wait %d", jbd2_dev_to_name(__entry->dev), 818 TP_printk("dev %d,%d wait %d",
819 MAJOR(__entry->dev), MINOR(__entry->dev),
652 __entry->wait) 820 __entry->wait)
653); 821);
654 822
@@ -671,8 +839,9 @@ TRACE_EVENT(ext4_alloc_da_blocks,
671 __entry->meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks; 839 __entry->meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks;
672 ), 840 ),
673 841
674 TP_printk("dev %s ino %lu data_blocks %u meta_blocks %u", 842 TP_printk("dev %d,%d ino %lu data_blocks %u meta_blocks %u",
675 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 843 MAJOR(__entry->dev), MINOR(__entry->dev),
844 (unsigned long) __entry->ino,
676 __entry->data_blocks, __entry->meta_blocks) 845 __entry->data_blocks, __entry->meta_blocks)
677); 846);
678 847
@@ -727,10 +896,11 @@ TRACE_EVENT(ext4_mballoc_alloc,
727 __entry->result_len = ac->ac_f_ex.fe_len; 896 __entry->result_len = ac->ac_f_ex.fe_len;
728 ), 897 ),
729 898
730 TP_printk("dev %s inode %lu orig %u/%d/%u@%u goal %u/%d/%u@%u " 899 TP_printk("dev %d,%d inode %lu orig %u/%d/%u@%u goal %u/%d/%u@%u "
731 "result %u/%d/%u@%u blks %u grps %u cr %u flags 0x%04x " 900 "result %u/%d/%u@%u blks %u grps %u cr %u flags 0x%04x "
732 "tail %u broken %u", 901 "tail %u broken %u",
733 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 902 MAJOR(__entry->dev), MINOR(__entry->dev),
903 (unsigned long) __entry->ino,
734 __entry->orig_group, __entry->orig_start, 904 __entry->orig_group, __entry->orig_start,
735 __entry->orig_len, __entry->orig_logical, 905 __entry->orig_len, __entry->orig_logical,
736 __entry->goal_group, __entry->goal_start, 906 __entry->goal_group, __entry->goal_start,
@@ -773,8 +943,9 @@ TRACE_EVENT(ext4_mballoc_prealloc,
773 __entry->result_len = ac->ac_b_ex.fe_len; 943 __entry->result_len = ac->ac_b_ex.fe_len;
774 ), 944 ),
775 945
776 TP_printk("dev %s inode %lu orig %u/%d/%u@%u result %u/%d/%u@%u", 946 TP_printk("dev %d,%d inode %lu orig %u/%d/%u@%u result %u/%d/%u@%u",
777 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 947 MAJOR(__entry->dev), MINOR(__entry->dev),
948 (unsigned long) __entry->ino,
778 __entry->orig_group, __entry->orig_start, 949 __entry->orig_group, __entry->orig_start,
779 __entry->orig_len, __entry->orig_logical, 950 __entry->orig_len, __entry->orig_logical,
780 __entry->result_group, __entry->result_start, 951 __entry->result_group, __entry->result_start,
@@ -782,46 +953,57 @@ TRACE_EVENT(ext4_mballoc_prealloc,
782); 953);
783 954
784DECLARE_EVENT_CLASS(ext4__mballoc, 955DECLARE_EVENT_CLASS(ext4__mballoc,
785 TP_PROTO(struct ext4_allocation_context *ac), 956 TP_PROTO(struct super_block *sb,
957 struct inode *inode,
958 ext4_group_t group,
959 ext4_grpblk_t start,
960 ext4_grpblk_t len),
786 961
787 TP_ARGS(ac), 962 TP_ARGS(sb, inode, group, start, len),
788 963
789 TP_STRUCT__entry( 964 TP_STRUCT__entry(
790 __field( dev_t, dev ) 965 __field( dev_t, dev )
791 __field( ino_t, ino ) 966 __field( ino_t, ino )
792 __field( __u32, result_logical )
793 __field( int, result_start ) 967 __field( int, result_start )
794 __field( __u32, result_group ) 968 __field( __u32, result_group )
795 __field( int, result_len ) 969 __field( int, result_len )
796 ), 970 ),
797 971
798 TP_fast_assign( 972 TP_fast_assign(
799 __entry->dev = ac->ac_inode->i_sb->s_dev; 973 __entry->dev = sb->s_dev;
800 __entry->ino = ac->ac_inode->i_ino; 974 __entry->ino = inode ? inode->i_ino : 0;
801 __entry->result_logical = ac->ac_b_ex.fe_logical; 975 __entry->result_start = start;
802 __entry->result_start = ac->ac_b_ex.fe_start; 976 __entry->result_group = group;
803 __entry->result_group = ac->ac_b_ex.fe_group; 977 __entry->result_len = len;
804 __entry->result_len = ac->ac_b_ex.fe_len;
805 ), 978 ),
806 979
807 TP_printk("dev %s inode %lu extent %u/%d/%u@%u ", 980 TP_printk("dev %d,%d inode %lu extent %u/%d/%d ",
808 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 981 MAJOR(__entry->dev), MINOR(__entry->dev),
982 (unsigned long) __entry->ino,
809 __entry->result_group, __entry->result_start, 983 __entry->result_group, __entry->result_start,
810 __entry->result_len, __entry->result_logical) 984 __entry->result_len)
811); 985);
812 986
813DEFINE_EVENT(ext4__mballoc, ext4_mballoc_discard, 987DEFINE_EVENT(ext4__mballoc, ext4_mballoc_discard,
814 988
815 TP_PROTO(struct ext4_allocation_context *ac), 989 TP_PROTO(struct super_block *sb,
990 struct inode *inode,
991 ext4_group_t group,
992 ext4_grpblk_t start,
993 ext4_grpblk_t len),
816 994
817 TP_ARGS(ac) 995 TP_ARGS(sb, inode, group, start, len)
818); 996);
819 997
820DEFINE_EVENT(ext4__mballoc, ext4_mballoc_free, 998DEFINE_EVENT(ext4__mballoc, ext4_mballoc_free,
821 999
822 TP_PROTO(struct ext4_allocation_context *ac), 1000 TP_PROTO(struct super_block *sb,
1001 struct inode *inode,
1002 ext4_group_t group,
1003 ext4_grpblk_t start,
1004 ext4_grpblk_t len),
823 1005
824 TP_ARGS(ac) 1006 TP_ARGS(sb, inode, group, start, len)
825); 1007);
826 1008
827TRACE_EVENT(ext4_forget, 1009TRACE_EVENT(ext4_forget,
@@ -845,8 +1027,9 @@ TRACE_EVENT(ext4_forget,
845 __entry->block = block; 1027 __entry->block = block;
846 ), 1028 ),
847 1029
848 TP_printk("dev %s ino %lu mode 0%o is_metadata %d block %llu", 1030 TP_printk("dev %d,%d ino %lu mode 0%o is_metadata %d block %llu",
849 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 1031 MAJOR(__entry->dev), MINOR(__entry->dev),
1032 (unsigned long) __entry->ino,
850 __entry->mode, __entry->is_metadata, __entry->block) 1033 __entry->mode, __entry->is_metadata, __entry->block)
851); 1034);
852 1035
@@ -877,9 +1060,12 @@ TRACE_EVENT(ext4_da_update_reserve_space,
877 __entry->allocated_meta_blocks = EXT4_I(inode)->i_allocated_meta_blocks; 1060 __entry->allocated_meta_blocks = EXT4_I(inode)->i_allocated_meta_blocks;
878 ), 1061 ),
879 1062
880 TP_printk("dev %s ino %lu mode 0%o i_blocks %llu used_blocks %d reserved_data_blocks %d reserved_meta_blocks %d allocated_meta_blocks %d", 1063 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu used_blocks %d "
881 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 1064 "reserved_data_blocks %d reserved_meta_blocks %d "
882 __entry->mode, (unsigned long long) __entry->i_blocks, 1065 "allocated_meta_blocks %d",
1066 MAJOR(__entry->dev), MINOR(__entry->dev),
1067 (unsigned long) __entry->ino,
1068 __entry->mode, __entry->i_blocks,
883 __entry->used_blocks, __entry->reserved_data_blocks, 1069 __entry->used_blocks, __entry->reserved_data_blocks,
884 __entry->reserved_meta_blocks, __entry->allocated_meta_blocks) 1070 __entry->reserved_meta_blocks, __entry->allocated_meta_blocks)
885); 1071);
@@ -909,9 +1095,11 @@ TRACE_EVENT(ext4_da_reserve_space,
909 __entry->reserved_meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks; 1095 __entry->reserved_meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks;
910 ), 1096 ),
911 1097
912 TP_printk("dev %s ino %lu mode 0%o i_blocks %llu md_needed %d reserved_data_blocks %d reserved_meta_blocks %d", 1098 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu md_needed %d "
913 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 1099 "reserved_data_blocks %d reserved_meta_blocks %d",
914 __entry->mode, (unsigned long long) __entry->i_blocks, 1100 MAJOR(__entry->dev), MINOR(__entry->dev),
1101 (unsigned long) __entry->ino,
1102 __entry->mode, __entry->i_blocks,
915 __entry->md_needed, __entry->reserved_data_blocks, 1103 __entry->md_needed, __entry->reserved_data_blocks,
916 __entry->reserved_meta_blocks) 1104 __entry->reserved_meta_blocks)
917); 1105);
@@ -943,9 +1131,12 @@ TRACE_EVENT(ext4_da_release_space,
943 __entry->allocated_meta_blocks = EXT4_I(inode)->i_allocated_meta_blocks; 1131 __entry->allocated_meta_blocks = EXT4_I(inode)->i_allocated_meta_blocks;
944 ), 1132 ),
945 1133
946 TP_printk("dev %s ino %lu mode 0%o i_blocks %llu freed_blocks %d reserved_data_blocks %d reserved_meta_blocks %d allocated_meta_blocks %d", 1134 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu freed_blocks %d "
947 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 1135 "reserved_data_blocks %d reserved_meta_blocks %d "
948 __entry->mode, (unsigned long long) __entry->i_blocks, 1136 "allocated_meta_blocks %d",
1137 MAJOR(__entry->dev), MINOR(__entry->dev),
1138 (unsigned long) __entry->ino,
1139 __entry->mode, __entry->i_blocks,
949 __entry->freed_blocks, __entry->reserved_data_blocks, 1140 __entry->freed_blocks, __entry->reserved_data_blocks,
950 __entry->reserved_meta_blocks, __entry->allocated_meta_blocks) 1141 __entry->reserved_meta_blocks, __entry->allocated_meta_blocks)
951); 1142);
@@ -966,8 +1157,9 @@ DECLARE_EVENT_CLASS(ext4__bitmap_load,
966 __entry->group = group; 1157 __entry->group = group;
967 ), 1158 ),
968 1159
969 TP_printk("dev %s group %u", 1160 TP_printk("dev %d,%d group %u",
970 jbd2_dev_to_name(__entry->dev), __entry->group) 1161 MAJOR(__entry->dev), MINOR(__entry->dev),
1162 __entry->group)
971); 1163);
972 1164
973DEFINE_EVENT(ext4__bitmap_load, ext4_mb_bitmap_load, 1165DEFINE_EVENT(ext4__bitmap_load, ext4_mb_bitmap_load,
@@ -984,6 +1176,350 @@ DEFINE_EVENT(ext4__bitmap_load, ext4_mb_buddy_bitmap_load,
984 TP_ARGS(sb, group) 1176 TP_ARGS(sb, group)
985); 1177);
986 1178
1179DEFINE_EVENT(ext4__bitmap_load, ext4_read_block_bitmap_load,
1180
1181 TP_PROTO(struct super_block *sb, unsigned long group),
1182
1183 TP_ARGS(sb, group)
1184);
1185
1186DEFINE_EVENT(ext4__bitmap_load, ext4_load_inode_bitmap,
1187
1188 TP_PROTO(struct super_block *sb, unsigned long group),
1189
1190 TP_ARGS(sb, group)
1191);
1192
1193TRACE_EVENT(ext4_direct_IO_enter,
1194 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len, int rw),
1195
1196 TP_ARGS(inode, offset, len, rw),
1197
1198 TP_STRUCT__entry(
1199 __field( ino_t, ino )
1200 __field( dev_t, dev )
1201 __field( loff_t, pos )
1202 __field( unsigned long, len )
1203 __field( int, rw )
1204 ),
1205
1206 TP_fast_assign(
1207 __entry->ino = inode->i_ino;
1208 __entry->dev = inode->i_sb->s_dev;
1209 __entry->pos = offset;
1210 __entry->len = len;
1211 __entry->rw = rw;
1212 ),
1213
1214 TP_printk("dev %d,%d ino %lu pos %lld len %lu rw %d",
1215 MAJOR(__entry->dev), MINOR(__entry->dev),
1216 (unsigned long) __entry->ino,
1217 __entry->pos, __entry->len, __entry->rw)
1218);
1219
1220TRACE_EVENT(ext4_direct_IO_exit,
1221 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len,
1222 int rw, int ret),
1223
1224 TP_ARGS(inode, offset, len, rw, ret),
1225
1226 TP_STRUCT__entry(
1227 __field( ino_t, ino )
1228 __field( dev_t, dev )
1229 __field( loff_t, pos )
1230 __field( unsigned long, len )
1231 __field( int, rw )
1232 __field( int, ret )
1233 ),
1234
1235 TP_fast_assign(
1236 __entry->ino = inode->i_ino;
1237 __entry->dev = inode->i_sb->s_dev;
1238 __entry->pos = offset;
1239 __entry->len = len;
1240 __entry->rw = rw;
1241 __entry->ret = ret;
1242 ),
1243
1244 TP_printk("dev %d,%d ino %lu pos %lld len %lu rw %d ret %d",
1245 MAJOR(__entry->dev), MINOR(__entry->dev),
1246 (unsigned long) __entry->ino,
1247 __entry->pos, __entry->len,
1248 __entry->rw, __entry->ret)
1249);
1250
1251TRACE_EVENT(ext4_fallocate_enter,
1252 TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode),
1253
1254 TP_ARGS(inode, offset, len, mode),
1255
1256 TP_STRUCT__entry(
1257 __field( ino_t, ino )
1258 __field( dev_t, dev )
1259 __field( loff_t, pos )
1260 __field( loff_t, len )
1261 __field( int, mode )
1262 ),
1263
1264 TP_fast_assign(
1265 __entry->ino = inode->i_ino;
1266 __entry->dev = inode->i_sb->s_dev;
1267 __entry->pos = offset;
1268 __entry->len = len;
1269 __entry->mode = mode;
1270 ),
1271
1272 TP_printk("dev %d,%d ino %lu pos %lld len %lld mode %d",
1273 MAJOR(__entry->dev), MINOR(__entry->dev),
1274 (unsigned long) __entry->ino, __entry->pos,
1275 __entry->len, __entry->mode)
1276);
1277
1278TRACE_EVENT(ext4_fallocate_exit,
1279 TP_PROTO(struct inode *inode, loff_t offset,
1280 unsigned int max_blocks, int ret),
1281
1282 TP_ARGS(inode, offset, max_blocks, ret),
1283
1284 TP_STRUCT__entry(
1285 __field( ino_t, ino )
1286 __field( dev_t, dev )
1287 __field( loff_t, pos )
1288 __field( unsigned int, blocks )
1289 __field( int, ret )
1290 ),
1291
1292 TP_fast_assign(
1293 __entry->ino = inode->i_ino;
1294 __entry->dev = inode->i_sb->s_dev;
1295 __entry->pos = offset;
1296 __entry->blocks = max_blocks;
1297 __entry->ret = ret;
1298 ),
1299
1300 TP_printk("dev %d,%d ino %lu pos %lld blocks %u ret %d",
1301 MAJOR(__entry->dev), MINOR(__entry->dev),
1302 (unsigned long) __entry->ino,
1303 __entry->pos, __entry->blocks,
1304 __entry->ret)
1305);
1306
1307TRACE_EVENT(ext4_unlink_enter,
1308 TP_PROTO(struct inode *parent, struct dentry *dentry),
1309
1310 TP_ARGS(parent, dentry),
1311
1312 TP_STRUCT__entry(
1313 __field( ino_t, parent )
1314 __field( ino_t, ino )
1315 __field( loff_t, size )
1316 __field( dev_t, dev )
1317 ),
1318
1319 TP_fast_assign(
1320 __entry->parent = parent->i_ino;
1321 __entry->ino = dentry->d_inode->i_ino;
1322 __entry->size = dentry->d_inode->i_size;
1323 __entry->dev = dentry->d_inode->i_sb->s_dev;
1324 ),
1325
1326 TP_printk("dev %d,%d ino %lu size %lld parent %lu",
1327 MAJOR(__entry->dev), MINOR(__entry->dev),
1328 (unsigned long) __entry->ino, __entry->size,
1329 (unsigned long) __entry->parent)
1330);
1331
1332TRACE_EVENT(ext4_unlink_exit,
1333 TP_PROTO(struct dentry *dentry, int ret),
1334
1335 TP_ARGS(dentry, ret),
1336
1337 TP_STRUCT__entry(
1338 __field( ino_t, ino )
1339 __field( dev_t, dev )
1340 __field( int, ret )
1341 ),
1342
1343 TP_fast_assign(
1344 __entry->ino = dentry->d_inode->i_ino;
1345 __entry->dev = dentry->d_inode->i_sb->s_dev;
1346 __entry->ret = ret;
1347 ),
1348
1349 TP_printk("dev %d,%d ino %lu ret %d",
1350 MAJOR(__entry->dev), MINOR(__entry->dev),
1351 (unsigned long) __entry->ino,
1352 __entry->ret)
1353);
1354
1355DECLARE_EVENT_CLASS(ext4__truncate,
1356 TP_PROTO(struct inode *inode),
1357
1358 TP_ARGS(inode),
1359
1360 TP_STRUCT__entry(
1361 __field( ino_t, ino )
1362 __field( dev_t, dev )
1363 __field( __u64, blocks )
1364 ),
1365
1366 TP_fast_assign(
1367 __entry->ino = inode->i_ino;
1368 __entry->dev = inode->i_sb->s_dev;
1369 __entry->blocks = inode->i_blocks;
1370 ),
1371
1372 TP_printk("dev %d,%d ino %lu blocks %llu",
1373 MAJOR(__entry->dev), MINOR(__entry->dev),
1374 (unsigned long) __entry->ino, __entry->blocks)
1375);
1376
1377DEFINE_EVENT(ext4__truncate, ext4_truncate_enter,
1378
1379 TP_PROTO(struct inode *inode),
1380
1381 TP_ARGS(inode)
1382);
1383
1384DEFINE_EVENT(ext4__truncate, ext4_truncate_exit,
1385
1386 TP_PROTO(struct inode *inode),
1387
1388 TP_ARGS(inode)
1389);
1390
1391DECLARE_EVENT_CLASS(ext4__map_blocks_enter,
1392 TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
1393 unsigned int len, unsigned int flags),
1394
1395 TP_ARGS(inode, lblk, len, flags),
1396
1397 TP_STRUCT__entry(
1398 __field( ino_t, ino )
1399 __field( dev_t, dev )
1400 __field( ext4_lblk_t, lblk )
1401 __field( unsigned int, len )
1402 __field( unsigned int, flags )
1403 ),
1404
1405 TP_fast_assign(
1406 __entry->ino = inode->i_ino;
1407 __entry->dev = inode->i_sb->s_dev;
1408 __entry->lblk = lblk;
1409 __entry->len = len;
1410 __entry->flags = flags;
1411 ),
1412
1413 TP_printk("dev %d,%d ino %lu lblk %u len %u flags %u",
1414 MAJOR(__entry->dev), MINOR(__entry->dev),
1415 (unsigned long) __entry->ino,
1416 __entry->lblk, __entry->len, __entry->flags)
1417);
1418
1419DEFINE_EVENT(ext4__map_blocks_enter, ext4_ext_map_blocks_enter,
1420 TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
1421 unsigned len, unsigned flags),
1422
1423 TP_ARGS(inode, lblk, len, flags)
1424);
1425
1426DEFINE_EVENT(ext4__map_blocks_enter, ext4_ind_map_blocks_enter,
1427 TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
1428 unsigned len, unsigned flags),
1429
1430 TP_ARGS(inode, lblk, len, flags)
1431);
1432
1433DECLARE_EVENT_CLASS(ext4__map_blocks_exit,
1434 TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
1435 ext4_fsblk_t pblk, unsigned int len, int ret),
1436
1437 TP_ARGS(inode, lblk, pblk, len, ret),
1438
1439 TP_STRUCT__entry(
1440 __field( ino_t, ino )
1441 __field( dev_t, dev )
1442 __field( ext4_lblk_t, lblk )
1443 __field( ext4_fsblk_t, pblk )
1444 __field( unsigned int, len )
1445 __field( int, ret )
1446 ),
1447
1448 TP_fast_assign(
1449 __entry->ino = inode->i_ino;
1450 __entry->dev = inode->i_sb->s_dev;
1451 __entry->lblk = lblk;
1452 __entry->pblk = pblk;
1453 __entry->len = len;
1454 __entry->ret = ret;
1455 ),
1456
1457 TP_printk("dev %d,%d ino %lu lblk %u pblk %llu len %u ret %d",
1458 MAJOR(__entry->dev), MINOR(__entry->dev),
1459 (unsigned long) __entry->ino,
1460 __entry->lblk, __entry->pblk,
1461 __entry->len, __entry->ret)
1462);
1463
1464DEFINE_EVENT(ext4__map_blocks_exit, ext4_ext_map_blocks_exit,
1465 TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
1466 ext4_fsblk_t pblk, unsigned len, int ret),
1467
1468 TP_ARGS(inode, lblk, pblk, len, ret)
1469);
1470
1471DEFINE_EVENT(ext4__map_blocks_exit, ext4_ind_map_blocks_exit,
1472 TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
1473 ext4_fsblk_t pblk, unsigned len, int ret),
1474
1475 TP_ARGS(inode, lblk, pblk, len, ret)
1476);
1477
1478TRACE_EVENT(ext4_ext_load_extent,
1479 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, ext4_fsblk_t pblk),
1480
1481 TP_ARGS(inode, lblk, pblk),
1482
1483 TP_STRUCT__entry(
1484 __field( ino_t, ino )
1485 __field( dev_t, dev )
1486 __field( ext4_lblk_t, lblk )
1487 __field( ext4_fsblk_t, pblk )
1488 ),
1489
1490 TP_fast_assign(
1491 __entry->ino = inode->i_ino;
1492 __entry->dev = inode->i_sb->s_dev;
1493 __entry->lblk = lblk;
1494 __entry->pblk = pblk;
1495 ),
1496
1497 TP_printk("dev %d,%d ino %lu lblk %u pblk %llu",
1498 MAJOR(__entry->dev), MINOR(__entry->dev),
1499 (unsigned long) __entry->ino,
1500 __entry->lblk, __entry->pblk)
1501);
1502
1503TRACE_EVENT(ext4_load_inode,
1504 TP_PROTO(struct inode *inode),
1505
1506 TP_ARGS(inode),
1507
1508 TP_STRUCT__entry(
1509 __field( ino_t, ino )
1510 __field( dev_t, dev )
1511 ),
1512
1513 TP_fast_assign(
1514 __entry->ino = inode->i_ino;
1515 __entry->dev = inode->i_sb->s_dev;
1516 ),
1517
1518 TP_printk("dev %d,%d ino %ld",
1519 MAJOR(__entry->dev), MINOR(__entry->dev),
1520 (unsigned long) __entry->ino)
1521);
1522
987#endif /* _TRACE_EXT4_H */ 1523#endif /* _TRACE_EXT4_H */
988 1524
989/* This part must be outside protection */ 1525/* This part must be outside protection */
diff --git a/include/trace/events/gfpflags.h b/include/trace/events/gfpflags.h
index e3615c093741..9fe3a36646e9 100644
--- a/include/trace/events/gfpflags.h
+++ b/include/trace/events/gfpflags.h
@@ -10,6 +10,7 @@
10 */ 10 */
11#define show_gfp_flags(flags) \ 11#define show_gfp_flags(flags) \
12 (flags) ? __print_flags(flags, "|", \ 12 (flags) ? __print_flags(flags, "|", \
13 {(unsigned long)GFP_TRANSHUGE, "GFP_TRANSHUGE"}, \
13 {(unsigned long)GFP_HIGHUSER_MOVABLE, "GFP_HIGHUSER_MOVABLE"}, \ 14 {(unsigned long)GFP_HIGHUSER_MOVABLE, "GFP_HIGHUSER_MOVABLE"}, \
14 {(unsigned long)GFP_HIGHUSER, "GFP_HIGHUSER"}, \ 15 {(unsigned long)GFP_HIGHUSER, "GFP_HIGHUSER"}, \
15 {(unsigned long)GFP_USER, "GFP_USER"}, \ 16 {(unsigned long)GFP_USER, "GFP_USER"}, \
@@ -32,6 +33,9 @@
32 {(unsigned long)__GFP_HARDWALL, "GFP_HARDWALL"}, \ 33 {(unsigned long)__GFP_HARDWALL, "GFP_HARDWALL"}, \
33 {(unsigned long)__GFP_THISNODE, "GFP_THISNODE"}, \ 34 {(unsigned long)__GFP_THISNODE, "GFP_THISNODE"}, \
34 {(unsigned long)__GFP_RECLAIMABLE, "GFP_RECLAIMABLE"}, \ 35 {(unsigned long)__GFP_RECLAIMABLE, "GFP_RECLAIMABLE"}, \
35 {(unsigned long)__GFP_MOVABLE, "GFP_MOVABLE"} \ 36 {(unsigned long)__GFP_MOVABLE, "GFP_MOVABLE"}, \
37 {(unsigned long)__GFP_NOTRACK, "GFP_NOTRACK"}, \
38 {(unsigned long)__GFP_NO_KSWAPD, "GFP_NO_KSWAPD"}, \
39 {(unsigned long)__GFP_OTHER_NODE, "GFP_OTHER_NODE"} \
36 ) : "GFP_NOWAIT" 40 ) : "GFP_NOWAIT"
37 41
diff --git a/include/trace/events/gpio.h b/include/trace/events/gpio.h
new file mode 100644
index 000000000000..927a8ad9e51b
--- /dev/null
+++ b/include/trace/events/gpio.h
@@ -0,0 +1,56 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM gpio
3
4#if !defined(_TRACE_GPIO_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_GPIO_H
6
7#include <linux/tracepoint.h>
8
9TRACE_EVENT(gpio_direction,
10
11 TP_PROTO(unsigned gpio, int in, int err),
12
13 TP_ARGS(gpio, in, err),
14
15 TP_STRUCT__entry(
16 __field(unsigned, gpio)
17 __field(int, in)
18 __field(int, err)
19 ),
20
21 TP_fast_assign(
22 __entry->gpio = gpio;
23 __entry->in = in;
24 __entry->err = err;
25 ),
26
27 TP_printk("%u %3s (%d)", __entry->gpio,
28 __entry->in ? "in" : "out", __entry->err)
29);
30
31TRACE_EVENT(gpio_value,
32
33 TP_PROTO(unsigned gpio, int get, int value),
34
35 TP_ARGS(gpio, get, value),
36
37 TP_STRUCT__entry(
38 __field(unsigned, gpio)
39 __field(int, get)
40 __field(int, value)
41 ),
42
43 TP_fast_assign(
44 __entry->gpio = gpio;
45 __entry->get = get;
46 __entry->value = value;
47 ),
48
49 TP_printk("%u %3s %d", __entry->gpio,
50 __entry->get ? "get" : "set", __entry->value)
51);
52
53#endif /* if !defined(_TRACE_GPIO_H) || defined(TRACE_HEADER_MULTI_READ) */
54
55/* This part must be outside protection */
56#include <trace/define_trace.h>
diff --git a/include/trace/events/irq.h b/include/trace/events/irq.h
index 0e4cfb694fe7..1c09820df585 100644
--- a/include/trace/events/irq.h
+++ b/include/trace/events/irq.h
@@ -5,7 +5,9 @@
5#define _TRACE_IRQ_H 5#define _TRACE_IRQ_H
6 6
7#include <linux/tracepoint.h> 7#include <linux/tracepoint.h>
8#include <linux/interrupt.h> 8
9struct irqaction;
10struct softirq_action;
9 11
10#define softirq_name(sirq) { sirq##_SOFTIRQ, #sirq } 12#define softirq_name(sirq) { sirq##_SOFTIRQ, #sirq }
11#define show_softirq_name(val) \ 13#define show_softirq_name(val) \
@@ -84,56 +86,62 @@ TRACE_EVENT(irq_handler_exit,
84 86
85DECLARE_EVENT_CLASS(softirq, 87DECLARE_EVENT_CLASS(softirq,
86 88
87 TP_PROTO(struct softirq_action *h, struct softirq_action *vec), 89 TP_PROTO(unsigned int vec_nr),
88 90
89 TP_ARGS(h, vec), 91 TP_ARGS(vec_nr),
90 92
91 TP_STRUCT__entry( 93 TP_STRUCT__entry(
92 __field( int, vec ) 94 __field( unsigned int, vec )
93 ), 95 ),
94 96
95 TP_fast_assign( 97 TP_fast_assign(
96 __entry->vec = (int)(h - vec); 98 __entry->vec = vec_nr;
97 ), 99 ),
98 100
99 TP_printk("vec=%d [action=%s]", __entry->vec, 101 TP_printk("vec=%u [action=%s]", __entry->vec,
100 show_softirq_name(__entry->vec)) 102 show_softirq_name(__entry->vec))
101); 103);
102 104
103/** 105/**
104 * softirq_entry - called immediately before the softirq handler 106 * softirq_entry - called immediately before the softirq handler
105 * @h: pointer to struct softirq_action 107 * @vec_nr: softirq vector number
106 * @vec: pointer to first struct softirq_action in softirq_vec array
107 * 108 *
108 * The @h parameter, contains a pointer to the struct softirq_action 109 * When used in combination with the softirq_exit tracepoint
109 * which has a pointer to the action handler that is called. By subtracting 110 * we can determine the softirq handler runtine.
110 * the @vec pointer from the @h pointer, we can determine the softirq
111 * number. Also, when used in combination with the softirq_exit tracepoint
112 * we can determine the softirq latency.
113 */ 111 */
114DEFINE_EVENT(softirq, softirq_entry, 112DEFINE_EVENT(softirq, softirq_entry,
115 113
116 TP_PROTO(struct softirq_action *h, struct softirq_action *vec), 114 TP_PROTO(unsigned int vec_nr),
117 115
118 TP_ARGS(h, vec) 116 TP_ARGS(vec_nr)
119); 117);
120 118
121/** 119/**
122 * softirq_exit - called immediately after the softirq handler returns 120 * softirq_exit - called immediately after the softirq handler returns
123 * @h: pointer to struct softirq_action 121 * @vec_nr: softirq vector number
124 * @vec: pointer to first struct softirq_action in softirq_vec array
125 * 122 *
126 * The @h parameter contains a pointer to the struct softirq_action 123 * When used in combination with the softirq_entry tracepoint
127 * that has handled the softirq. By subtracting the @vec pointer from 124 * we can determine the softirq handler runtine.
128 * the @h pointer, we can determine the softirq number. Also, when used in
129 * combination with the softirq_entry tracepoint we can determine the softirq
130 * latency.
131 */ 125 */
132DEFINE_EVENT(softirq, softirq_exit, 126DEFINE_EVENT(softirq, softirq_exit,
133 127
134 TP_PROTO(struct softirq_action *h, struct softirq_action *vec), 128 TP_PROTO(unsigned int vec_nr),
129
130 TP_ARGS(vec_nr)
131);
132
133/**
134 * softirq_raise - called immediately when a softirq is raised
135 * @vec_nr: softirq vector number
136 *
137 * When used in combination with the softirq_entry tracepoint
138 * we can determine the softirq raise to run latency.
139 */
140DEFINE_EVENT(softirq, softirq_raise,
141
142 TP_PROTO(unsigned int vec_nr),
135 143
136 TP_ARGS(h, vec) 144 TP_ARGS(vec_nr)
137); 145);
138 146
139#endif /* _TRACE_IRQ_H */ 147#endif /* _TRACE_IRQ_H */
diff --git a/include/trace/events/kvm.h b/include/trace/events/kvm.h
index 6dd3a51ab1cb..46e3cd8e197a 100644
--- a/include/trace/events/kvm.h
+++ b/include/trace/events/kvm.h
@@ -6,6 +6,36 @@
6#undef TRACE_SYSTEM 6#undef TRACE_SYSTEM
7#define TRACE_SYSTEM kvm 7#define TRACE_SYSTEM kvm
8 8
9#define ERSN(x) { KVM_EXIT_##x, "KVM_EXIT_" #x }
10
11#define kvm_trace_exit_reason \
12 ERSN(UNKNOWN), ERSN(EXCEPTION), ERSN(IO), ERSN(HYPERCALL), \
13 ERSN(DEBUG), ERSN(HLT), ERSN(MMIO), ERSN(IRQ_WINDOW_OPEN), \
14 ERSN(SHUTDOWN), ERSN(FAIL_ENTRY), ERSN(INTR), ERSN(SET_TPR), \
15 ERSN(TPR_ACCESS), ERSN(S390_SIEIC), ERSN(S390_RESET), ERSN(DCR),\
16 ERSN(NMI), ERSN(INTERNAL_ERROR), ERSN(OSI)
17
18TRACE_EVENT(kvm_userspace_exit,
19 TP_PROTO(__u32 reason, int errno),
20 TP_ARGS(reason, errno),
21
22 TP_STRUCT__entry(
23 __field( __u32, reason )
24 __field( int, errno )
25 ),
26
27 TP_fast_assign(
28 __entry->reason = reason;
29 __entry->errno = errno;
30 ),
31
32 TP_printk("reason %s (%d)",
33 __entry->errno < 0 ?
34 (__entry->errno == -EINTR ? "restart" : "error") :
35 __print_symbolic(__entry->reason, kvm_trace_exit_reason),
36 __entry->errno < 0 ? -__entry->errno : __entry->reason)
37);
38
9#if defined(__KVM_HAVE_IOAPIC) 39#if defined(__KVM_HAVE_IOAPIC)
10TRACE_EVENT(kvm_set_irq, 40TRACE_EVENT(kvm_set_irq,
11 TP_PROTO(unsigned int gsi, int level, int irq_source_id), 41 TP_PROTO(unsigned int gsi, int level, int irq_source_id),
@@ -185,6 +215,97 @@ TRACE_EVENT(kvm_age_page,
185 __entry->referenced ? "YOUNG" : "OLD") 215 __entry->referenced ? "YOUNG" : "OLD")
186); 216);
187 217
218#ifdef CONFIG_KVM_ASYNC_PF
219DECLARE_EVENT_CLASS(kvm_async_get_page_class,
220
221 TP_PROTO(u64 gva, u64 gfn),
222
223 TP_ARGS(gva, gfn),
224
225 TP_STRUCT__entry(
226 __field(__u64, gva)
227 __field(u64, gfn)
228 ),
229
230 TP_fast_assign(
231 __entry->gva = gva;
232 __entry->gfn = gfn;
233 ),
234
235 TP_printk("gva = %#llx, gfn = %#llx", __entry->gva, __entry->gfn)
236);
237
238DEFINE_EVENT(kvm_async_get_page_class, kvm_try_async_get_page,
239
240 TP_PROTO(u64 gva, u64 gfn),
241
242 TP_ARGS(gva, gfn)
243);
244
245DEFINE_EVENT(kvm_async_get_page_class, kvm_async_pf_doublefault,
246
247 TP_PROTO(u64 gva, u64 gfn),
248
249 TP_ARGS(gva, gfn)
250);
251
252DECLARE_EVENT_CLASS(kvm_async_pf_nopresent_ready,
253
254 TP_PROTO(u64 token, u64 gva),
255
256 TP_ARGS(token, gva),
257
258 TP_STRUCT__entry(
259 __field(__u64, token)
260 __field(__u64, gva)
261 ),
262
263 TP_fast_assign(
264 __entry->token = token;
265 __entry->gva = gva;
266 ),
267
268 TP_printk("token %#llx gva %#llx", __entry->token, __entry->gva)
269
270);
271
272DEFINE_EVENT(kvm_async_pf_nopresent_ready, kvm_async_pf_not_present,
273
274 TP_PROTO(u64 token, u64 gva),
275
276 TP_ARGS(token, gva)
277);
278
279DEFINE_EVENT(kvm_async_pf_nopresent_ready, kvm_async_pf_ready,
280
281 TP_PROTO(u64 token, u64 gva),
282
283 TP_ARGS(token, gva)
284);
285
286TRACE_EVENT(
287 kvm_async_pf_completed,
288 TP_PROTO(unsigned long address, struct page *page, u64 gva),
289 TP_ARGS(address, page, gva),
290
291 TP_STRUCT__entry(
292 __field(unsigned long, address)
293 __field(pfn_t, pfn)
294 __field(u64, gva)
295 ),
296
297 TP_fast_assign(
298 __entry->address = address;
299 __entry->pfn = page ? page_to_pfn(page) : 0;
300 __entry->gva = gva;
301 ),
302
303 TP_printk("gva %#llx address %#lx pfn %#llx", __entry->gva,
304 __entry->address, __entry->pfn)
305);
306
307#endif
308
188#endif /* _TRACE_KVM_MAIN_H */ 309#endif /* _TRACE_KVM_MAIN_H */
189 310
190/* This part must be outside protection */ 311/* This part must be outside protection */
diff --git a/include/trace/events/mce.h b/include/trace/events/mce.h
index 7eee77895cb3..4cbbcef6baa8 100644
--- a/include/trace/events/mce.h
+++ b/include/trace/events/mce.h
@@ -17,36 +17,36 @@ TRACE_EVENT(mce_record,
17 TP_STRUCT__entry( 17 TP_STRUCT__entry(
18 __field( u64, mcgcap ) 18 __field( u64, mcgcap )
19 __field( u64, mcgstatus ) 19 __field( u64, mcgstatus )
20 __field( u8, bank )
21 __field( u64, status ) 20 __field( u64, status )
22 __field( u64, addr ) 21 __field( u64, addr )
23 __field( u64, misc ) 22 __field( u64, misc )
24 __field( u64, ip ) 23 __field( u64, ip )
25 __field( u8, cs )
26 __field( u64, tsc ) 24 __field( u64, tsc )
27 __field( u64, walltime ) 25 __field( u64, walltime )
28 __field( u32, cpu ) 26 __field( u32, cpu )
29 __field( u32, cpuid ) 27 __field( u32, cpuid )
30 __field( u32, apicid ) 28 __field( u32, apicid )
31 __field( u32, socketid ) 29 __field( u32, socketid )
30 __field( u8, cs )
31 __field( u8, bank )
32 __field( u8, cpuvendor ) 32 __field( u8, cpuvendor )
33 ), 33 ),
34 34
35 TP_fast_assign( 35 TP_fast_assign(
36 __entry->mcgcap = m->mcgcap; 36 __entry->mcgcap = m->mcgcap;
37 __entry->mcgstatus = m->mcgstatus; 37 __entry->mcgstatus = m->mcgstatus;
38 __entry->bank = m->bank;
39 __entry->status = m->status; 38 __entry->status = m->status;
40 __entry->addr = m->addr; 39 __entry->addr = m->addr;
41 __entry->misc = m->misc; 40 __entry->misc = m->misc;
42 __entry->ip = m->ip; 41 __entry->ip = m->ip;
43 __entry->cs = m->cs;
44 __entry->tsc = m->tsc; 42 __entry->tsc = m->tsc;
45 __entry->walltime = m->time; 43 __entry->walltime = m->time;
46 __entry->cpu = m->extcpu; 44 __entry->cpu = m->extcpu;
47 __entry->cpuid = m->cpuid; 45 __entry->cpuid = m->cpuid;
48 __entry->apicid = m->apicid; 46 __entry->apicid = m->apicid;
49 __entry->socketid = m->socketid; 47 __entry->socketid = m->socketid;
48 __entry->cs = m->cs;
49 __entry->bank = m->bank;
50 __entry->cpuvendor = m->cpuvendor; 50 __entry->cpuvendor = m->cpuvendor;
51 ), 51 ),
52 52
diff --git a/include/trace/events/module.h b/include/trace/events/module.h
index c7bb2f0482fe..21a546d27c0c 100644
--- a/include/trace/events/module.h
+++ b/include/trace/events/module.h
@@ -1,5 +1,15 @@
1/*
2 * Because linux/module.h has tracepoints in the header, and ftrace.h
3 * eventually includes this file, define_trace.h includes linux/module.h
4 * But we do not want the module.h to override the TRACE_SYSTEM macro
5 * variable that define_trace.h is processing, so we only set it
6 * when module events are being processed, which would happen when
7 * CREATE_TRACE_POINTS is defined.
8 */
9#ifdef CREATE_TRACE_POINTS
1#undef TRACE_SYSTEM 10#undef TRACE_SYSTEM
2#define TRACE_SYSTEM module 11#define TRACE_SYSTEM module
12#endif
3 13
4#if !defined(_TRACE_MODULE_H) || defined(TRACE_HEADER_MULTI_READ) 14#if !defined(_TRACE_MODULE_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_MODULE_H 15#define _TRACE_MODULE_H
@@ -98,14 +108,14 @@ TRACE_EVENT(module_request,
98 TP_ARGS(name, wait, ip), 108 TP_ARGS(name, wait, ip),
99 109
100 TP_STRUCT__entry( 110 TP_STRUCT__entry(
101 __field( bool, wait )
102 __field( unsigned long, ip ) 111 __field( unsigned long, ip )
112 __field( bool, wait )
103 __string( name, name ) 113 __string( name, name )
104 ), 114 ),
105 115
106 TP_fast_assign( 116 TP_fast_assign(
107 __entry->wait = wait;
108 __entry->ip = ip; 117 __entry->ip = ip;
118 __entry->wait = wait;
109 __assign_str(name, name); 119 __assign_str(name, name);
110 ), 120 ),
111 121
@@ -119,4 +129,3 @@ TRACE_EVENT(module_request,
119 129
120/* This part must be outside protection */ 130/* This part must be outside protection */
121#include <trace/define_trace.h> 131#include <trace/define_trace.h>
122
diff --git a/include/trace/events/napi.h b/include/trace/events/napi.h
index 188deca2f3c7..8fe1e93f531d 100644
--- a/include/trace/events/napi.h
+++ b/include/trace/events/napi.h
@@ -6,10 +6,31 @@
6 6
7#include <linux/netdevice.h> 7#include <linux/netdevice.h>
8#include <linux/tracepoint.h> 8#include <linux/tracepoint.h>
9#include <linux/ftrace.h>
10
11#define NO_DEV "(no_device)"
12
13TRACE_EVENT(napi_poll,
9 14
10DECLARE_TRACE(napi_poll,
11 TP_PROTO(struct napi_struct *napi), 15 TP_PROTO(struct napi_struct *napi),
12 TP_ARGS(napi)); 16
17 TP_ARGS(napi),
18
19 TP_STRUCT__entry(
20 __field( struct napi_struct *, napi)
21 __string( dev_name, napi->dev ? napi->dev->name : NO_DEV)
22 ),
23
24 TP_fast_assign(
25 __entry->napi = napi;
26 __assign_str(dev_name, napi->dev ? napi->dev->name : NO_DEV);
27 ),
28
29 TP_printk("napi poll on napi struct %p for device %s",
30 __entry->napi, __get_str(dev_name))
31);
32
33#undef NO_DEV
13 34
14#endif /* _TRACE_NAPI_H_ */ 35#endif /* _TRACE_NAPI_H_ */
15 36
diff --git a/include/trace/events/net.h b/include/trace/events/net.h
new file mode 100644
index 000000000000..f99645d05a8f
--- /dev/null
+++ b/include/trace/events/net.h
@@ -0,0 +1,84 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM net
3
4#if !defined(_TRACE_NET_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_NET_H
6
7#include <linux/skbuff.h>
8#include <linux/netdevice.h>
9#include <linux/ip.h>
10#include <linux/tracepoint.h>
11
12TRACE_EVENT(net_dev_xmit,
13
14 TP_PROTO(struct sk_buff *skb,
15 int rc,
16 struct net_device *dev,
17 unsigned int skb_len),
18
19 TP_ARGS(skb, rc, dev, skb_len),
20
21 TP_STRUCT__entry(
22 __field( void *, skbaddr )
23 __field( unsigned int, len )
24 __field( int, rc )
25 __string( name, dev->name )
26 ),
27
28 TP_fast_assign(
29 __entry->skbaddr = skb;
30 __entry->len = skb_len;
31 __entry->rc = rc;
32 __assign_str(name, dev->name);
33 ),
34
35 TP_printk("dev=%s skbaddr=%p len=%u rc=%d",
36 __get_str(name), __entry->skbaddr, __entry->len, __entry->rc)
37);
38
39DECLARE_EVENT_CLASS(net_dev_template,
40
41 TP_PROTO(struct sk_buff *skb),
42
43 TP_ARGS(skb),
44
45 TP_STRUCT__entry(
46 __field( void *, skbaddr )
47 __field( unsigned int, len )
48 __string( name, skb->dev->name )
49 ),
50
51 TP_fast_assign(
52 __entry->skbaddr = skb;
53 __entry->len = skb->len;
54 __assign_str(name, skb->dev->name);
55 ),
56
57 TP_printk("dev=%s skbaddr=%p len=%u",
58 __get_str(name), __entry->skbaddr, __entry->len)
59)
60
61DEFINE_EVENT(net_dev_template, net_dev_queue,
62
63 TP_PROTO(struct sk_buff *skb),
64
65 TP_ARGS(skb)
66);
67
68DEFINE_EVENT(net_dev_template, netif_receive_skb,
69
70 TP_PROTO(struct sk_buff *skb),
71
72 TP_ARGS(skb)
73);
74
75DEFINE_EVENT(net_dev_template, netif_rx,
76
77 TP_PROTO(struct sk_buff *skb),
78
79 TP_ARGS(skb)
80);
81#endif /* _TRACE_NET_H */
82
83/* This part must be outside protection */
84#include <trace/define_trace.h>
diff --git a/include/trace/events/power.h b/include/trace/events/power.h
index 35a2a6e7bf1e..1bcc2a8c00e2 100644
--- a/include/trace/events/power.h
+++ b/include/trace/events/power.h
@@ -7,15 +7,71 @@
7#include <linux/ktime.h> 7#include <linux/ktime.h>
8#include <linux/tracepoint.h> 8#include <linux/tracepoint.h>
9 9
10#ifndef _TRACE_POWER_ENUM_ 10DECLARE_EVENT_CLASS(cpu,
11#define _TRACE_POWER_ENUM_ 11
12enum { 12 TP_PROTO(unsigned int state, unsigned int cpu_id),
13 POWER_NONE = 0, 13
14 POWER_CSTATE = 1, 14 TP_ARGS(state, cpu_id),
15 POWER_PSTATE = 2, 15
16}; 16 TP_STRUCT__entry(
17 __field( u32, state )
18 __field( u32, cpu_id )
19 ),
20
21 TP_fast_assign(
22 __entry->state = state;
23 __entry->cpu_id = cpu_id;
24 ),
25
26 TP_printk("state=%lu cpu_id=%lu", (unsigned long)__entry->state,
27 (unsigned long)__entry->cpu_id)
28);
29
30DEFINE_EVENT(cpu, cpu_idle,
31
32 TP_PROTO(unsigned int state, unsigned int cpu_id),
33
34 TP_ARGS(state, cpu_id)
35);
36
37/* This file can get included multiple times, TRACE_HEADER_MULTI_READ at top */
38#ifndef _PWR_EVENT_AVOID_DOUBLE_DEFINING
39#define _PWR_EVENT_AVOID_DOUBLE_DEFINING
40
41#define PWR_EVENT_EXIT -1
17#endif 42#endif
18 43
44DEFINE_EVENT(cpu, cpu_frequency,
45
46 TP_PROTO(unsigned int frequency, unsigned int cpu_id),
47
48 TP_ARGS(frequency, cpu_id)
49);
50
51TRACE_EVENT(machine_suspend,
52
53 TP_PROTO(unsigned int state),
54
55 TP_ARGS(state),
56
57 TP_STRUCT__entry(
58 __field( u32, state )
59 ),
60
61 TP_fast_assign(
62 __entry->state = state;
63 ),
64
65 TP_printk("state=%lu", (unsigned long)__entry->state)
66);
67
68/* This code will be removed after deprecation time exceeded (2.6.41) */
69#ifdef CONFIG_EVENT_POWER_TRACING_DEPRECATED
70
71/*
72 * The power events are used for cpuidle & suspend (power_start, power_end)
73 * and for cpufreq (power_frequency)
74 */
19DECLARE_EVENT_CLASS(power, 75DECLARE_EVENT_CLASS(power,
20 76
21 TP_PROTO(unsigned int type, unsigned int state, unsigned int cpu_id), 77 TP_PROTO(unsigned int type, unsigned int state, unsigned int cpu_id),
@@ -70,6 +126,114 @@ TRACE_EVENT(power_end,
70 126
71); 127);
72 128
129/* Deprecated dummy functions must be protected against multi-declartion */
130#ifndef _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED
131#define _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED
132
133enum {
134 POWER_NONE = 0,
135 POWER_CSTATE = 1,
136 POWER_PSTATE = 2,
137};
138#endif /* _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED */
139
140#else /* CONFIG_EVENT_POWER_TRACING_DEPRECATED */
141
142#ifndef _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED
143#define _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED
144enum {
145 POWER_NONE = 0,
146 POWER_CSTATE = 1,
147 POWER_PSTATE = 2,
148};
149
150/* These dummy declaration have to be ripped out when the deprecated
151 events get removed */
152static inline void trace_power_start(u64 type, u64 state, u64 cpuid) {};
153static inline void trace_power_end(u64 cpuid) {};
154static inline void trace_power_frequency(u64 type, u64 state, u64 cpuid) {};
155#endif /* _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED */
156
157#endif /* CONFIG_EVENT_POWER_TRACING_DEPRECATED */
158
159/*
160 * The clock events are used for clock enable/disable and for
161 * clock rate change
162 */
163DECLARE_EVENT_CLASS(clock,
164
165 TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
166
167 TP_ARGS(name, state, cpu_id),
168
169 TP_STRUCT__entry(
170 __string( name, name )
171 __field( u64, state )
172 __field( u64, cpu_id )
173 ),
174
175 TP_fast_assign(
176 __assign_str(name, name);
177 __entry->state = state;
178 __entry->cpu_id = cpu_id;
179 ),
180
181 TP_printk("%s state=%lu cpu_id=%lu", __get_str(name),
182 (unsigned long)__entry->state, (unsigned long)__entry->cpu_id)
183);
184
185DEFINE_EVENT(clock, clock_enable,
186
187 TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
188
189 TP_ARGS(name, state, cpu_id)
190);
191
192DEFINE_EVENT(clock, clock_disable,
193
194 TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
195
196 TP_ARGS(name, state, cpu_id)
197);
198
199DEFINE_EVENT(clock, clock_set_rate,
200
201 TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
202
203 TP_ARGS(name, state, cpu_id)
204);
205
206/*
207 * The power domain events are used for power domains transitions
208 */
209DECLARE_EVENT_CLASS(power_domain,
210
211 TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
212
213 TP_ARGS(name, state, cpu_id),
214
215 TP_STRUCT__entry(
216 __string( name, name )
217 __field( u64, state )
218 __field( u64, cpu_id )
219 ),
220
221 TP_fast_assign(
222 __assign_str(name, name);
223 __entry->state = state;
224 __entry->cpu_id = cpu_id;
225),
226
227 TP_printk("%s state=%lu cpu_id=%lu", __get_str(name),
228 (unsigned long)__entry->state, (unsigned long)__entry->cpu_id)
229);
230
231DEFINE_EVENT(power_domain, power_domain_target,
232
233 TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
234
235 TP_ARGS(name, state, cpu_id)
236);
73#endif /* _TRACE_POWER_H */ 237#endif /* _TRACE_POWER_H */
74 238
75/* This part must be outside protection */ 239/* This part must be outside protection */
diff --git a/include/trace/events/regulator.h b/include/trace/events/regulator.h
new file mode 100644
index 000000000000..37502a7404b7
--- /dev/null
+++ b/include/trace/events/regulator.h
@@ -0,0 +1,141 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM regulator
3
4#if !defined(_TRACE_REGULATOR_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_REGULATOR_H
6
7#include <linux/ktime.h>
8#include <linux/tracepoint.h>
9
10/*
11 * Events which just log themselves and the regulator name for enable/disable
12 * type tracking.
13 */
14DECLARE_EVENT_CLASS(regulator_basic,
15
16 TP_PROTO(const char *name),
17
18 TP_ARGS(name),
19
20 TP_STRUCT__entry(
21 __string( name, name )
22 ),
23
24 TP_fast_assign(
25 __assign_str(name, name);
26 ),
27
28 TP_printk("name=%s", __get_str(name))
29
30);
31
32DEFINE_EVENT(regulator_basic, regulator_enable,
33
34 TP_PROTO(const char *name),
35
36 TP_ARGS(name)
37
38);
39
40DEFINE_EVENT(regulator_basic, regulator_enable_delay,
41
42 TP_PROTO(const char *name),
43
44 TP_ARGS(name)
45
46);
47
48DEFINE_EVENT(regulator_basic, regulator_enable_complete,
49
50 TP_PROTO(const char *name),
51
52 TP_ARGS(name)
53
54);
55
56DEFINE_EVENT(regulator_basic, regulator_disable,
57
58 TP_PROTO(const char *name),
59
60 TP_ARGS(name)
61
62);
63
64DEFINE_EVENT(regulator_basic, regulator_disable_complete,
65
66 TP_PROTO(const char *name),
67
68 TP_ARGS(name)
69
70);
71
72/*
73 * Events that take a range of numerical values, mostly for voltages
74 * and so on.
75 */
76DECLARE_EVENT_CLASS(regulator_range,
77
78 TP_PROTO(const char *name, int min, int max),
79
80 TP_ARGS(name, min, max),
81
82 TP_STRUCT__entry(
83 __string( name, name )
84 __field( int, min )
85 __field( int, max )
86 ),
87
88 TP_fast_assign(
89 __assign_str(name, name);
90 __entry->min = min;
91 __entry->max = max;
92 ),
93
94 TP_printk("name=%s (%d-%d)", __get_str(name),
95 (int)__entry->min, (int)__entry->max)
96);
97
98DEFINE_EVENT(regulator_range, regulator_set_voltage,
99
100 TP_PROTO(const char *name, int min, int max),
101
102 TP_ARGS(name, min, max)
103
104);
105
106
107/*
108 * Events that take a single value, mostly for readback and refcounts.
109 */
110DECLARE_EVENT_CLASS(regulator_value,
111
112 TP_PROTO(const char *name, unsigned int val),
113
114 TP_ARGS(name, val),
115
116 TP_STRUCT__entry(
117 __string( name, name )
118 __field( unsigned int, val )
119 ),
120
121 TP_fast_assign(
122 __assign_str(name, name);
123 __entry->val = val;
124 ),
125
126 TP_printk("name=%s, val=%u", __get_str(name),
127 (int)__entry->val)
128);
129
130DEFINE_EVENT(regulator_value, regulator_set_voltage_complete,
131
132 TP_PROTO(const char *name, unsigned int value),
133
134 TP_ARGS(name, value)
135
136);
137
138#endif /* _TRACE_POWER_H */
139
140/* This part must be outside protection */
141#include <trace/define_trace.h>
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h
index 9208c92aeab5..f6334782a593 100644
--- a/include/trace/events/sched.h
+++ b/include/trace/events/sched.h
@@ -362,6 +362,35 @@ TRACE_EVENT(sched_stat_runtime,
362 (unsigned long long)__entry->vruntime) 362 (unsigned long long)__entry->vruntime)
363); 363);
364 364
365/*
366 * Tracepoint for showing priority inheritance modifying a tasks
367 * priority.
368 */
369TRACE_EVENT(sched_pi_setprio,
370
371 TP_PROTO(struct task_struct *tsk, int newprio),
372
373 TP_ARGS(tsk, newprio),
374
375 TP_STRUCT__entry(
376 __array( char, comm, TASK_COMM_LEN )
377 __field( pid_t, pid )
378 __field( int, oldprio )
379 __field( int, newprio )
380 ),
381
382 TP_fast_assign(
383 memcpy(__entry->comm, tsk->comm, TASK_COMM_LEN);
384 __entry->pid = tsk->pid;
385 __entry->oldprio = tsk->prio;
386 __entry->newprio = newprio;
387 ),
388
389 TP_printk("comm=%s pid=%d oldprio=%d newprio=%d",
390 __entry->comm, __entry->pid,
391 __entry->oldprio, __entry->newprio)
392);
393
365#endif /* _TRACE_SCHED_H */ 394#endif /* _TRACE_SCHED_H */
366 395
367/* This part must be outside protection */ 396/* This part must be outside protection */
diff --git a/include/trace/events/scsi.h b/include/trace/events/scsi.h
index 25fbefdf2f2e..db6c93510f74 100644
--- a/include/trace/events/scsi.h
+++ b/include/trace/events/scsi.h
@@ -184,6 +184,17 @@
184 scsi_statusbyte_name(SAM_STAT_ACA_ACTIVE), \ 184 scsi_statusbyte_name(SAM_STAT_ACA_ACTIVE), \
185 scsi_statusbyte_name(SAM_STAT_TASK_ABORTED)) 185 scsi_statusbyte_name(SAM_STAT_TASK_ABORTED))
186 186
187#define scsi_prot_op_name(result) { result, #result }
188#define show_prot_op_name(val) \
189 __print_symbolic(val, \
190 scsi_prot_op_name(SCSI_PROT_NORMAL), \
191 scsi_prot_op_name(SCSI_PROT_READ_INSERT), \
192 scsi_prot_op_name(SCSI_PROT_WRITE_STRIP), \
193 scsi_prot_op_name(SCSI_PROT_READ_STRIP), \
194 scsi_prot_op_name(SCSI_PROT_WRITE_INSERT), \
195 scsi_prot_op_name(SCSI_PROT_READ_PASS), \
196 scsi_prot_op_name(SCSI_PROT_WRITE_PASS))
197
187const char *scsi_trace_parse_cdb(struct trace_seq*, unsigned char*, int); 198const char *scsi_trace_parse_cdb(struct trace_seq*, unsigned char*, int);
188#define __parse_cdb(cdb, len) scsi_trace_parse_cdb(p, cdb, len) 199#define __parse_cdb(cdb, len) scsi_trace_parse_cdb(p, cdb, len)
189 200
@@ -202,6 +213,7 @@ TRACE_EVENT(scsi_dispatch_cmd_start,
202 __field( unsigned int, cmd_len ) 213 __field( unsigned int, cmd_len )
203 __field( unsigned int, data_sglen ) 214 __field( unsigned int, data_sglen )
204 __field( unsigned int, prot_sglen ) 215 __field( unsigned int, prot_sglen )
216 __field( unsigned char, prot_op )
205 __dynamic_array(unsigned char, cmnd, cmd->cmd_len) 217 __dynamic_array(unsigned char, cmnd, cmd->cmd_len)
206 ), 218 ),
207 219
@@ -214,13 +226,15 @@ TRACE_EVENT(scsi_dispatch_cmd_start,
214 __entry->cmd_len = cmd->cmd_len; 226 __entry->cmd_len = cmd->cmd_len;
215 __entry->data_sglen = scsi_sg_count(cmd); 227 __entry->data_sglen = scsi_sg_count(cmd);
216 __entry->prot_sglen = scsi_prot_sg_count(cmd); 228 __entry->prot_sglen = scsi_prot_sg_count(cmd);
229 __entry->prot_op = scsi_get_prot_op(cmd);
217 memcpy(__get_dynamic_array(cmnd), cmd->cmnd, cmd->cmd_len); 230 memcpy(__get_dynamic_array(cmnd), cmd->cmnd, cmd->cmd_len);
218 ), 231 ),
219 232
220 TP_printk("host_no=%u channel=%u id=%u lun=%u data_sgl=%u prot_sgl=%u" \ 233 TP_printk("host_no=%u channel=%u id=%u lun=%u data_sgl=%u prot_sgl=%u" \
221 " cmnd=(%s %s raw=%s)", 234 " prot_op=%s cmnd=(%s %s raw=%s)",
222 __entry->host_no, __entry->channel, __entry->id, 235 __entry->host_no, __entry->channel, __entry->id,
223 __entry->lun, __entry->data_sglen, __entry->prot_sglen, 236 __entry->lun, __entry->data_sglen, __entry->prot_sglen,
237 show_prot_op_name(__entry->prot_op),
224 show_opcode_name(__entry->opcode), 238 show_opcode_name(__entry->opcode),
225 __parse_cdb(__get_dynamic_array(cmnd), __entry->cmd_len), 239 __parse_cdb(__get_dynamic_array(cmnd), __entry->cmd_len),
226 __print_hex(__get_dynamic_array(cmnd), __entry->cmd_len)) 240 __print_hex(__get_dynamic_array(cmnd), __entry->cmd_len))
@@ -242,6 +256,7 @@ TRACE_EVENT(scsi_dispatch_cmd_error,
242 __field( unsigned int, cmd_len ) 256 __field( unsigned int, cmd_len )
243 __field( unsigned int, data_sglen ) 257 __field( unsigned int, data_sglen )
244 __field( unsigned int, prot_sglen ) 258 __field( unsigned int, prot_sglen )
259 __field( unsigned char, prot_op )
245 __dynamic_array(unsigned char, cmnd, cmd->cmd_len) 260 __dynamic_array(unsigned char, cmnd, cmd->cmd_len)
246 ), 261 ),
247 262
@@ -255,13 +270,15 @@ TRACE_EVENT(scsi_dispatch_cmd_error,
255 __entry->cmd_len = cmd->cmd_len; 270 __entry->cmd_len = cmd->cmd_len;
256 __entry->data_sglen = scsi_sg_count(cmd); 271 __entry->data_sglen = scsi_sg_count(cmd);
257 __entry->prot_sglen = scsi_prot_sg_count(cmd); 272 __entry->prot_sglen = scsi_prot_sg_count(cmd);
273 __entry->prot_op = scsi_get_prot_op(cmd);
258 memcpy(__get_dynamic_array(cmnd), cmd->cmnd, cmd->cmd_len); 274 memcpy(__get_dynamic_array(cmnd), cmd->cmnd, cmd->cmd_len);
259 ), 275 ),
260 276
261 TP_printk("host_no=%u channel=%u id=%u lun=%u data_sgl=%u prot_sgl=%u" \ 277 TP_printk("host_no=%u channel=%u id=%u lun=%u data_sgl=%u prot_sgl=%u" \
262 " cmnd=(%s %s raw=%s) rtn=%d", 278 " prot_op=%s cmnd=(%s %s raw=%s) rtn=%d",
263 __entry->host_no, __entry->channel, __entry->id, 279 __entry->host_no, __entry->channel, __entry->id,
264 __entry->lun, __entry->data_sglen, __entry->prot_sglen, 280 __entry->lun, __entry->data_sglen, __entry->prot_sglen,
281 show_prot_op_name(__entry->prot_op),
265 show_opcode_name(__entry->opcode), 282 show_opcode_name(__entry->opcode),
266 __parse_cdb(__get_dynamic_array(cmnd), __entry->cmd_len), 283 __parse_cdb(__get_dynamic_array(cmnd), __entry->cmd_len),
267 __print_hex(__get_dynamic_array(cmnd), __entry->cmd_len), 284 __print_hex(__get_dynamic_array(cmnd), __entry->cmd_len),
@@ -284,6 +301,7 @@ DECLARE_EVENT_CLASS(scsi_cmd_done_timeout_template,
284 __field( unsigned int, cmd_len ) 301 __field( unsigned int, cmd_len )
285 __field( unsigned int, data_sglen ) 302 __field( unsigned int, data_sglen )
286 __field( unsigned int, prot_sglen ) 303 __field( unsigned int, prot_sglen )
304 __field( unsigned char, prot_op )
287 __dynamic_array(unsigned char, cmnd, cmd->cmd_len) 305 __dynamic_array(unsigned char, cmnd, cmd->cmd_len)
288 ), 306 ),
289 307
@@ -297,14 +315,16 @@ DECLARE_EVENT_CLASS(scsi_cmd_done_timeout_template,
297 __entry->cmd_len = cmd->cmd_len; 315 __entry->cmd_len = cmd->cmd_len;
298 __entry->data_sglen = scsi_sg_count(cmd); 316 __entry->data_sglen = scsi_sg_count(cmd);
299 __entry->prot_sglen = scsi_prot_sg_count(cmd); 317 __entry->prot_sglen = scsi_prot_sg_count(cmd);
318 __entry->prot_op = scsi_get_prot_op(cmd);
300 memcpy(__get_dynamic_array(cmnd), cmd->cmnd, cmd->cmd_len); 319 memcpy(__get_dynamic_array(cmnd), cmd->cmnd, cmd->cmd_len);
301 ), 320 ),
302 321
303 TP_printk("host_no=%u channel=%u id=%u lun=%u data_sgl=%u " \ 322 TP_printk("host_no=%u channel=%u id=%u lun=%u data_sgl=%u " \
304 "prot_sgl=%u cmnd=(%s %s raw=%s) result=(driver=%s host=%s " \ 323 "prot_sgl=%u prot_op=%s cmnd=(%s %s raw=%s) result=(driver=" \
305 "message=%s status=%s)", 324 "%s host=%s message=%s status=%s)",
306 __entry->host_no, __entry->channel, __entry->id, 325 __entry->host_no, __entry->channel, __entry->id,
307 __entry->lun, __entry->data_sglen, __entry->prot_sglen, 326 __entry->lun, __entry->data_sglen, __entry->prot_sglen,
327 show_prot_op_name(__entry->prot_op),
308 show_opcode_name(__entry->opcode), 328 show_opcode_name(__entry->opcode),
309 __parse_cdb(__get_dynamic_array(cmnd), __entry->cmd_len), 329 __parse_cdb(__get_dynamic_array(cmnd), __entry->cmd_len),
310 __print_hex(__get_dynamic_array(cmnd), __entry->cmd_len), 330 __print_hex(__get_dynamic_array(cmnd), __entry->cmd_len),
diff --git a/include/trace/events/skb.h b/include/trace/events/skb.h
index 4b2be6dc76f0..0c68ae22da22 100644
--- a/include/trace/events/skb.h
+++ b/include/trace/events/skb.h
@@ -19,22 +19,37 @@ TRACE_EVENT(kfree_skb,
19 19
20 TP_STRUCT__entry( 20 TP_STRUCT__entry(
21 __field( void *, skbaddr ) 21 __field( void *, skbaddr )
22 __field( unsigned short, protocol )
23 __field( void *, location ) 22 __field( void *, location )
23 __field( unsigned short, protocol )
24 ), 24 ),
25 25
26 TP_fast_assign( 26 TP_fast_assign(
27 __entry->skbaddr = skb; 27 __entry->skbaddr = skb;
28 if (skb) {
29 __entry->protocol = ntohs(skb->protocol);
30 }
31 __entry->location = location; 28 __entry->location = location;
29 __entry->protocol = ntohs(skb->protocol);
32 ), 30 ),
33 31
34 TP_printk("skbaddr=%p protocol=%u location=%p", 32 TP_printk("skbaddr=%p protocol=%u location=%p",
35 __entry->skbaddr, __entry->protocol, __entry->location) 33 __entry->skbaddr, __entry->protocol, __entry->location)
36); 34);
37 35
36TRACE_EVENT(consume_skb,
37
38 TP_PROTO(struct sk_buff *skb),
39
40 TP_ARGS(skb),
41
42 TP_STRUCT__entry(
43 __field( void *, skbaddr )
44 ),
45
46 TP_fast_assign(
47 __entry->skbaddr = skb;
48 ),
49
50 TP_printk("skbaddr=%p", __entry->skbaddr)
51);
52
38TRACE_EVENT(skb_copy_datagram_iovec, 53TRACE_EVENT(skb_copy_datagram_iovec,
39 54
40 TP_PROTO(const struct sk_buff *skb, int len), 55 TP_PROTO(const struct sk_buff *skb, int len),
diff --git a/include/trace/events/syscalls.h b/include/trace/events/syscalls.h
index fb726ac7caee..5a4c04a75b3d 100644
--- a/include/trace/events/syscalls.h
+++ b/include/trace/events/syscalls.h
@@ -40,6 +40,8 @@ TRACE_EVENT_FN(sys_enter,
40 syscall_regfunc, syscall_unregfunc 40 syscall_regfunc, syscall_unregfunc
41); 41);
42 42
43TRACE_EVENT_FLAGS(sys_enter, TRACE_EVENT_FL_CAP_ANY)
44
43TRACE_EVENT_FN(sys_exit, 45TRACE_EVENT_FN(sys_exit,
44 46
45 TP_PROTO(struct pt_regs *regs, long ret), 47 TP_PROTO(struct pt_regs *regs, long ret),
@@ -62,6 +64,8 @@ TRACE_EVENT_FN(sys_exit,
62 syscall_regfunc, syscall_unregfunc 64 syscall_regfunc, syscall_unregfunc
63); 65);
64 66
67TRACE_EVENT_FLAGS(sys_exit, TRACE_EVENT_FL_CAP_ANY)
68
65#endif /* CONFIG_HAVE_SYSCALL_TRACEPOINTS */ 69#endif /* CONFIG_HAVE_SYSCALL_TRACEPOINTS */
66 70
67#endif /* _TRACE_EVENTS_SYSCALLS_H */ 71#endif /* _TRACE_EVENTS_SYSCALLS_H */
diff --git a/include/trace/events/vmscan.h b/include/trace/events/vmscan.h
index 370aa5a87322..b2c33bd955fa 100644
--- a/include/trace/events/vmscan.h
+++ b/include/trace/events/vmscan.h
@@ -6,10 +6,13 @@
6 6
7#include <linux/types.h> 7#include <linux/types.h>
8#include <linux/tracepoint.h> 8#include <linux/tracepoint.h>
9#include <linux/mm.h>
10#include <linux/memcontrol.h>
9#include "gfpflags.h" 11#include "gfpflags.h"
10 12
11#define RECLAIM_WB_ANON 0x0001u 13#define RECLAIM_WB_ANON 0x0001u
12#define RECLAIM_WB_FILE 0x0002u 14#define RECLAIM_WB_FILE 0x0002u
15#define RECLAIM_WB_MIXED 0x0010u
13#define RECLAIM_WB_SYNC 0x0004u 16#define RECLAIM_WB_SYNC 0x0004u
14#define RECLAIM_WB_ASYNC 0x0008u 17#define RECLAIM_WB_ASYNC 0x0008u
15 18
@@ -17,13 +20,20 @@
17 (flags) ? __print_flags(flags, "|", \ 20 (flags) ? __print_flags(flags, "|", \
18 {RECLAIM_WB_ANON, "RECLAIM_WB_ANON"}, \ 21 {RECLAIM_WB_ANON, "RECLAIM_WB_ANON"}, \
19 {RECLAIM_WB_FILE, "RECLAIM_WB_FILE"}, \ 22 {RECLAIM_WB_FILE, "RECLAIM_WB_FILE"}, \
23 {RECLAIM_WB_MIXED, "RECLAIM_WB_MIXED"}, \
20 {RECLAIM_WB_SYNC, "RECLAIM_WB_SYNC"}, \ 24 {RECLAIM_WB_SYNC, "RECLAIM_WB_SYNC"}, \
21 {RECLAIM_WB_ASYNC, "RECLAIM_WB_ASYNC"} \ 25 {RECLAIM_WB_ASYNC, "RECLAIM_WB_ASYNC"} \
22 ) : "RECLAIM_WB_NONE" 26 ) : "RECLAIM_WB_NONE"
23 27
24#define trace_reclaim_flags(page, sync) ( \ 28#define trace_reclaim_flags(page, sync) ( \
25 (page_is_file_cache(page) ? RECLAIM_WB_FILE : RECLAIM_WB_ANON) | \ 29 (page_is_file_cache(page) ? RECLAIM_WB_FILE : RECLAIM_WB_ANON) | \
26 (sync == PAGEOUT_IO_SYNC ? RECLAIM_WB_SYNC : RECLAIM_WB_ASYNC) \ 30 (sync & RECLAIM_MODE_SYNC ? RECLAIM_WB_SYNC : RECLAIM_WB_ASYNC) \
31 )
32
33#define trace_shrink_flags(file, sync) ( \
34 (sync & RECLAIM_MODE_SYNC ? RECLAIM_WB_MIXED : \
35 (file ? RECLAIM_WB_FILE : RECLAIM_WB_ANON)) | \
36 (sync & RECLAIM_MODE_SYNC ? RECLAIM_WB_SYNC : RECLAIM_WB_ASYNC) \
27 ) 37 )
28 38
29TRACE_EVENT(mm_vmscan_kswapd_sleep, 39TRACE_EVENT(mm_vmscan_kswapd_sleep,
@@ -269,6 +279,121 @@ TRACE_EVENT(mm_vmscan_writepage,
269 show_reclaim_flags(__entry->reclaim_flags)) 279 show_reclaim_flags(__entry->reclaim_flags))
270); 280);
271 281
282TRACE_EVENT(mm_vmscan_lru_shrink_inactive,
283
284 TP_PROTO(int nid, int zid,
285 unsigned long nr_scanned, unsigned long nr_reclaimed,
286 int priority, int reclaim_flags),
287
288 TP_ARGS(nid, zid, nr_scanned, nr_reclaimed, priority, reclaim_flags),
289
290 TP_STRUCT__entry(
291 __field(int, nid)
292 __field(int, zid)
293 __field(unsigned long, nr_scanned)
294 __field(unsigned long, nr_reclaimed)
295 __field(int, priority)
296 __field(int, reclaim_flags)
297 ),
298
299 TP_fast_assign(
300 __entry->nid = nid;
301 __entry->zid = zid;
302 __entry->nr_scanned = nr_scanned;
303 __entry->nr_reclaimed = nr_reclaimed;
304 __entry->priority = priority;
305 __entry->reclaim_flags = reclaim_flags;
306 ),
307
308 TP_printk("nid=%d zid=%d nr_scanned=%ld nr_reclaimed=%ld priority=%d flags=%s",
309 __entry->nid, __entry->zid,
310 __entry->nr_scanned, __entry->nr_reclaimed,
311 __entry->priority,
312 show_reclaim_flags(__entry->reclaim_flags))
313);
314
315TRACE_EVENT(replace_swap_token,
316 TP_PROTO(struct mm_struct *old_mm,
317 struct mm_struct *new_mm),
318
319 TP_ARGS(old_mm, new_mm),
320
321 TP_STRUCT__entry(
322 __field(struct mm_struct*, old_mm)
323 __field(unsigned int, old_prio)
324 __field(struct mm_struct*, new_mm)
325 __field(unsigned int, new_prio)
326 ),
327
328 TP_fast_assign(
329 __entry->old_mm = old_mm;
330 __entry->old_prio = old_mm ? old_mm->token_priority : 0;
331 __entry->new_mm = new_mm;
332 __entry->new_prio = new_mm->token_priority;
333 ),
334
335 TP_printk("old_token_mm=%p old_prio=%u new_token_mm=%p new_prio=%u",
336 __entry->old_mm, __entry->old_prio,
337 __entry->new_mm, __entry->new_prio)
338);
339
340DECLARE_EVENT_CLASS(put_swap_token_template,
341 TP_PROTO(struct mm_struct *swap_token_mm),
342
343 TP_ARGS(swap_token_mm),
344
345 TP_STRUCT__entry(
346 __field(struct mm_struct*, swap_token_mm)
347 ),
348
349 TP_fast_assign(
350 __entry->swap_token_mm = swap_token_mm;
351 ),
352
353 TP_printk("token_mm=%p", __entry->swap_token_mm)
354);
355
356DEFINE_EVENT(put_swap_token_template, put_swap_token,
357 TP_PROTO(struct mm_struct *swap_token_mm),
358 TP_ARGS(swap_token_mm)
359);
360
361DEFINE_EVENT_CONDITION(put_swap_token_template, disable_swap_token,
362 TP_PROTO(struct mm_struct *swap_token_mm),
363 TP_ARGS(swap_token_mm),
364 TP_CONDITION(swap_token_mm != NULL)
365);
366
367TRACE_EVENT_CONDITION(update_swap_token_priority,
368 TP_PROTO(struct mm_struct *mm,
369 unsigned int old_prio,
370 struct mm_struct *swap_token_mm),
371
372 TP_ARGS(mm, old_prio, swap_token_mm),
373
374 TP_CONDITION(mm->token_priority != old_prio),
375
376 TP_STRUCT__entry(
377 __field(struct mm_struct*, mm)
378 __field(unsigned int, old_prio)
379 __field(unsigned int, new_prio)
380 __field(struct mm_struct*, swap_token_mm)
381 __field(unsigned int, swap_token_prio)
382 ),
383
384 TP_fast_assign(
385 __entry->mm = mm;
386 __entry->old_prio = old_prio;
387 __entry->new_prio = mm->token_priority;
388 __entry->swap_token_mm = swap_token_mm;
389 __entry->swap_token_prio = swap_token_mm ? swap_token_mm->token_priority : 0;
390 ),
391
392 TP_printk("mm=%p old_prio=%u new_prio=%u swap_token_mm=%p token_prio=%u",
393 __entry->mm, __entry->old_prio, __entry->new_prio,
394 __entry->swap_token_mm, __entry->swap_token_prio)
395);
396
272#endif /* _TRACE_VMSCAN_H */ 397#endif /* _TRACE_VMSCAN_H */
273 398
274/* This part must be outside protection */ 399/* This part must be outside protection */
diff --git a/include/trace/events/workqueue.h b/include/trace/events/workqueue.h
index 49682d7e9d60..7d497291c85d 100644
--- a/include/trace/events/workqueue.h
+++ b/include/trace/events/workqueue.h
@@ -7,38 +7,83 @@
7#include <linux/tracepoint.h> 7#include <linux/tracepoint.h>
8#include <linux/workqueue.h> 8#include <linux/workqueue.h>
9 9
10DECLARE_EVENT_CLASS(workqueue_work,
11
12 TP_PROTO(struct work_struct *work),
13
14 TP_ARGS(work),
15
16 TP_STRUCT__entry(
17 __field( void *, work )
18 ),
19
20 TP_fast_assign(
21 __entry->work = work;
22 ),
23
24 TP_printk("work struct %p", __entry->work)
25);
26
10/** 27/**
11 * workqueue_execute_start - called immediately before the workqueue callback 28 * workqueue_queue_work - called when a work gets queued
29 * @req_cpu: the requested cpu
30 * @cwq: pointer to struct cpu_workqueue_struct
12 * @work: pointer to struct work_struct 31 * @work: pointer to struct work_struct
13 * 32 *
14 * Allows to track workqueue execution. 33 * This event occurs when a work is queued immediately or once a
34 * delayed work is actually queued on a workqueue (ie: once the delay
35 * has been reached).
15 */ 36 */
16TRACE_EVENT(workqueue_execute_start, 37TRACE_EVENT(workqueue_queue_work,
17 38
18 TP_PROTO(struct work_struct *work), 39 TP_PROTO(unsigned int req_cpu, struct cpu_workqueue_struct *cwq,
40 struct work_struct *work),
19 41
20 TP_ARGS(work), 42 TP_ARGS(req_cpu, cwq, work),
21 43
22 TP_STRUCT__entry( 44 TP_STRUCT__entry(
23 __field( void *, work ) 45 __field( void *, work )
24 __field( void *, function) 46 __field( void *, function)
47 __field( void *, workqueue)
48 __field( unsigned int, req_cpu )
49 __field( unsigned int, cpu )
25 ), 50 ),
26 51
27 TP_fast_assign( 52 TP_fast_assign(
28 __entry->work = work; 53 __entry->work = work;
29 __entry->function = work->func; 54 __entry->function = work->func;
55 __entry->workqueue = cwq->wq;
56 __entry->req_cpu = req_cpu;
57 __entry->cpu = cwq->gcwq->cpu;
30 ), 58 ),
31 59
32 TP_printk("work struct %p: function %pf", __entry->work, __entry->function) 60 TP_printk("work struct=%p function=%pf workqueue=%p req_cpu=%u cpu=%u",
61 __entry->work, __entry->function, __entry->workqueue,
62 __entry->req_cpu, __entry->cpu)
33); 63);
34 64
35/** 65/**
36 * workqueue_execute_end - called immediately before the workqueue callback 66 * workqueue_activate_work - called when a work gets activated
67 * @work: pointer to struct work_struct
68 *
69 * This event occurs when a queued work is put on the active queue,
70 * which happens immediately after queueing unless @max_active limit
71 * is reached.
72 */
73DEFINE_EVENT(workqueue_work, workqueue_activate_work,
74
75 TP_PROTO(struct work_struct *work),
76
77 TP_ARGS(work)
78);
79
80/**
81 * workqueue_execute_start - called immediately before the workqueue callback
37 * @work: pointer to struct work_struct 82 * @work: pointer to struct work_struct
38 * 83 *
39 * Allows to track workqueue execution. 84 * Allows to track workqueue execution.
40 */ 85 */
41TRACE_EVENT(workqueue_execute_end, 86TRACE_EVENT(workqueue_execute_start,
42 87
43 TP_PROTO(struct work_struct *work), 88 TP_PROTO(struct work_struct *work),
44 89
@@ -46,15 +91,29 @@ TRACE_EVENT(workqueue_execute_end,
46 91
47 TP_STRUCT__entry( 92 TP_STRUCT__entry(
48 __field( void *, work ) 93 __field( void *, work )
94 __field( void *, function)
49 ), 95 ),
50 96
51 TP_fast_assign( 97 TP_fast_assign(
52 __entry->work = work; 98 __entry->work = work;
99 __entry->function = work->func;
53 ), 100 ),
54 101
55 TP_printk("work struct %p", __entry->work) 102 TP_printk("work struct %p: function %pf", __entry->work, __entry->function)
56); 103);
57 104
105/**
106 * workqueue_execute_end - called immediately before the workqueue callback
107 * @work: pointer to struct work_struct
108 *
109 * Allows to track workqueue execution.
110 */
111DEFINE_EVENT(workqueue_work, workqueue_execute_end,
112
113 TP_PROTO(struct work_struct *work),
114
115 TP_ARGS(work)
116);
58 117
59#endif /* _TRACE_WORKQUEUE_H */ 118#endif /* _TRACE_WORKQUEUE_H */
60 119
diff --git a/include/trace/events/writeback.h b/include/trace/events/writeback.h
index f345f66ae9d1..4e249b927eaa 100644
--- a/include/trace/events/writeback.h
+++ b/include/trace/events/writeback.h
@@ -81,6 +81,7 @@ DEFINE_EVENT(writeback_class, name, \
81 TP_ARGS(bdi)) 81 TP_ARGS(bdi))
82 82
83DEFINE_WRITEBACK_EVENT(writeback_nowork); 83DEFINE_WRITEBACK_EVENT(writeback_nowork);
84DEFINE_WRITEBACK_EVENT(writeback_wake_background);
84DEFINE_WRITEBACK_EVENT(writeback_wake_thread); 85DEFINE_WRITEBACK_EVENT(writeback_wake_thread);
85DEFINE_WRITEBACK_EVENT(writeback_wake_forker_thread); 86DEFINE_WRITEBACK_EVENT(writeback_wake_forker_thread);
86DEFINE_WRITEBACK_EVENT(writeback_bdi_register); 87DEFINE_WRITEBACK_EVENT(writeback_bdi_register);
@@ -96,8 +97,6 @@ DECLARE_EVENT_CLASS(wbc_class,
96 __field(long, nr_to_write) 97 __field(long, nr_to_write)
97 __field(long, pages_skipped) 98 __field(long, pages_skipped)
98 __field(int, sync_mode) 99 __field(int, sync_mode)
99 __field(int, nonblocking)
100 __field(int, encountered_congestion)
101 __field(int, for_kupdate) 100 __field(int, for_kupdate)
102 __field(int, for_background) 101 __field(int, for_background)
103 __field(int, for_reclaim) 102 __field(int, for_reclaim)
@@ -153,6 +152,41 @@ DEFINE_WBC_EVENT(wbc_balance_dirty_written);
153DEFINE_WBC_EVENT(wbc_balance_dirty_wait); 152DEFINE_WBC_EVENT(wbc_balance_dirty_wait);
154DEFINE_WBC_EVENT(wbc_writepage); 153DEFINE_WBC_EVENT(wbc_writepage);
155 154
155DECLARE_EVENT_CLASS(writeback_congest_waited_template,
156
157 TP_PROTO(unsigned int usec_timeout, unsigned int usec_delayed),
158
159 TP_ARGS(usec_timeout, usec_delayed),
160
161 TP_STRUCT__entry(
162 __field( unsigned int, usec_timeout )
163 __field( unsigned int, usec_delayed )
164 ),
165
166 TP_fast_assign(
167 __entry->usec_timeout = usec_timeout;
168 __entry->usec_delayed = usec_delayed;
169 ),
170
171 TP_printk("usec_timeout=%u usec_delayed=%u",
172 __entry->usec_timeout,
173 __entry->usec_delayed)
174);
175
176DEFINE_EVENT(writeback_congest_waited_template, writeback_congestion_wait,
177
178 TP_PROTO(unsigned int usec_timeout, unsigned int usec_delayed),
179
180 TP_ARGS(usec_timeout, usec_delayed)
181);
182
183DEFINE_EVENT(writeback_congest_waited_template, writeback_wait_iff_congested,
184
185 TP_PROTO(unsigned int usec_timeout, unsigned int usec_delayed),
186
187 TP_ARGS(usec_timeout, usec_delayed)
188);
189
156#endif /* _TRACE_WRITEBACK_H */ 190#endif /* _TRACE_WRITEBACK_H */
157 191
158/* This part must be outside protection */ 192/* This part must be outside protection */