[PATCH] blktrace: use the new setup/start/stop/teardown ioctls
authorJens Axboe <axboe@suse.de>
Wed, 8 Feb 2006 10:25:46 +0000 (11:25 +0100)
committerJens Axboe <axboe@suse.de>
Wed, 8 Feb 2006 10:25:46 +0000 (11:25 +0100)
blktrace.c
blktrace_api.h

index 30b33ae25323efae5971b63b6ae97f30e38142ab..6e62d4796912532d76d54372f98c021d5c2b1840 100644 (file)
@@ -261,8 +261,13 @@ static int start_trace(struct device_information *dip)
        buts.buf_nr = buf_nr;
        buts.act_mask = act_mask;
 
-       if (ioctl(dip->fd, BLKSTARTTRACE, &buts) < 0) {
-               perror("BLKSTARTTRACE");
+       if (ioctl(dip->fd, BLKTRACESETUP, &buts) < 0) {
+               perror("BLKTRACESETUP");
+               return 1;
+       }
+
+       if (ioctl(dip->fd, BLKTRACESTART) < 0) {
+               perror("BLKTRACESTART");
                return 1;
        }
 
@@ -276,8 +281,10 @@ static void stop_trace(struct device_information *dip)
        if (dip_tracing(dip) || kill_running_trace) {
                dip_set_tracing(dip, 0);
 
-               if (ioctl(dip->fd, BLKSTOPTRACE) < 0)
-                       perror("BLKSTOPTRACE");
+               if (ioctl(dip->fd, BLKTRACESTOP) < 0)
+                       perror("BLKTRACESTOP");
+               if (ioctl(dip->fd, BLKTRACETEARDOWN) < 0)
+                       perror("BLKTRACETEARDOWN");
 
                close(dip->fd);
                dip->fd = -1;
index 7cc3cf57ef7f1818b52b9cf99df57220d6074e14..3513a1238c120686fb63e9447534ba2c0ef963ce 100644 (file)
@@ -107,7 +107,9 @@ struct blk_user_trace_setup {
        __u32 pid;
 };
 
-#define BLKSTARTTRACE _IOWR(0x12,115,struct blk_user_trace_setup)
-#define BLKSTOPTRACE _IO(0x12,116)
+#define BLKTRACESETUP _IOWR(0x12,115,struct blk_user_trace_setup)
+#define BLKTRACESTART _IO(0x12,116)
+#define BLKTRACESTOP _IO(0x12,117)
+#define BLKTRACETEARDOWN _IO(0x12,118)
 
 #endif