block.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #undef TRACE_SYSTEM
  3. #define TRACE_SYSTEM block
  4. #if !defined(_TRACE_BLOCK_H) || defined(TRACE_HEADER_MULTI_READ)
  5. #define _TRACE_BLOCK_H
  6. #include <linux/blktrace_api.h>
  7. #include <linux/blkdev.h>
  8. #include <linux/buffer_head.h>
  9. #include <linux/tracepoint.h>
  10. #include <uapi/linux/ioprio.h>
  11. #define RWBS_LEN 10
  12. #define IOPRIO_CLASS_STRINGS \
  13. { IOPRIO_CLASS_NONE, "none" }, \
  14. { IOPRIO_CLASS_RT, "rt" }, \
  15. { IOPRIO_CLASS_BE, "be" }, \
  16. { IOPRIO_CLASS_IDLE, "idle" }, \
  17. { IOPRIO_CLASS_INVALID, "invalid"}
  18. #ifdef CONFIG_BUFFER_HEAD
  19. DECLARE_EVENT_CLASS(block_buffer,
  20. TP_PROTO(struct buffer_head *bh),
  21. TP_ARGS(bh),
  22. TP_STRUCT__entry (
  23. __field( dev_t, dev )
  24. __field( sector_t, sector )
  25. __field( size_t, size )
  26. ),
  27. TP_fast_assign(
  28. __entry->dev = bh->b_bdev->bd_dev;
  29. __entry->sector = bh->b_blocknr;
  30. __entry->size = bh->b_size;
  31. ),
  32. TP_printk("%d,%d sector=%llu size=%zu",
  33. MAJOR(__entry->dev), MINOR(__entry->dev),
  34. (unsigned long long)__entry->sector, __entry->size
  35. )
  36. );
  37. /**
  38. * block_touch_buffer - mark a buffer accessed
  39. * @bh: buffer_head being touched
  40. *
  41. * Called from touch_buffer().
  42. */
  43. DEFINE_EVENT(block_buffer, block_touch_buffer,
  44. TP_PROTO(struct buffer_head *bh),
  45. TP_ARGS(bh)
  46. );
  47. /**
  48. * block_dirty_buffer - mark a buffer dirty
  49. * @bh: buffer_head being dirtied
  50. *
  51. * Called from mark_buffer_dirty().
  52. */
  53. DEFINE_EVENT(block_buffer, block_dirty_buffer,
  54. TP_PROTO(struct buffer_head *bh),
  55. TP_ARGS(bh)
  56. );
  57. #endif /* CONFIG_BUFFER_HEAD */
  58. /**
  59. * block_rq_requeue - place block IO request back on a queue
  60. * @rq: block IO operation request
  61. *
  62. * The block operation request @rq is being placed back into queue
  63. * @q. For some reason the request was not completed and needs to be
  64. * put back in the queue.
  65. */
  66. TRACE_EVENT(block_rq_requeue,
  67. TP_PROTO(struct request *rq),
  68. TP_ARGS(rq),
  69. TP_STRUCT__entry(
  70. __field( dev_t, dev )
  71. __field( sector_t, sector )
  72. __field( unsigned int, nr_sector )
  73. __field( unsigned short, ioprio )
  74. __array( char, rwbs, RWBS_LEN )
  75. __dynamic_array( char, cmd, 1 )
  76. ),
  77. TP_fast_assign(
  78. __entry->dev = rq->q->disk ? disk_devt(rq->q->disk) : 0;
  79. __entry->sector = blk_rq_trace_sector(rq);
  80. __entry->nr_sector = blk_rq_trace_nr_sectors(rq);
  81. __entry->ioprio = req_get_ioprio(rq);
  82. blk_fill_rwbs(__entry->rwbs, rq->cmd_flags);
  83. __get_str(cmd)[0] = '\0';
  84. ),
  85. TP_printk("%d,%d %s (%s) %llu + %u %s,%u,%u [%d]",
  86. MAJOR(__entry->dev), MINOR(__entry->dev),
  87. __entry->rwbs, __get_str(cmd),
  88. (unsigned long long)__entry->sector, __entry->nr_sector,
  89. __print_symbolic(IOPRIO_PRIO_CLASS(__entry->ioprio),
  90. IOPRIO_CLASS_STRINGS),
  91. IOPRIO_PRIO_HINT(__entry->ioprio),
  92. IOPRIO_PRIO_LEVEL(__entry->ioprio), 0)
  93. );
  94. DECLARE_EVENT_CLASS(block_rq_completion,
  95. TP_PROTO(struct request *rq, blk_status_t error, unsigned int nr_bytes),
  96. TP_ARGS(rq, error, nr_bytes),
  97. TP_STRUCT__entry(
  98. __field( dev_t, dev )
  99. __field( sector_t, sector )
  100. __field( unsigned int, nr_sector )
  101. __field( int , error )
  102. __field( unsigned short, ioprio )
  103. __array( char, rwbs, RWBS_LEN )
  104. __dynamic_array( char, cmd, 1 )
  105. ),
  106. TP_fast_assign(
  107. __entry->dev = rq->q->disk ? disk_devt(rq->q->disk) : 0;
  108. __entry->sector = blk_rq_pos(rq);
  109. __entry->nr_sector = nr_bytes >> 9;
  110. __entry->error = blk_status_to_errno(error);
  111. __entry->ioprio = req_get_ioprio(rq);
  112. blk_fill_rwbs(__entry->rwbs, rq->cmd_flags);
  113. __get_str(cmd)[0] = '\0';
  114. ),
  115. TP_printk("%d,%d %s (%s) %llu + %u %s,%u,%u [%d]",
  116. MAJOR(__entry->dev), MINOR(__entry->dev),
  117. __entry->rwbs, __get_str(cmd),
  118. (unsigned long long)__entry->sector, __entry->nr_sector,
  119. __print_symbolic(IOPRIO_PRIO_CLASS(__entry->ioprio),
  120. IOPRIO_CLASS_STRINGS),
  121. IOPRIO_PRIO_HINT(__entry->ioprio),
  122. IOPRIO_PRIO_LEVEL(__entry->ioprio), __entry->error)
  123. );
  124. /**
  125. * block_rq_complete - block IO operation completed by device driver
  126. * @rq: block operations request
  127. * @error: status code
  128. * @nr_bytes: number of completed bytes
  129. *
  130. * The block_rq_complete tracepoint event indicates that some portion
  131. * of operation request has been completed by the device driver. If
  132. * the @rq->bio is %NULL, then there is absolutely no additional work to
  133. * do for the request. If @rq->bio is non-NULL then there is
  134. * additional work required to complete the request.
  135. */
  136. DEFINE_EVENT(block_rq_completion, block_rq_complete,
  137. TP_PROTO(struct request *rq, blk_status_t error, unsigned int nr_bytes),
  138. TP_ARGS(rq, error, nr_bytes)
  139. );
  140. /**
  141. * block_rq_error - block IO operation error reported by device driver
  142. * @rq: block operations request
  143. * @error: status code
  144. * @nr_bytes: number of completed bytes
  145. *
  146. * The block_rq_error tracepoint event indicates that some portion
  147. * of operation request has failed as reported by the device driver.
  148. */
  149. DEFINE_EVENT(block_rq_completion, block_rq_error,
  150. TP_PROTO(struct request *rq, blk_status_t error, unsigned int nr_bytes),
  151. TP_ARGS(rq, error, nr_bytes)
  152. );
  153. DECLARE_EVENT_CLASS(block_rq,
  154. TP_PROTO(struct request *rq),
  155. TP_ARGS(rq),
  156. TP_STRUCT__entry(
  157. __field( dev_t, dev )
  158. __field( sector_t, sector )
  159. __field( unsigned int, nr_sector )
  160. __field( unsigned int, bytes )
  161. __field( unsigned short, ioprio )
  162. __array( char, rwbs, RWBS_LEN )
  163. __array( char, comm, TASK_COMM_LEN )
  164. __dynamic_array( char, cmd, 1 )
  165. ),
  166. TP_fast_assign(
  167. __entry->dev = rq->q->disk ? disk_devt(rq->q->disk) : 0;
  168. __entry->sector = blk_rq_trace_sector(rq);
  169. __entry->nr_sector = blk_rq_trace_nr_sectors(rq);
  170. __entry->bytes = blk_rq_bytes(rq);
  171. __entry->ioprio = req_get_ioprio(rq);
  172. blk_fill_rwbs(__entry->rwbs, rq->cmd_flags);
  173. __get_str(cmd)[0] = '\0';
  174. memcpy(__entry->comm, current->comm, TASK_COMM_LEN);
  175. ),
  176. TP_printk("%d,%d %s %u (%s) %llu + %u %s,%u,%u [%s]",
  177. MAJOR(__entry->dev), MINOR(__entry->dev),
  178. __entry->rwbs, __entry->bytes, __get_str(cmd),
  179. (unsigned long long)__entry->sector, __entry->nr_sector,
  180. __print_symbolic(IOPRIO_PRIO_CLASS(__entry->ioprio),
  181. IOPRIO_CLASS_STRINGS),
  182. IOPRIO_PRIO_HINT(__entry->ioprio),
  183. IOPRIO_PRIO_LEVEL(__entry->ioprio), __entry->comm)
  184. );
  185. /**
  186. * block_rq_insert - insert block operation request into queue
  187. * @rq: block IO operation request
  188. *
  189. * Called immediately before block operation request @rq is inserted
  190. * into queue @q. The fields in the operation request @rq struct can
  191. * be examined to determine which device and sectors the pending
  192. * operation would access.
  193. */
  194. DEFINE_EVENT(block_rq, block_rq_insert,
  195. TP_PROTO(struct request *rq),
  196. TP_ARGS(rq)
  197. );
  198. /**
  199. * block_rq_issue - issue pending block IO request operation to device driver
  200. * @rq: block IO operation request
  201. *
  202. * Called when block operation request @rq from queue @q is sent to a
  203. * device driver for processing.
  204. */
  205. DEFINE_EVENT(block_rq, block_rq_issue,
  206. TP_PROTO(struct request *rq),
  207. TP_ARGS(rq)
  208. );
  209. /**
  210. * block_rq_merge - merge request with another one in the elevator
  211. * @rq: block IO operation request
  212. *
  213. * Called when block operation request @rq from queue @q is merged to another
  214. * request queued in the elevator.
  215. */
  216. DEFINE_EVENT(block_rq, block_rq_merge,
  217. TP_PROTO(struct request *rq),
  218. TP_ARGS(rq)
  219. );
  220. /**
  221. * block_io_start - insert a request for execution
  222. * @rq: block IO operation request
  223. *
  224. * Called when block operation request @rq is queued for execution
  225. */
  226. DEFINE_EVENT(block_rq, block_io_start,
  227. TP_PROTO(struct request *rq),
  228. TP_ARGS(rq)
  229. );
  230. /**
  231. * block_io_done - block IO operation request completed
  232. * @rq: block IO operation request
  233. *
  234. * Called when block operation request @rq is completed
  235. */
  236. DEFINE_EVENT(block_rq, block_io_done,
  237. TP_PROTO(struct request *rq),
  238. TP_ARGS(rq)
  239. );
  240. /**
  241. * block_bio_complete - completed all work on the block operation
  242. * @q: queue holding the block operation
  243. * @bio: block operation completed
  244. *
  245. * This tracepoint indicates there is no further work to do on this
  246. * block IO operation @bio.
  247. */
  248. TRACE_EVENT(block_bio_complete,
  249. TP_PROTO(struct request_queue *q, struct bio *bio),
  250. TP_ARGS(q, bio),
  251. TP_STRUCT__entry(
  252. __field( dev_t, dev )
  253. __field( sector_t, sector )
  254. __field( unsigned, nr_sector )
  255. __field( int, error )
  256. __array( char, rwbs, RWBS_LEN)
  257. ),
  258. TP_fast_assign(
  259. __entry->dev = bio_dev(bio);
  260. __entry->sector = bio->bi_iter.bi_sector;
  261. __entry->nr_sector = bio_sectors(bio);
  262. __entry->error = blk_status_to_errno(bio->bi_status);
  263. blk_fill_rwbs(__entry->rwbs, bio->bi_opf);
  264. ),
  265. TP_printk("%d,%d %s %llu + %u [%d]",
  266. MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs,
  267. (unsigned long long)__entry->sector,
  268. __entry->nr_sector, __entry->error)
  269. );
  270. DECLARE_EVENT_CLASS(block_bio,
  271. TP_PROTO(struct bio *bio),
  272. TP_ARGS(bio),
  273. TP_STRUCT__entry(
  274. __field( dev_t, dev )
  275. __field( sector_t, sector )
  276. __field( unsigned int, nr_sector )
  277. __array( char, rwbs, RWBS_LEN )
  278. __array( char, comm, TASK_COMM_LEN )
  279. ),
  280. TP_fast_assign(
  281. __entry->dev = bio_dev(bio);
  282. __entry->sector = bio->bi_iter.bi_sector;
  283. __entry->nr_sector = bio_sectors(bio);
  284. blk_fill_rwbs(__entry->rwbs, bio->bi_opf);
  285. memcpy(__entry->comm, current->comm, TASK_COMM_LEN);
  286. ),
  287. TP_printk("%d,%d %s %llu + %u [%s]",
  288. MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs,
  289. (unsigned long long)__entry->sector,
  290. __entry->nr_sector, __entry->comm)
  291. );
  292. /**
  293. * block_bio_backmerge - merging block operation to the end of an existing operation
  294. * @bio: new block operation to merge
  295. *
  296. * Merging block request @bio to the end of an existing block request.
  297. */
  298. DEFINE_EVENT(block_bio, block_bio_backmerge,
  299. TP_PROTO(struct bio *bio),
  300. TP_ARGS(bio)
  301. );
  302. /**
  303. * block_bio_frontmerge - merging block operation to the beginning of an existing operation
  304. * @bio: new block operation to merge
  305. *
  306. * Merging block IO operation @bio to the beginning of an existing block request.
  307. */
  308. DEFINE_EVENT(block_bio, block_bio_frontmerge,
  309. TP_PROTO(struct bio *bio),
  310. TP_ARGS(bio)
  311. );
  312. /**
  313. * block_bio_queue - putting new block IO operation in queue
  314. * @bio: new block operation
  315. *
  316. * About to place the block IO operation @bio into queue @q.
  317. */
  318. DEFINE_EVENT(block_bio, block_bio_queue,
  319. TP_PROTO(struct bio *bio),
  320. TP_ARGS(bio)
  321. );
  322. /**
  323. * block_getrq - get a free request entry in queue for block IO operations
  324. * @bio: pending block IO operation (can be %NULL)
  325. *
  326. * A request struct has been allocated to handle the block IO operation @bio.
  327. */
  328. DEFINE_EVENT(block_bio, block_getrq,
  329. TP_PROTO(struct bio *bio),
  330. TP_ARGS(bio)
  331. );
  332. /**
  333. * blk_zone_append_update_request_bio - update bio sector after zone append
  334. * @rq: the completed request that sets the bio sector
  335. *
  336. * Update the bio's bi_sector after a zone append command has been completed.
  337. */
  338. DEFINE_EVENT(block_rq, blk_zone_append_update_request_bio,
  339. TP_PROTO(struct request *rq),
  340. TP_ARGS(rq)
  341. );
  342. /**
  343. * block_plug - keep operations requests in request queue
  344. * @q: request queue to plug
  345. *
  346. * Plug the request queue @q. Do not allow block operation requests
  347. * to be sent to the device driver. Instead, accumulate requests in
  348. * the queue to improve throughput performance of the block device.
  349. */
  350. TRACE_EVENT(block_plug,
  351. TP_PROTO(struct request_queue *q),
  352. TP_ARGS(q),
  353. TP_STRUCT__entry(
  354. __array( char, comm, TASK_COMM_LEN )
  355. ),
  356. TP_fast_assign(
  357. memcpy(__entry->comm, current->comm, TASK_COMM_LEN);
  358. ),
  359. TP_printk("[%s]", __entry->comm)
  360. );
  361. DECLARE_EVENT_CLASS(block_unplug,
  362. TP_PROTO(struct request_queue *q, unsigned int depth, bool explicit),
  363. TP_ARGS(q, depth, explicit),
  364. TP_STRUCT__entry(
  365. __field( int, nr_rq )
  366. __array( char, comm, TASK_COMM_LEN )
  367. ),
  368. TP_fast_assign(
  369. __entry->nr_rq = depth;
  370. memcpy(__entry->comm, current->comm, TASK_COMM_LEN);
  371. ),
  372. TP_printk("[%s] %d", __entry->comm, __entry->nr_rq)
  373. );
  374. /**
  375. * block_unplug - release of operations requests in request queue
  376. * @q: request queue to unplug
  377. * @depth: number of requests just added to the queue
  378. * @explicit: whether this was an explicit unplug, or one from schedule()
  379. *
  380. * Unplug request queue @q because device driver is scheduled to work
  381. * on elements in the request queue.
  382. */
  383. DEFINE_EVENT(block_unplug, block_unplug,
  384. TP_PROTO(struct request_queue *q, unsigned int depth, bool explicit),
  385. TP_ARGS(q, depth, explicit)
  386. );
  387. /**
  388. * block_split - split a single bio struct into two bio structs
  389. * @bio: block operation being split
  390. * @new_sector: The starting sector for the new bio
  391. *
  392. * The bio request @bio needs to be split into two bio requests. The newly
  393. * created @bio request starts at @new_sector. This split may be required due to
  394. * hardware limitations such as operation crossing device boundaries in a RAID
  395. * system.
  396. */
  397. TRACE_EVENT(block_split,
  398. TP_PROTO(struct bio *bio, unsigned int new_sector),
  399. TP_ARGS(bio, new_sector),
  400. TP_STRUCT__entry(
  401. __field( dev_t, dev )
  402. __field( sector_t, sector )
  403. __field( sector_t, new_sector )
  404. __array( char, rwbs, RWBS_LEN )
  405. __array( char, comm, TASK_COMM_LEN )
  406. ),
  407. TP_fast_assign(
  408. __entry->dev = bio_dev(bio);
  409. __entry->sector = bio->bi_iter.bi_sector;
  410. __entry->new_sector = new_sector;
  411. blk_fill_rwbs(__entry->rwbs, bio->bi_opf);
  412. memcpy(__entry->comm, current->comm, TASK_COMM_LEN);
  413. ),
  414. TP_printk("%d,%d %s %llu / %llu [%s]",
  415. MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs,
  416. (unsigned long long)__entry->sector,
  417. (unsigned long long)__entry->new_sector,
  418. __entry->comm)
  419. );
  420. /**
  421. * block_bio_remap - map request for a logical device to the raw device
  422. * @bio: revised operation
  423. * @dev: original device for the operation
  424. * @from: original sector for the operation
  425. *
  426. * An operation for a logical device has been mapped to the
  427. * raw block device.
  428. */
  429. TRACE_EVENT(block_bio_remap,
  430. TP_PROTO(struct bio *bio, dev_t dev, sector_t from),
  431. TP_ARGS(bio, dev, from),
  432. TP_STRUCT__entry(
  433. __field( dev_t, dev )
  434. __field( sector_t, sector )
  435. __field( unsigned int, nr_sector )
  436. __field( dev_t, old_dev )
  437. __field( sector_t, old_sector )
  438. __array( char, rwbs, RWBS_LEN)
  439. ),
  440. TP_fast_assign(
  441. __entry->dev = bio_dev(bio);
  442. __entry->sector = bio->bi_iter.bi_sector;
  443. __entry->nr_sector = bio_sectors(bio);
  444. __entry->old_dev = dev;
  445. __entry->old_sector = from;
  446. blk_fill_rwbs(__entry->rwbs, bio->bi_opf);
  447. ),
  448. TP_printk("%d,%d %s %llu + %u <- (%d,%d) %llu",
  449. MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs,
  450. (unsigned long long)__entry->sector,
  451. __entry->nr_sector,
  452. MAJOR(__entry->old_dev), MINOR(__entry->old_dev),
  453. (unsigned long long)__entry->old_sector)
  454. );
  455. /**
  456. * block_rq_remap - map request for a block operation request
  457. * @rq: block IO operation request
  458. * @dev: device for the operation
  459. * @from: original sector for the operation
  460. *
  461. * The block operation request @rq in @q has been remapped. The block
  462. * operation request @rq holds the current information and @from hold
  463. * the original sector.
  464. */
  465. TRACE_EVENT(block_rq_remap,
  466. TP_PROTO(struct request *rq, dev_t dev, sector_t from),
  467. TP_ARGS(rq, dev, from),
  468. TP_STRUCT__entry(
  469. __field( dev_t, dev )
  470. __field( sector_t, sector )
  471. __field( unsigned int, nr_sector )
  472. __field( dev_t, old_dev )
  473. __field( sector_t, old_sector )
  474. __field( unsigned int, nr_bios )
  475. __array( char, rwbs, RWBS_LEN)
  476. ),
  477. TP_fast_assign(
  478. __entry->dev = disk_devt(rq->q->disk);
  479. __entry->sector = blk_rq_pos(rq);
  480. __entry->nr_sector = blk_rq_sectors(rq);
  481. __entry->old_dev = dev;
  482. __entry->old_sector = from;
  483. __entry->nr_bios = blk_rq_count_bios(rq);
  484. blk_fill_rwbs(__entry->rwbs, rq->cmd_flags);
  485. ),
  486. TP_printk("%d,%d %s %llu + %u <- (%d,%d) %llu %u",
  487. MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs,
  488. (unsigned long long)__entry->sector,
  489. __entry->nr_sector,
  490. MAJOR(__entry->old_dev), MINOR(__entry->old_dev),
  491. (unsigned long long)__entry->old_sector, __entry->nr_bios)
  492. );
  493. /**
  494. * blkdev_zone_mgmt - Execute a zone management operation on a range of zones
  495. * @bio: The block IO operation sent down to the device
  496. * @nr_sectors: The number of sectors affected by this operation
  497. *
  498. * Execute a zone management operation on a specified range of zones. This
  499. * range is encoded in %nr_sectors, which has to be a multiple of the zone
  500. * size.
  501. */
  502. TRACE_EVENT(blkdev_zone_mgmt,
  503. TP_PROTO(struct bio *bio, sector_t nr_sectors),
  504. TP_ARGS(bio, nr_sectors),
  505. TP_STRUCT__entry(
  506. __field( dev_t, dev )
  507. __field( sector_t, sector )
  508. __field( sector_t, nr_sectors )
  509. __array( char, rwbs, RWBS_LEN)
  510. ),
  511. TP_fast_assign(
  512. __entry->dev = bio_dev(bio);
  513. __entry->sector = bio->bi_iter.bi_sector;
  514. __entry->nr_sectors = bio_sectors(bio);
  515. blk_fill_rwbs(__entry->rwbs, bio->bi_opf);
  516. ),
  517. TP_printk("%d,%d %s %llu + %llu",
  518. MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs,
  519. (unsigned long long)__entry->sector,
  520. __entry->nr_sectors)
  521. );
  522. DECLARE_EVENT_CLASS(block_zwplug,
  523. TP_PROTO(struct request_queue *q, unsigned int zno, sector_t sector,
  524. unsigned int nr_sectors),
  525. TP_ARGS(q, zno, sector, nr_sectors),
  526. TP_STRUCT__entry(
  527. __field( dev_t, dev )
  528. __field( unsigned int, zno )
  529. __field( sector_t, sector )
  530. __field( unsigned int, nr_sectors )
  531. ),
  532. TP_fast_assign(
  533. __entry->dev = disk_devt(q->disk);
  534. __entry->zno = zno;
  535. __entry->sector = sector;
  536. __entry->nr_sectors = nr_sectors;
  537. ),
  538. TP_printk("%d,%d zone %u, BIO %llu + %u",
  539. MAJOR(__entry->dev), MINOR(__entry->dev), __entry->zno,
  540. (unsigned long long)__entry->sector,
  541. __entry->nr_sectors)
  542. );
  543. DEFINE_EVENT(block_zwplug, disk_zone_wplug_add_bio,
  544. TP_PROTO(struct request_queue *q, unsigned int zno, sector_t sector,
  545. unsigned int nr_sectors),
  546. TP_ARGS(q, zno, sector, nr_sectors)
  547. );
  548. DEFINE_EVENT(block_zwplug, blk_zone_wplug_bio,
  549. TP_PROTO(struct request_queue *q, unsigned int zno, sector_t sector,
  550. unsigned int nr_sectors),
  551. TP_ARGS(q, zno, sector, nr_sectors)
  552. );
  553. #endif /* _TRACE_BLOCK_H */
  554. /* This part must be outside protection */
  555. #include <trace/define_trace.h>