path: root/blktrace.h
diff options
authorTom Zanussi <>2006-03-28 08:15:22 +0200
committerJens Axboe <>2006-03-28 08:15:22 +0200
commit6a6d3f0f61a8325b4d986e25bb0a61a82ca79e57 (patch)
tree05da7dd11ac06710cddf5b43def3370ddede2ae6 /blktrace.h
parent67c0cf46ee7055e8681968de25db9d3a9d452cb0 (diff)
[PATCH] blktrace: fix sendfile problem with > buf_size xmits
Basically, it add buf_size, buf_nr and page_size to the net header and this info is put into each tip, for easy access in mmap_subbuf(). The global buf_size, etc is still used by clients, since the global value is all they need (for clients, the tip is filled in with the global values anyway, so that mmap_subbuf() can use them, maybe the tip->buf_size should be used everywhere instead for consistency and only use the global values for initial args. Also, each tip doesn't really need to have these values, they could be stored in tip->device but I thought it would be easier and quicker to access tip->buf_size rather than tip->device->buf_size). Actually, this data only needs to be sent once per trace, but since there's no header covering the entire trace, sends it each time. Could be an optimization to make later... I've tested it using sendfile over the network with different buffer sizes, and with normal non-sendfile network and non-network tracing straight to disk, and haven't seen any problems. Each test generated a little over 1Gb of trace data in a little under 2 minutes, just under 23 million events after parsing, so it looks to me like it's doing the job at this point...
Diffstat (limited to 'blktrace.h')
1 files changed, 1 insertions, 0 deletions
diff --git a/blktrace.h b/blktrace.h
index 6047048..cb4ee3b 100644
--- a/blktrace.h
+++ b/blktrace.h
@@ -18,6 +18,7 @@
#define DOUBLE_TO_NANO_ULL(d) ((unsigned long long)((d) * 1000000000))
#define min(a, b) ((a) < (b) ? (a) : (b))
+#define max(a, b) ((a) > (b) ? (a) : (b))
#define t_sec(t) ((t)->bytes >> 9)
#define t_kb(t) ((t)->bytes >> 10)