Skip to contentSkip to conversation

Logging of all scsi commands to a certain target?

DISCUSSION Hans de Goede 3 participants 3 messages Aug 23, 2014 – Aug 24, 2014 SCSI

lore
Share & tools
lore
#0 lore raw

Hi,

Now that the UAS driver is no longer marked as CONFIG_BROKEN, I'm getting quite a few bug reports about issues with UAS drives.

Some of these seem to be related to the scsi core and/or the sd driver sending a command the device does not like.

As such I'm wondering if there us a way to get the kernel to log each scsi command ? Or at least is there a helper function to log scsi commands which I can add to the uas driver (under a verbose option) to allow this ?

Regards,

Hans

#1 lore raw
Quoted 5 lines · Hans de Goede

Hi,

Now that the UAS driver is no longer marked as CONFIG_BROKEN, I'm getting quite a few bug reports about issues with UAS drives.

Quoted 7 lines

Some of these seem to be related to the scsi core and/or the sd driver sending a command the device does not like.

As such I'm wondering if there us a way to get the kernel to log each scsi command ? Or at least is there a helper function to log scsi commands which I can add to the uas driver (under a verbose option) to allow this ?

Look for uses of this exported function:
void scsi_print_command(struct scsi_cmnd *cmd)

#2 lore raw
In reply to Hans de Goede
Quoted 5 lines · Hans de Goede

Hi,

Now that the UAS driver is no longer marked as CONFIG_BROKEN, I'm getting quite a few bug reports about issues with UAS drives.

Quoted 7 lines

Some of these seem to be related to the scsi core and/or the sd driver sending a command the device does not like.

As such I'm wondering if there us a way to get the kernel to log each scsi command ? Or at least is there a helper function to log scsi commands which I can add to the uas driver (under a verbose option) to allow this ?

Enable the scsi_dispatch_cmd_start tracepoint using trace-cmd or debugfs, and filter using host_no/channel/id/lun for your specific device. See Documentation/trace/events.txt for details on setting up filters.