From: Mathieu Desnoyers Date: Fri, 16 Sep 2011 14:48:22 +0000 (-0400) Subject: block layer instrumentation: fix cmd field X-Git-Tag: v2.0-pre9~61 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=e17d7b2781e42b8bfe6f86272a29299dff6d2912;p=lttng-modules.git block layer instrumentation: fix cmd field Signed-off-by: Mathieu Desnoyers --- diff --git a/instrumentation/events/lttng-module/block.h b/instrumentation/events/lttng-module/block.h index 1d5531c9..eddfaab9 100644 --- a/instrumentation/events/lttng-module/block.h +++ b/instrumentation/events/lttng-module/block.h @@ -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) ),