summaryrefslogtreecommitdiff
path: root/blktrace.h
diff options
context:
space:
mode:
authorJens Axboe <axboe@suse.de>2005-09-25 07:37:11 +0200
committerJens Axboe <axboe@suse.de>2005-09-25 07:37:11 +0200
commit71d5d4c9156c5946e76fe9909b234e9da64a8341 (patch)
treef53415ec9ec20af78bac1fb83a9408f019433751 /blktrace.h
parent6f7de8cd76bec1f90ec2dced6aaed583841dc954 (diff)
downloadblktrace-71d5d4c9156c5946e76fe9909b234e9da64a8341.tar.gz
blktrace-71d5d4c9156c5946e76fe9909b234e9da64a8341.tar.bz2
[PATCH] blkparse: split format parsing into seperate file
Diffstat (limited to 'blktrace.h')
-rw-r--r--blktrace.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/blktrace.h b/blktrace.h
index 9855101..6ef5ab0 100644
--- a/blktrace.h
+++ b/blktrace.h
@@ -6,6 +6,37 @@
#include <asm/byteorder.h>
#include "blktrace_api.h"
+#define MINORBITS 20
+#define MINORMASK ((1U << MINORBITS) - 1)
+#define MAJOR(dev) ((unsigned int) ((dev) >> MINORBITS))
+#define MINOR(dev) ((unsigned int) ((dev) & MINORMASK))
+
+#define SECONDS(x) ((unsigned long long)(x) / 1000000000)
+#define NANO_SECONDS(x) ((unsigned long long)(x) % 1000000000)
+#define DOUBLE_TO_NANO_ULL(d) ((unsigned long long)((d) * 1000000000))
+
+#define min(a, b) ((a) < (b) ? (a) : (b))
+
+struct io_stats {
+ unsigned long qreads, qwrites, creads, cwrites, mreads, mwrites;
+ unsigned long ireads, iwrites;
+ unsigned long long qread_kb, qwrite_kb, cread_kb, cwrite_kb;
+ unsigned long long iread_kb, iwrite_kb;
+ unsigned long io_unplugs, timer_unplugs;
+};
+
+struct per_cpu_info {
+ int cpu;
+ int nelems;
+
+ int fd;
+ char fname[128];
+
+ struct io_stats io_stats;
+};
+
+extern FILE *ofp;
+
#define CHECK_MAGIC(t) (((t)->magic & 0xffffff00) == BLK_IO_TRACE_MAGIC)
#define SUPPORTED_VERSION (0x05)
@@ -74,4 +105,9 @@ static inline void trace_to_cpu(struct blk_io_trace *t)
/* t->comm is a string (endian neutral) */
}
+extern void set_all_format_specs(char *);
+extern int add_format_spec(char *);
+extern void process_fmt(char *, struct per_cpu_info *, struct blk_io_trace *,
+ unsigned long long, int, unsigned char *);
+
#endif