Fix: writeback instrumentation for 4.2 kernels
authorMichael Jeanson <mjeanson@efficios.com>
Fri, 21 Aug 2015 18:57:29 +0000 (14:57 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 21 Aug 2015 20:26:44 +0000 (13:26 -0700)
Bandwidth related fields were moved by this commit:

commit a88a341a73be4ef035ca26170c849f002797da27
Author: Tejun Heo <tj@kernel.org>
Date:   Fri, 22 May 2015 17:13:28 -0400

    writeback: move bandwidth related fields from backing_dev_info into
    bdi_writeback

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
instrumentation/events/lttng-module/writeback.h

index 7ea3f8a3f2fa974c45540c32d58de5efbdc1105f..dc888861e4da5ec2cdf495655619a1646cdbbea6 100644 (file)
@@ -523,6 +523,55 @@ LTTNG_TRACEPOINT_EVENT_MAP(global_dirty_state,
 
 #define KBps(x)                        ((x) << (PAGE_SHIFT - 10))
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0))
+
+LTTNG_TRACEPOINT_EVENT_MAP(bdi_dirty_ratelimit,
+
+       writeback_bdi_dirty_ratelimit,
+
+       TP_PROTO(struct backing_dev_info *bdi,
+                unsigned long dirty_rate,
+                unsigned long task_ratelimit),
+
+       TP_ARGS(bdi, dirty_rate, task_ratelimit),
+
+       TP_STRUCT__entry(
+               __array(char,           bdi, 32)
+               __field(unsigned long,  write_bw)
+               __field(unsigned long,  avg_write_bw)
+               __field(unsigned long,  dirty_rate)
+               __field(unsigned long,  dirty_ratelimit)
+               __field(unsigned long,  task_ratelimit)
+               __field(unsigned long,  balanced_dirty_ratelimit)
+       ),
+
+       TP_fast_assign(
+               tp_memcpy(bdi, dev_name(bdi->dev), 32)
+               tp_assign(write_bw, KBps(bdi->wb.write_bandwidth))
+               tp_assign(avg_write_bw, KBps(bdi->wb.avg_write_bandwidth))
+               tp_assign(dirty_rate, KBps(dirty_rate))
+               tp_assign(dirty_ratelimit, KBps(bdi->wb.dirty_ratelimit))
+               tp_assign(task_ratelimit, KBps(task_ratelimit))
+               tp_assign(balanced_dirty_ratelimit,
+                                       KBps(bdi->wb.balanced_dirty_ratelimit))
+       ),
+
+       TP_printk("bdi %s: "
+                 "write_bw=%lu awrite_bw=%lu dirty_rate=%lu "
+                 "dirty_ratelimit=%lu task_ratelimit=%lu "
+                 "balanced_dirty_ratelimit=%lu",
+                 __entry->bdi,
+                 __entry->write_bw,            /* write bandwidth */
+                 __entry->avg_write_bw,        /* avg write bandwidth */
+                 __entry->dirty_rate,          /* bdi dirty rate */
+                 __entry->dirty_ratelimit,     /* base ratelimit */
+                 __entry->task_ratelimit, /* ratelimit with position control */
+                 __entry->balanced_dirty_ratelimit /* the balanced ratelimit */
+       )
+)
+
+#else
+
 LTTNG_TRACEPOINT_EVENT_MAP(bdi_dirty_ratelimit,
 
        writeback_bdi_dirty_ratelimit,
@@ -568,6 +617,8 @@ LTTNG_TRACEPOINT_EVENT_MAP(bdi_dirty_ratelimit,
        )
 )
 
+#endif
+
 LTTNG_TRACEPOINT_EVENT_MAP(balance_dirty_pages,
 
        writeback_balance_dirty_pages,
This page took 0.026911 seconds and 4 git commands to generate.