summaryrefslogtreecommitdiff
path: root/btt/bt_timeline.c
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2006-12-01 10:51:31 +0100
committerJens Axboe <jens.axboe@oracle.com>2006-12-01 10:51:31 +0100
commit001b263355c68e219fb64d25564c41a0ee07a274 (patch)
tree635e6489da1f8d58492ac25fa642083ae6386233 /btt/bt_timeline.c
parent095181f283c440c7669f2c14aef5e84c80ff433e (diff)
downloadblktrace-001b263355c68e219fb64d25564c41a0ee07a274.tar.gz
blktrace-001b263355c68e219fb64d25564c41a0ee07a274.tar.bz2
[PATCH] BTT patch: (3/3) time bounded trace analysis
Added in -t and -T options to allow bounding of traces analyzed. Be forewarned: this can result in some excessive numbers of orphaned traces (partial IO streams before the -t tiem and after the -T time won't be analyzed). Signed-off-by: Alan D. Brunelle <Alan.Brunelle@hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'btt/bt_timeline.c')
-rw-r--r--btt/bt_timeline.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/btt/bt_timeline.c b/btt/bt_timeline.c
index 1c0855f..fa56780 100644
--- a/btt/bt_timeline.c
+++ b/btt/bt_timeline.c
@@ -27,18 +27,20 @@ char bt_timeline_version[] = "0.99";
char *devices, *exes, *input_name, *output_name, *seek_name;
char *d2c_name, *q2c_name, *per_io_name;
-double range_delta = 0.1;
FILE *ranges_ofp, *avgs_ofp, *per_io_ofp;
-int ifd, verbose = 0;
+int ifd, verbose, done, time_bounded;
+double t_astart, t_aend;
unsigned long n_traces;
struct avgs_info all_avgs;
-__u64 last_q = (__u64)-1;
unsigned int n_devs;
time_t genesis, last_vtrace;
LIST_HEAD(all_devs);
LIST_HEAD(all_procs);
LIST_HEAD(free_ios);
+double range_delta = 0.1;
+__u64 last_q = (__u64)-1;
+
struct region_info all_regions = {
.qranges = LIST_HEAD_INIT(all_regions.qranges),
.cranges = LIST_HEAD_INIT(all_regions.cranges),
@@ -67,7 +69,7 @@ int process(void)
struct io *iop = io_alloc();
genesis = last_vtrace = time(NULL);
- while (!do_read(ifd, &iop->t, sizeof(struct blk_io_trace))) {
+ while (!done && !do_read(ifd, &iop->t, sizeof(struct blk_io_trace))) {
t = convert_to_cpu(&iop->t);
if (t->pdu_len > 0) {
iop->pdu = malloc(t->pdu_len);
@@ -79,7 +81,9 @@ int process(void)
add_trace(iop);
iop = io_alloc();
}
+
io_release(iop);
+ do_retries();
if (iostat_ofp) {
fprintf(iostat_ofp, "\n");