target: Add tracepoints for SCSI commands being processed
authorRoland Dreier <roland@purestorage.com>
Thu, 27 Jun 2013 00:36:17 +0000 (17:36 -0700)
committerNicholas Bellinger <nab@linux-iscsi.org>
Mon, 8 Jul 2013 01:36:44 +0000 (18:36 -0700)
commite5c0d6ad557b32f431a70a4efba820430f6ff88b
tree87f57521a4925adf0a5861ba7964159db7ac5066
parentb2cb96494d83b894a43ba8b9023eead8ff50684b
target: Add tracepoints for SCSI commands being processed

This patch adds tracepoints to the target code for commands being
received and being completed, which is quite useful for debugging
interactions with initiators. For example, one can do something like the
following to watch commands that are completing unsuccessfully:

    # echo 'scsi_status!=0' > /sys/kernel/debug/tracing/events/target/target_cmd_complete/filter
    # echo 1 > /sys/kernel/debug/tracing/events/target/target_cmd_complete/enable

        <run command that fails>

    # cat /sys/kernel/debug/tracing/trace
         iscsi_trx-0-1902  [003] ...1 990185.810385: target_cmd_complete: iqn.1993-08.org.debian:01:e51ede6aacfd <- LUN 001 status CHECK CONDITION (sense len 18 / 70 00 05 00 00 00 00 0a 00 00 00 00 20 00 00 00 00 00)  0x95 data_length    512  CDB 95 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  (TA:SIMPLE C:00)

(v2: Drop undefined COMPARE_AND_WRITE)

Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_transport.c
include/trace/events/target.h [new file with mode: 0644]