Messages in this thread | | | From | Jeff Moyer <> | Subject | Re: [PATCH] blktrace: Send BLK_TN_PROCESS events to all running traces | Date | Mon, 23 Sep 2013 09:02:08 -0400 |
| |
Jan Kara <jack@suse.cz> writes:
> Currently each task sends BLK_TN_PROCESS event to the first traced > device it interacts with after a new trace is started. When there are > several traced devices and the task accesses more devices, this logic > can result in BLK_TN_PROCESS being sent several times to some devices > while it is never sent to other devices. Thus blkparse doesn't display > command name when parsing some blktrace files. > > Fix the problem by sending BLK_TN_PROCESS event to all traced devices > when a task interacts with any of them. > > Signed-off-by: Jan Kara <jack@suse.cz>
[snip]
> @@ -229,16 +241,15 @@ static void __blk_add_trace(struct blk_trace *bt, sector_t sector, int bytes, > goto record_it; > } > > + if (unlikely(tsk->btrace_seq != blktrace_seq)) > + trace_note_tsk(tsk); > + > /* > * A word about the locking here - we disable interrupts to reserve > * some space in the relay per-cpu buffer, to prevent an irq > * from coming in and stepping on our toes. > */ > local_irq_save(flags); > - > - if (unlikely(tsk->btrace_seq != blktrace_seq)) > - trace_note_tsk(bt, tsk); > - > t = relay_reserve(bt->rchan, sizeof(*t) + pdu_len); > if (t) { > sequence = per_cpu_ptr(bt->sequence, cpu);
I don't think moving the call site was strictly necessary. That wouldn't really change anything, though. I also think that this simplistic approach is good enough.
Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
| |