summaryrefslogtreecommitdiff
path: root/btt/seek.c
diff options
context:
space:
mode:
authorAlan David Brunelle <Alan.Brunelle@hp.com>2006-09-21 09:17:43 +0200
committerJens Axboe <axboe@kernel.dk>2006-09-21 09:17:43 +0200
commitb2ecdd0fc9f93e7a2bea09dcd7b2c472eb4e0d94 (patch)
tree7c47d98a76786d4c42d1ed82a245395804c87234 /btt/seek.c
parent80c27cbe67449fb2e4bdb682002d87f2f0c07e72 (diff)
downloadblktrace-b2ecdd0fc9f93e7a2bea09dcd7b2c472eb4e0d94.tar.gz
blktrace-b2ecdd0fc9f93e7a2bea09dcd7b2c472eb4e0d94.tar.bz2
[PATCH] Added in Q2C and D2C latency output option.
Also: cleaned up empty seek and latency files on exit. Signed-off-by: Alan D. Brunelle <Alan.Brunelle@hp.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'btt/seek.c')
-rw-r--r--btt/seek.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/btt/seek.c b/btt/seek.c
index 9ee8eec..3003611 100644
--- a/btt/seek.c
+++ b/btt/seek.c
@@ -20,6 +20,8 @@
*/
#include "globals.h"
+static struct file_info *all_files = NULL;
+
struct seek_bkt {
long long sectors;
int nseeks;
@@ -45,14 +47,21 @@ FILE *seek_open(__u32 device, char rw)
mjr = device >> MINORBITS;
mnr = device & ((1 << MINORBITS) - 1);
- oname = malloc(strlen(seek_name + 32));
+ oname = malloc(strlen(seek_name)+32);
sprintf(oname, "%s_%03d,%03d_%c.dat", seek_name, mjr, mnr, rw);
if ((fp = fopen(oname, "w")) == NULL)
perror(oname);
+ else
+ add_file(&all_files, fp, oname);
return fp;
}
+void seek_clean(void)
+{
+ clean_files(&all_files);
+}
+
long long seek_dist(struct seeki *sip, struct io *iop)
{
long long dist;