mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeff Moyer <jmoyer@redhat.com>
To: Jan Kara <jack@suse.cz>
Cc: Jens Axboe <axboe@kernel.dk>, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] blktrace: Send BLK_TN_PROCESS events to all running traces
Date: Mon, 23 Sep 2013 09:02:08 -0400	[thread overview]
Message-ID: <x4938ovzo6n.fsf@segfault.boston.devel.redhat.com> (raw)
In-Reply-To: <1379449831-6710-1-git-send-email-jack@suse.cz> (Jan Kara's message of "Tue, 17 Sep 2013 22:30:31 +0200")

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>

      parent reply	other threads:[~2013-09-23 13:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-17 20:30 Jan Kara
2013-09-23 11:37 ` Jan Kara
2013-10-15  9:40   ` Jan Kara
2013-10-15 14:18     ` Jeff Moyer
2013-10-15 15:17     ` Jens Axboe
2013-09-23 13:02 ` Jeff Moyer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=x4938ovzo6n.fsf@segfault.boston.devel.redhat.com \
    --to=jmoyer@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=jack@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®