License cleanup, ifdef namespace cleanup
[lttng-modules.git] / instrumentation / events / lttng-module / block.h
index 1c48384ef240fc0b9ac59605debf78fe5dd07d43..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(
@@ -69,7 +71,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, blk_cmd_buf_len(rq))
+               tp_memcpy_dyn(cmd, (rq->cmd_type == REQ_TYPE_BLOCK_PC) ?
+                                       rq->cmd : NULL);
        ),
 
        TP_printk("%d,%d %s (%s) %llu + %u [%d]",
@@ -145,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(
@@ -157,7 +162,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, blk_cmd_buf_len(rq))
+               tp_memcpy_dyn(cmd, (rq->cmd_type == REQ_TYPE_BLOCK_PC) ?
+                                       rq->cmd : NULL);
                tp_memcpy(comm, current->comm, TASK_COMM_LEN)
        ),
 
@@ -616,5 +622,5 @@ TRACE_EVENT(block_rq_remap,
 #endif /* _TRACE_BLOCK_H */
 
 /* This part must be outside protection */
-#include "define_trace.h"
+#include "../../../probes/define_trace.h"
 
This page took 0.02934 seconds and 4 git commands to generate.