[PATCH] Bump ->cpu to 32-bits for alignment and add process name
authorNathan Scott <nathans@sgi.com>
Tue, 6 Sep 2005 06:48:11 +0000 (08:48 +0200)
committerJens Axboe <axboe@suse.de>
Tue, 6 Sep 2005 06:48:11 +0000 (08:48 +0200)
blktrace.h
blktrace_api.h

index 91c386bd2c2ddab23d0f7fb705fee9c9563ac570..167785c3bc6485c60c3c4c72baee15c7f768736b 100644 (file)
@@ -7,7 +7,7 @@
 #include "blktrace_api.h"
 
 #define CHECK_MAGIC(t)         (((t)->magic & 0xffffff00) == BLK_IO_TRACE_MAGIC)
-#define SUPPORTED_VERSION      (0x03)
+#define SUPPORTED_VERSION      (0x04)
 
 #if defined(__LITTLE_ENDIAN_BITFIELD)
 #define be16_to_cpu(x)         __bswap_16(x)
@@ -51,9 +51,11 @@ static inline void trace_to_be(struct blk_io_trace *t)
        t->bytes        = cpu_to_be32(t->bytes);
        t->action       = cpu_to_be32(t->action);
        t->pid          = cpu_to_be32(t->pid);
-       t->cpu          = cpu_to_be16(t->cpu);
+       t->cpu          = cpu_to_be32(t->cpu);
        t->error        = cpu_to_be16(t->error);
        t->pdu_len      = cpu_to_be16(t->pdu_len);
+       t->device       = cpu_to_be32(t->device);
+       /* t->comm is a string (endian neutral) */
 }
 
 static inline void trace_to_cpu(struct blk_io_trace *t)
@@ -65,9 +67,11 @@ static inline void trace_to_cpu(struct blk_io_trace *t)
        t->bytes        = be32_to_cpu(t->bytes);
        t->action       = be32_to_cpu(t->action);
        t->pid          = be32_to_cpu(t->pid);
-       t->cpu          = be16_to_cpu(t->cpu);
+       t->cpu          = be32_to_cpu(t->cpu);
        t->error        = be16_to_cpu(t->error);
        t->pdu_len      = be16_to_cpu(t->pdu_len);
+       t->device       = be32_to_cpu(t->device);
+       /* t->comm is a string (endian neutral) */
 }
 
 #endif
index 5b0ab319b0d579657b70f5aeecf5bf016bb503d3..e6a7498f5080316c1abc53b7abf82cb9ba9a0924 100644 (file)
@@ -51,7 +51,7 @@ enum {
 #define BLK_TA_COMPLETE                (__BLK_TA_COMPLETE| BLK_TC_ACT(BLK_TC_COMPLETE))
 
 #define BLK_IO_TRACE_MAGIC     0x65617400
-#define BLK_IO_TRACE_VERSION   0x03
+#define BLK_IO_TRACE_VERSION   0x04
 
 /*
  * The trace itself
@@ -64,9 +64,11 @@ struct blk_io_trace {
        __u32 bytes;            /* transfer length */
        __u32 action;           /* what happened */
        __u32 pid;              /* who did it */
-       __u16 cpu;              /* on what cpu did it happen */
+       __u32 cpu;              /* on what cpu did it happen */
        __u16 error;            /* completion error */
        __u16 pdu_len;          /* length of data after this trace */
+       __u32 device;           /* device identifier (dev_t) */
+       char  comm[16];         /* task command name (TASK_COMM_LEN) */
 };
 
 /*