lkml.org 
[lkml]   [2013]   [Sep]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] blktrace: Send BLK_TN_PROCESS events to all running traces
Date
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>


\
 
 \ /
  Last update: 2013-09-23 15:21    [W:0.069 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site