block instrumentation: write cmd as hex sequence
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 16 Sep 2011 16:32:48 +0000 (12:32 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 16 Sep 2011 16:32:48 +0000 (12:32 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
instrumentation/events/lttng-module/block.h

index eddfaab922f35ecb60b08f038181b5bb502767a3..42184f3d1e715555aa4eed32c30b27359949372c 100644 (file)
@@ -58,7 +58,9 @@ DECLARE_EVENT_CLASS(block_rq_with_error,
                __field(  unsigned int, nr_sector               )
                __field(  int,          errors                  )
                __field(  unsigned int, rwbs                    )
-               __dynamic_array_text( char,     cmd,    blk_cmd_buf_len(rq)     )
+               __dynamic_array_hex( unsigned char,     cmd,
+                       (rq->cmd_type == REQ_TYPE_BLOCK_PC) ?
+                               rq->cmd_len : 0)
        ),
 
        TP_fast_assign(
@@ -70,7 +72,7 @@ DECLARE_EVENT_CLASS(block_rq_with_error,
                tp_assign(errors, rq->errors)
                blk_fill_rwbs(rwbs, rq->cmd_flags, blk_rq_bytes(rq))
                tp_memcpy_dyn(cmd, (rq->cmd_type == REQ_TYPE_BLOCK_PC) ?
-                                       rq->cmd : (unsigned char *) "");
+                                       rq->cmd : NULL);
        ),
 
        TP_printk("%d,%d %s (%s) %llu + %u [%d]",
@@ -146,7 +148,9 @@ DECLARE_EVENT_CLASS(block_rq,
                __field(  unsigned int, bytes                   )
                __field(  unsigned int, rwbs                    )
                __array_text(  char,         comm,   TASK_COMM_LEN   )
-               __dynamic_array_text( char,     cmd,    blk_cmd_buf_len(rq)     )
+               __dynamic_array_hex( unsigned char,     cmd,
+                       (rq->cmd_type == REQ_TYPE_BLOCK_PC) ?
+                               rq->cmd_len : 0)
        ),
 
        TP_fast_assign(
@@ -159,7 +163,7 @@ DECLARE_EVENT_CLASS(block_rq,
                                        blk_rq_bytes(rq) : 0)
                blk_fill_rwbs(rwbs, rq->cmd_flags, blk_rq_bytes(rq))
                tp_memcpy_dyn(cmd, (rq->cmd_type == REQ_TYPE_BLOCK_PC) ?
-                                       rq->cmd : (unsigned char *) "");
+                                       rq->cmd : NULL);
                tp_memcpy(comm, current->comm, TASK_COMM_LEN)
        ),
 
This page took 0.027192 seconds and 4 git commands to generate.