block layer instrumentation: fix cmd field
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 16 Sep 2011 14:48:22 +0000 (10:48 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 16 Sep 2011 15:10:04 +0000 (11:10 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
instrumentation/events/lttng-module/block.h

index 1d5531c974fae249b0ecd382c7fc7c745667323e..eddfaab922f35ecb60b08f038181b5bb502767a3 100644 (file)
@@ -69,7 +69,8 @@ DECLARE_EVENT_CLASS(block_rq_with_error,
                                        0 : blk_rq_sectors(rq))
                tp_assign(errors, rq->errors)
                blk_fill_rwbs(rwbs, rq->cmd_flags, blk_rq_bytes(rq))
-               tp_memcpy_dyn(cmd, rq->cmd)
+               tp_memcpy_dyn(cmd, (rq->cmd_type == REQ_TYPE_BLOCK_PC) ?
+                                       rq->cmd : (unsigned char *) "");
        ),
 
        TP_printk("%d,%d %s (%s) %llu + %u [%d]",
@@ -157,7 +158,8 @@ DECLARE_EVENT_CLASS(block_rq,
                tp_assign(bytes, (rq->cmd_type == REQ_TYPE_BLOCK_PC) ?
                                        blk_rq_bytes(rq) : 0)
                blk_fill_rwbs(rwbs, rq->cmd_flags, blk_rq_bytes(rq))
-               tp_memcpy_dyn(cmd, rq->cmd)
+               tp_memcpy_dyn(cmd, (rq->cmd_type == REQ_TYPE_BLOCK_PC) ?
+                                       rq->cmd : (unsigned char *) "");
                tp_memcpy(comm, current->comm, TASK_COMM_LEN)
        ),
 
This page took 0.026756 seconds and 4 git commands to generate.