X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=blktrace.c;h=111619c6c47301bbf1208895c6315ed3497c22f8;hp=b7071808ccec0b9aec5a49fa85460ad823a963be;hb=cd991b9e36b18903f1564a4bfafdc83a9f165219;hpb=4aae5155980cd5e1cfc8303cd30653e1238f4856 diff --git a/blktrace.c b/blktrace.c index b7071808..111619c6 100644 --- a/blktrace.c +++ b/blktrace.c @@ -204,22 +204,16 @@ static void store_ipo(struct thread_data *td, unsigned long long offset, list_add_tail(&ipo->list, &td->io_log_list); } -/* - * We only care for queue traces, most of the others are side effects - * due to internal workings of the block layer. - */ -static void handle_trace(struct thread_data *td, struct blk_io_trace *t, - unsigned long long ttime, unsigned long *ios, - unsigned int *bs) +static void handle_trace_notify(struct thread_data *td, struct blk_io_trace *t) { - int rw; + printf("got notify: %x, %d\n", t->action, t->pid); +} - if ((t->action & 0xffff) != __BLK_TA_QUEUE) - return; - if (t->action & BLK_TC_ACT(BLK_TC_PC)) - return; - if (t->action & BLK_TC_ACT(BLK_TC_NOTIFY)) - return; +static void handle_trace_fs(struct thread_data *td, struct blk_io_trace *t, + unsigned long long ttime, unsigned long *ios, + unsigned int *bs) +{ + int rw; trace_add_file(td, t->device); @@ -233,6 +227,25 @@ static void handle_trace(struct thread_data *td, struct blk_io_trace *t, store_ipo(td, t->sector, t->bytes, rw, ttime); } +/* + * We only care for queue traces, most of the others are side effects + * due to internal workings of the block layer. + */ +static void handle_trace(struct thread_data *td, struct blk_io_trace *t, + unsigned long long ttime, unsigned long *ios, + unsigned int *bs) +{ + if ((t->action & 0xffff) != __BLK_TA_QUEUE) + return; + if (t->action & BLK_TC_ACT(BLK_TC_PC)) + return; + + if (t->action & BLK_TC_ACT(BLK_TC_NOTIFY)) + handle_trace_notify(td, t); + else + handle_trace_fs(td, t, ttime, ios, bs); +} + /* * Load a blktrace file by reading all the blk_io_trace entries, and storing * them as io_pieces like the fio text version would do.