diff options
author | Tom Zanussi <zanussi@us.ibm.com> | 2006-03-28 08:15:22 +0200 |
---|---|---|
committer | Jens Axboe <axboe@suse.de> | 2006-03-28 08:15:22 +0200 |
commit | 6a6d3f0f61a8325b4d986e25bb0a61a82ca79e57 (patch) | |
tree | 05da7dd11ac06710cddf5b43def3370ddede2ae6 /blktrace.h | |
parent | 67c0cf46ee7055e8681968de25db9d3a9d452cb0 (diff) | |
download | blktrace-6a6d3f0f61a8325b4d986e25bb0a61a82ca79e57.tar.gz blktrace-6a6d3f0f61a8325b4d986e25bb0a61a82ca79e57.tar.bz2 |
[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')
-rw-r--r-- | blktrace.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -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) |