avoid string overflows
[blktrace.git] / blktrace.h
index cb4ee3badbbcbbc7b821baecd470a4d40cd7beff..8b3e031119abb90cee712a87b527a6af2c92eed6 100644 (file)
@@ -31,6 +31,10 @@ struct io_stats {
        unsigned long ireads, iwrites, rrqueue, wrqueue;
        unsigned long long qread_kb, qwrite_kb, cread_kb, cwrite_kb;
        unsigned long long iread_kb, iwrite_kb;
+       unsigned long long mread_kb, mwrite_kb;
+       unsigned long qreads_pc, qwrites_pc, ireads_pc, iwrites_pc;
+       unsigned long rrqueue_pc, wrqueue_pc, creads_pc, cwrites_pc;
+       unsigned long long qread_kb_pc, qwrite_kb_pc, iread_kb_pc, iwrite_kb_pc;
        unsigned long io_unplugs, timer_unplugs;
 };
 
@@ -55,6 +59,7 @@ struct per_cpu_info {
 
 extern FILE *ofp;
 extern int data_is_native;
+extern struct timespec abs_start_time;
 
 #define CHECK_MAGIC(t)         (((t)->magic & 0xffffff00) == BLK_IO_TRACE_MAGIC)
 #define SUPPORTED_VERSION      (0x07)
@@ -105,7 +110,7 @@ static inline void trace_to_cpu(struct blk_io_trace *t)
        t->action       = be32_to_cpu(t->action);
        t->pid          = be32_to_cpu(t->pid);
        t->device       = be32_to_cpu(t->device);
-       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);
 }