Skip to contentSkip to conversation

blktrace: fix comment in blktrace_api.h

PATCH Applied Souvik Banerjee 2 participants 2 messages Mar 30, 2018 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 blktrace: fix comment in blktrace_api.h

The __u64 time field of the blk_io_trace struct refers to the time in nanoseconds, not in microseconds. It is set in __blk_add_trace, which does the following:

    t->time = ktime_to_ns(ktime_get());

ktime_to_ns returns ktime_t in nanoseconds, not microseconds.

---
 include/uapi/linux/blktrace_api.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/uapi/linux/blktrace_api.h +1 -1
index 3c50e07ee833..690621b610e5 100644
@@ -101,7 +101,7 @@ enum blktrace_notify {
 struct blk_io_trace {
 	__u32 magic;		/* MAGIC << 8 | version */
 	__u32 sequence;		/* event number */
-	__u64 time;		/* in microseconds */
+	__u64 time;		/* in nanoseconds */
 	__u64 sector;		/* disk offset */
 	__u32 bytes;		/* transfer length */
 	__u32 action;		/* what happened */
Signature · 1 line
2.16.3
maintainer Applied
#1 lore raw
Quoted 7 lines · Souvik Banerjee

The __u64 time field of the blk_io_trace struct refers to the time in nanoseconds, not in microseconds. It is set in __blk_add_trace, which does the following:

    t->time = ktime_to_ns(ktime_get());

ktime_to_ns returns ktime_t in nanoseconds, not microseconds.

Thanks, applied. Back way back when it used to be in microseconds, iirc, I'm guessing the comment dates to back then.

Signature · 1 line
Jens Axboe