block.h (b7e56edba4b02f2079042c326a8cd72a44635817) block.h (881245dcff29df992d8431392a41fb81549129f9)
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM block
3
4#if !defined(_TRACE_BLOCK_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_BLOCK_H
6
7#include <linux/blktrace_api.h>
8#include <linux/blkdev.h>

--- 26 unchanged lines hidden (view full) ---

35
36 TP_printk("%d,%d %s (%s) %llu + %u [%d]",
37 MAJOR(__entry->dev), MINOR(__entry->dev),
38 __entry->rwbs, __get_str(cmd),
39 (unsigned long long)__entry->sector,
40 __entry->nr_sector, __entry->errors)
41);
42
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM block
3
4#if !defined(_TRACE_BLOCK_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_BLOCK_H
6
7#include <linux/blktrace_api.h>
8#include <linux/blkdev.h>

--- 26 unchanged lines hidden (view full) ---

35
36 TP_printk("%d,%d %s (%s) %llu + %u [%d]",
37 MAJOR(__entry->dev), MINOR(__entry->dev),
38 __entry->rwbs, __get_str(cmd),
39 (unsigned long long)__entry->sector,
40 __entry->nr_sector, __entry->errors)
41);
42
43/**
44 * block_rq_abort - abort block operation request
45 * @q: queue containing the block operation request
46 * @rq: block IO operation request
47 *
48 * Called immediately after pending block IO operation request @rq in
49 * queue @q is aborted. The fields in the operation request @rq
50 * can be examined to determine which device and sectors the pending
51 * operation would access.
52 */
43DEFINE_EVENT(block_rq_with_error, block_rq_abort,
44
45 TP_PROTO(struct request_queue *q, struct request *rq),
46
47 TP_ARGS(q, rq)
48);
49
53DEFINE_EVENT(block_rq_with_error, block_rq_abort,
54
55 TP_PROTO(struct request_queue *q, struct request *rq),
56
57 TP_ARGS(q, rq)
58);
59
60/**
61 * block_rq_requeue - place block IO request back on a queue
62 * @q: queue holding operation
63 * @rq: block IO operation request
64 *
65 * The block operation request @rq is being placed back into queue
66 * @q. For some reason the request was not completed and needs to be
67 * put back in the queue.
68 */
50DEFINE_EVENT(block_rq_with_error, block_rq_requeue,
51
52 TP_PROTO(struct request_queue *q, struct request *rq),
53
54 TP_ARGS(q, rq)
55);
56
69DEFINE_EVENT(block_rq_with_error, block_rq_requeue,
70
71 TP_PROTO(struct request_queue *q, struct request *rq),
72
73 TP_ARGS(q, rq)
74);
75
76/**
77 * block_rq_complete - block IO operation completed by device driver
78 * @q: queue containing the block operation request
79 * @rq: block operations request
80 *
81 * The block_rq_complete tracepoint event indicates that some portion
82 * of operation request has been completed by the device driver. If
83 * the @rq->bio is %NULL, then there is absolutely no additional work to
84 * do for the request. If @rq->bio is non-NULL then there is
85 * additional work required to complete the request.
86 */
57DEFINE_EVENT(block_rq_with_error, block_rq_complete,
58
59 TP_PROTO(struct request_queue *q, struct request *rq),
60
61 TP_ARGS(q, rq)
62);
63
64DECLARE_EVENT_CLASS(block_rq,

--- 25 unchanged lines hidden (view full) ---

90
91 TP_printk("%d,%d %s %u (%s) %llu + %u [%s]",
92 MAJOR(__entry->dev), MINOR(__entry->dev),
93 __entry->rwbs, __entry->bytes, __get_str(cmd),
94 (unsigned long long)__entry->sector,
95 __entry->nr_sector, __entry->comm)
96);
97
87DEFINE_EVENT(block_rq_with_error, block_rq_complete,
88
89 TP_PROTO(struct request_queue *q, struct request *rq),
90
91 TP_ARGS(q, rq)
92);
93
94DECLARE_EVENT_CLASS(block_rq,

--- 25 unchanged lines hidden (view full) ---

120
121 TP_printk("%d,%d %s %u (%s) %llu + %u [%s]",
122 MAJOR(__entry->dev), MINOR(__entry->dev),
123 __entry->rwbs, __entry->bytes, __get_str(cmd),
124 (unsigned long long)__entry->sector,
125 __entry->nr_sector, __entry->comm)
126);
127
128/**
129 * block_rq_insert - insert block operation request into queue
130 * @q: target queue
131 * @rq: block IO operation request
132 *
133 * Called immediately before block operation request @rq is inserted
134 * into queue @q. The fields in the operation request @rq struct can
135 * be examined to determine which device and sectors the pending
136 * operation would access.
137 */
98DEFINE_EVENT(block_rq, block_rq_insert,
99
100 TP_PROTO(struct request_queue *q, struct request *rq),
101
102 TP_ARGS(q, rq)
103);
104
138DEFINE_EVENT(block_rq, block_rq_insert,
139
140 TP_PROTO(struct request_queue *q, struct request *rq),
141
142 TP_ARGS(q, rq)
143);
144
145/**
146 * block_rq_issue - issue pending block IO request operation to device driver
147 * @q: queue holding operation
148 * @rq: block IO operation operation request
149 *
150 * Called when block operation request @rq from queue @q is sent to a
151 * device driver for processing.
152 */
105DEFINE_EVENT(block_rq, block_rq_issue,
106
107 TP_PROTO(struct request_queue *q, struct request *rq),
108
109 TP_ARGS(q, rq)
110);
111
153DEFINE_EVENT(block_rq, block_rq_issue,
154
155 TP_PROTO(struct request_queue *q, struct request *rq),
156
157 TP_ARGS(q, rq)
158);
159
160/**
161 * block_bio_bounce - used bounce buffer when processing block operation
162 * @q: queue holding the block operation
163 * @bio: block operation
164 *
165 * A bounce buffer was used to handle the block operation @bio in @q.
166 * This occurs when hardware limitations prevent a direct transfer of
167 * data between the @bio data memory area and the IO device. Use of a
168 * bounce buffer requires extra copying of data and decreases
169 * performance.
170 */
112TRACE_EVENT(block_bio_bounce,
113
114 TP_PROTO(struct request_queue *q, struct bio *bio),
115
116 TP_ARGS(q, bio),
117
118 TP_STRUCT__entry(
119 __field( dev_t, dev )

--- 13 unchanged lines hidden (view full) ---

133 ),
134
135 TP_printk("%d,%d %s %llu + %u [%s]",
136 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs,
137 (unsigned long long)__entry->sector,
138 __entry->nr_sector, __entry->comm)
139);
140
171TRACE_EVENT(block_bio_bounce,
172
173 TP_PROTO(struct request_queue *q, struct bio *bio),
174
175 TP_ARGS(q, bio),
176
177 TP_STRUCT__entry(
178 __field( dev_t, dev )

--- 13 unchanged lines hidden (view full) ---

192 ),
193
194 TP_printk("%d,%d %s %llu + %u [%s]",
195 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs,
196 (unsigned long long)__entry->sector,
197 __entry->nr_sector, __entry->comm)
198);
199
200/**
201 * block_bio_complete - completed all work on the block operation
202 * @q: queue holding the block operation
203 * @bio: block operation completed
204 *
205 * This tracepoint indicates there is no further work to do on this
206 * block IO operation @bio.
207 */
141TRACE_EVENT(block_bio_complete,
142
143 TP_PROTO(struct request_queue *q, struct bio *bio),
144
145 TP_ARGS(q, bio),
146
147 TP_STRUCT__entry(
148 __field( dev_t, dev )

--- 39 unchanged lines hidden (view full) ---

188 ),
189
190 TP_printk("%d,%d %s %llu + %u [%s]",
191 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs,
192 (unsigned long long)__entry->sector,
193 __entry->nr_sector, __entry->comm)
194);
195
208TRACE_EVENT(block_bio_complete,
209
210 TP_PROTO(struct request_queue *q, struct bio *bio),
211
212 TP_ARGS(q, bio),
213
214 TP_STRUCT__entry(
215 __field( dev_t, dev )

--- 39 unchanged lines hidden (view full) ---

255 ),
256
257 TP_printk("%d,%d %s %llu + %u [%s]",
258 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs,
259 (unsigned long long)__entry->sector,
260 __entry->nr_sector, __entry->comm)
261);
262
263/**
264 * block_bio_backmerge - merging block operation to the end of an existing operation
265 * @q: queue holding operation
266 * @bio: new block operation to merge
267 *
268 * Merging block request @bio to the end of an existing block request
269 * in queue @q.
270 */
196DEFINE_EVENT(block_bio, block_bio_backmerge,
197
198 TP_PROTO(struct request_queue *q, struct bio *bio),
199
200 TP_ARGS(q, bio)
201);
202
271DEFINE_EVENT(block_bio, block_bio_backmerge,
272
273 TP_PROTO(struct request_queue *q, struct bio *bio),
274
275 TP_ARGS(q, bio)
276);
277
278/**
279 * block_bio_frontmerge - merging block operation to the beginning of an existing operation
280 * @q: queue holding operation
281 * @bio: new block operation to merge
282 *
283 * Merging block IO operation @bio to the beginning of an existing block
284 * operation in queue @q.
285 */
203DEFINE_EVENT(block_bio, block_bio_frontmerge,
204
205 TP_PROTO(struct request_queue *q, struct bio *bio),
206
207 TP_ARGS(q, bio)
208);
209
286DEFINE_EVENT(block_bio, block_bio_frontmerge,
287
288 TP_PROTO(struct request_queue *q, struct bio *bio),
289
290 TP_ARGS(q, bio)
291);
292
293/**
294 * block_bio_queue - putting new block IO operation in queue
295 * @q: queue holding operation
296 * @bio: new block operation
297 *
298 * About to place the block IO operation @bio into queue @q.
299 */
210DEFINE_EVENT(block_bio, block_bio_queue,
211
212 TP_PROTO(struct request_queue *q, struct bio *bio),
213
214 TP_ARGS(q, bio)
215);
216
217DECLARE_EVENT_CLASS(block_get_rq,

--- 20 unchanged lines hidden (view full) ---

238 ),
239
240 TP_printk("%d,%d %s %llu + %u [%s]",
241 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs,
242 (unsigned long long)__entry->sector,
243 __entry->nr_sector, __entry->comm)
244);
245
300DEFINE_EVENT(block_bio, block_bio_queue,
301
302 TP_PROTO(struct request_queue *q, struct bio *bio),
303
304 TP_ARGS(q, bio)
305);
306
307DECLARE_EVENT_CLASS(block_get_rq,

--- 20 unchanged lines hidden (view full) ---

328 ),
329
330 TP_printk("%d,%d %s %llu + %u [%s]",
331 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs,
332 (unsigned long long)__entry->sector,
333 __entry->nr_sector, __entry->comm)
334);
335
336/**
337 * block_getrq - get a free request entry in queue for block IO operations
338 * @q: queue for operations
339 * @bio: pending block IO operation
340 * @rw: low bit indicates a read (%0) or a write (%1)
341 *
342 * A request struct for queue @q has been allocated to handle the
343 * block IO operation @bio.
344 */
246DEFINE_EVENT(block_get_rq, block_getrq,
247
248 TP_PROTO(struct request_queue *q, struct bio *bio, int rw),
249
250 TP_ARGS(q, bio, rw)
251);
252
345DEFINE_EVENT(block_get_rq, block_getrq,
346
347 TP_PROTO(struct request_queue *q, struct bio *bio, int rw),
348
349 TP_ARGS(q, bio, rw)
350);
351
352/**
353 * block_sleeprq - waiting to get a free request entry in queue for block IO operation
354 * @q: queue for operation
355 * @bio: pending block IO operation
356 * @rw: low bit indicates a read (%0) or a write (%1)
357 *
358 * In the case where a request struct cannot be provided for queue @q
359 * the process needs to wait for an request struct to become
360 * available. This tracepoint event is generated each time the
361 * process goes to sleep waiting for request struct become available.
362 */
253DEFINE_EVENT(block_get_rq, block_sleeprq,
254
255 TP_PROTO(struct request_queue *q, struct bio *bio, int rw),
256
257 TP_ARGS(q, bio, rw)
258);
259
363DEFINE_EVENT(block_get_rq, block_sleeprq,
364
365 TP_PROTO(struct request_queue *q, struct bio *bio, int rw),
366
367 TP_ARGS(q, bio, rw)
368);
369
370/**
371 * block_plug - keep operations requests in request queue
372 * @q: request queue to plug
373 *
374 * Plug the request queue @q. Do not allow block operation requests
375 * to be sent to the device driver. Instead, accumulate requests in
376 * the queue to improve throughput performance of the block device.
377 */
260TRACE_EVENT(block_plug,
261
262 TP_PROTO(struct request_queue *q),
263
264 TP_ARGS(q),
265
266 TP_STRUCT__entry(
267 __array( char, comm, TASK_COMM_LEN )

--- 20 unchanged lines hidden (view full) ---

288 TP_fast_assign(
289 __entry->nr_rq = q->rq.count[READ] + q->rq.count[WRITE];
290 memcpy(__entry->comm, current->comm, TASK_COMM_LEN);
291 ),
292
293 TP_printk("[%s] %d", __entry->comm, __entry->nr_rq)
294);
295
378TRACE_EVENT(block_plug,
379
380 TP_PROTO(struct request_queue *q),
381
382 TP_ARGS(q),
383
384 TP_STRUCT__entry(
385 __array( char, comm, TASK_COMM_LEN )

--- 20 unchanged lines hidden (view full) ---

406 TP_fast_assign(
407 __entry->nr_rq = q->rq.count[READ] + q->rq.count[WRITE];
408 memcpy(__entry->comm, current->comm, TASK_COMM_LEN);
409 ),
410
411 TP_printk("[%s] %d", __entry->comm, __entry->nr_rq)
412);
413
414/**
415 * block_unplug_timer - timed release of operations requests in queue to device driver
416 * @q: request queue to unplug
417 *
418 * Unplug the request queue @q because a timer expired and allow block
419 * operation requests to be sent to the device driver.
420 */
296DEFINE_EVENT(block_unplug, block_unplug_timer,
297
298 TP_PROTO(struct request_queue *q),
299
300 TP_ARGS(q)
301);
302
421DEFINE_EVENT(block_unplug, block_unplug_timer,
422
423 TP_PROTO(struct request_queue *q),
424
425 TP_ARGS(q)
426);
427
428/**
429 * block_unplug_io - release of operations requests in request queue
430 * @q: request queue to unplug
431 *
432 * Unplug request queue @q because device driver is scheduled to work
433 * on elements in the request queue.
434 */
303DEFINE_EVENT(block_unplug, block_unplug_io,
304
305 TP_PROTO(struct request_queue *q),
306
307 TP_ARGS(q)
308);
309
435DEFINE_EVENT(block_unplug, block_unplug_io,
436
437 TP_PROTO(struct request_queue *q),
438
439 TP_ARGS(q)
440);
441
442/**
443 * block_split - split a single bio struct into two bio structs
444 * @q: queue containing the bio
445 * @bio: block operation being split
446 * @new_sector: The starting sector for the new bio
447 *
448 * The bio request @bio in request queue @q needs to be split into two
449 * bio requests. The newly created @bio request starts at
450 * @new_sector. This split may be required due to hardware limitation
451 * such as operation crossing device boundaries in a RAID system.
452 */
310TRACE_EVENT(block_split,
311
312 TP_PROTO(struct request_queue *q, struct bio *bio,
313 unsigned int new_sector),
314
315 TP_ARGS(q, bio, new_sector),
316
317 TP_STRUCT__entry(

--- 14 unchanged lines hidden (view full) ---

332
333 TP_printk("%d,%d %s %llu / %llu [%s]",
334 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs,
335 (unsigned long long)__entry->sector,
336 (unsigned long long)__entry->new_sector,
337 __entry->comm)
338);
339
453TRACE_EVENT(block_split,
454
455 TP_PROTO(struct request_queue *q, struct bio *bio,
456 unsigned int new_sector),
457
458 TP_ARGS(q, bio, new_sector),
459
460 TP_STRUCT__entry(

--- 14 unchanged lines hidden (view full) ---

475
476 TP_printk("%d,%d %s %llu / %llu [%s]",
477 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs,
478 (unsigned long long)__entry->sector,
479 (unsigned long long)__entry->new_sector,
480 __entry->comm)
481);
482
483/**
484 * block_remap - map request for a partition to the raw device
485 * @q: queue holding the operation
486 * @bio: revised operation
487 * @dev: device for the operation
488 * @from: original sector for the operation
489 *
490 * An operation for a partition on a block device has been mapped to the
491 * raw block device.
492 */
340TRACE_EVENT(block_remap,
341
342 TP_PROTO(struct request_queue *q, struct bio *bio, dev_t dev,
343 sector_t from),
344
345 TP_ARGS(q, bio, dev, from),
346
347 TP_STRUCT__entry(

--- 17 unchanged lines hidden (view full) ---

365 TP_printk("%d,%d %s %llu + %u <- (%d,%d) %llu",
366 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs,
367 (unsigned long long)__entry->sector,
368 __entry->nr_sector,
369 MAJOR(__entry->old_dev), MINOR(__entry->old_dev),
370 (unsigned long long)__entry->old_sector)
371);
372
493TRACE_EVENT(block_remap,
494
495 TP_PROTO(struct request_queue *q, struct bio *bio, dev_t dev,
496 sector_t from),
497
498 TP_ARGS(q, bio, dev, from),
499
500 TP_STRUCT__entry(

--- 17 unchanged lines hidden (view full) ---

518 TP_printk("%d,%d %s %llu + %u <- (%d,%d) %llu",
519 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs,
520 (unsigned long long)__entry->sector,
521 __entry->nr_sector,
522 MAJOR(__entry->old_dev), MINOR(__entry->old_dev),
523 (unsigned long long)__entry->old_sector)
524);
525
526/**
527 * block_rq_remap - map request for a block operation request
528 * @q: queue holding the operation
529 * @rq: block IO operation request
530 * @dev: device for the operation
531 * @from: original sector for the operation
532 *
533 * The block operation request @rq in @q has been remapped. The block
534 * operation request @rq holds the current information and @from hold
535 * the original sector.
536 */
373TRACE_EVENT(block_rq_remap,
374
375 TP_PROTO(struct request_queue *q, struct request *rq, dev_t dev,
376 sector_t from),
377
378 TP_ARGS(q, rq, dev, from),
379
380 TP_STRUCT__entry(

--- 30 unchanged lines hidden ---
537TRACE_EVENT(block_rq_remap,
538
539 TP_PROTO(struct request_queue *q, struct request *rq, dev_t dev,
540 sector_t from),
541
542 TP_ARGS(q, rq, dev, from),
543
544 TP_STRUCT__entry(

--- 30 unchanged lines hidden ---