]> git.pld-linux.org Git - packages/lttng-modules.git/blob - block-update.patch
1a8f1f39dec5bff45ca3256874eb40cb1393936a
[packages/lttng-modules.git] / block-update.patch
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
5
6 Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 ---
8  instrumentation/events/lttng-module/block.h |   53 +++++++++++++++++++++++++++
9  1 file changed, 53 insertions(+)
10
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,
16         TP_ARGS(q, rq)
17  )
18  
19 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0))
20 +
21 +/**
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
26 + *
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.
32 + */
33 +TRACE_EVENT(block_rq_complete,
34 +
35 +       TP_PROTO(struct request_queue *q, struct request *rq,
36 +                unsigned int nr_bytes),
37 +
38 +       TP_ARGS(q, rq, nr_bytes),
39 +
40 +       TP_STRUCT__entry(
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) ?
48 +                               rq->cmd_len : 0)
49 +       ),
50 +
51 +       TP_fast_assign(
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) ?
58 +                                       rq->cmd : NULL)
59 +       ),
60 +
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)
66 +)
67 +
68 +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) */
69 +
70  /**
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,
74         TP_ARGS(q, rq)
75  )
76  
77 +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) */
78 +
79  DECLARE_EVENT_CLASS(block_rq,
80  
81         TP_PROTO(struct request_queue *q, struct request *rq),
82 -- 
83 1.7.10.4
84
This page took 0.153693 seconds and 2 git commands to generate.