1 From 1c53e689434a6bdd7dc3f54c07bfb72750d1d24c Mon Sep 17 00:00:00 2001
2 From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
3 Date: Tue, 15 Apr 2014 11:13:16 -0400
4 Subject: [PATCH] Fix: update block instrumentation to 3.15 kernel
6 Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 instrumentation/events/lttng-module/block.h | 53 +++++++++++++++++++++++++++
9 1 file changed, 53 insertions(+)
11 diff --git a/instrumentation/events/lttng-module/block.h b/instrumentation/events/lttng-module/block.h
12 index 8d26797..2af4fb3 100644
13 --- a/instrumentation/events/lttng-module/block.h
14 +++ b/instrumentation/events/lttng-module/block.h
15 @@ -221,6 +221,57 @@ DEFINE_EVENT(block_rq_with_error, block_rq_requeue,
19 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0))
22 + * block_rq_complete - block IO operation completed by device driver
23 + * @q: queue containing the block operation request
24 + * @rq: block operations request
25 + * @nr_bytes: number of completed bytes
27 + * The block_rq_complete tracepoint event indicates that some portion
28 + * of operation request has been completed by the device driver. If
29 + * the @rq->bio is %NULL, then there is absolutely no additional work to
30 + * do for the request. If @rq->bio is non-NULL then there is
31 + * additional work required to complete the request.
33 +TRACE_EVENT(block_rq_complete,
35 + TP_PROTO(struct request_queue *q, struct request *rq,
36 + unsigned int nr_bytes),
38 + TP_ARGS(q, rq, nr_bytes),
41 + __field( dev_t, dev )
42 + __field( sector_t, sector )
43 + __field( unsigned int, nr_sector )
44 + __field( int, errors )
45 + __field( unsigned int, rwbs )
46 + __dynamic_array_hex( unsigned char, cmd,
47 + (rq->cmd_type == REQ_TYPE_BLOCK_PC) ?
52 + tp_assign(dev, rq->rq_disk ? disk_devt(rq->rq_disk) : 0)
53 + tp_assign(sector, blk_rq_pos(rq))
54 + tp_assign(nr_sector, nr_bytes >> 9)
55 + tp_assign(errors, rq->errors)
56 + blk_fill_rwbs(rwbs, rq->cmd_flags, nr_bytes)
57 + tp_memcpy_dyn(cmd, (rq->cmd_type == REQ_TYPE_BLOCK_PC) ?
61 + TP_printk("%d,%d %s (%s) %llu + %u [%d]",
62 + MAJOR(__entry->dev), MINOR(__entry->dev),
63 + __entry->rwbs, __get_str(cmd),
64 + (unsigned long long)__entry->sector,
65 + __entry->nr_sector, __entry->errors)
68 +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) */
71 * block_rq_complete - block IO operation completed by device driver
72 * @q: queue containing the block operation request
73 @@ -239,6 +290,8 @@ DEFINE_EVENT(block_rq_with_error, block_rq_complete,
77 +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) */
79 DECLARE_EVENT_CLASS(block_rq,
81 TP_PROTO(struct request_queue *q, struct request *rq),