Re: [PATCH v3 5/6] blktrace: break out of blktrace setup on concurrent calls

From: Luis Chamberlain
Date: Fri May 01 2020 - 11:50:28 EST


On Fri, May 1, 2020 at 9:40 AM Luis Chamberlain <mcgrof@xxxxxxxxxx> wrote:
>
> On Fri, May 01, 2020 at 08:34:23AM -0700, Christoph Hellwig wrote:
> > On Fri, May 01, 2020 at 03:06:26PM +0000, Luis Chamberlain wrote:
> > > > You have access to a block device here, please use dev_warn() instead
> > > > here for that, that makes it obvious as to what device a "concurrent
> > > > blktrace" was attempted for.
> > >
> > > The block device may be empty, one example is for scsi-generic, but I'll
> > > use buts->name.
> >
> > Is blktrace on /dev/sg something we intentionally support, or just by
> > some accident of history? Given all the pains it causes I'd be tempted
> > to just remove the support and see if anyone screams.
>
> From what I can tell I think it was a historic and brutal mistake. I am
> more than happy to remove it.

I take that back:

commit 6da127ad0918f93ea93678dad62ce15ffed18797
Author: Christof Schmitt <christof.schmitt@xxxxxxxxxx>
Date: Fri Jan 11 10:09:43 2008 +0100

blktrace: Add blktrace ioctls to SCSI generic devices

Since the SCSI layer uses the request queues from the block layer,
blktrace can
also be used to trace the requests to all SCSI devices (like SCSI
tape drives),
not only disks. The only missing part is the ioctl interface to
start and stop
tracing.

This patch adds the SETUP, START, STOP and TEARDOWN ioctls from
blktrace to the
sg device files. With this change, blktrace can be used for SCSI
devices like
for disks, e.g.: blktrace -d /dev/sg1 -o - | blkparse -i -

Signed-off-by: Christof Schmitt <christof.schmitt@xxxxxxxxxx>
Signed-off-by: Jens Axboe <jens.axboe@xxxxxxxxxx>

Christof, any thoughts on removing this support?

Luis