scsi: target: core: Add CONTROL field for trace events
authorRoman Bolshakov <r.bolshakov@yadro.com>
Tue, 29 Sep 2020 12:59:57 +0000 (15:59 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Oct 2020 08:03:09 +0000 (09:03 +0100)
commita8e132b4eb5a496d0cc1956cd1fe9ca252413cb1
tree1349850822e7cd7300f7ee2a5c060760ea45cedb
parent63a0d643073dad584dc20ce28505d316003e79c6
scsi: target: core: Add CONTROL field for trace events

[ Upstream commit 7010645ba7256992818b518163f46bd4cdf8002a ]

trace-cmd report doesn't show events from target subsystem because
scsi_command_size() leaks through event format string:

  [target:target_sequencer_start] function scsi_command_size not defined
  [target:target_cmd_complete] function scsi_command_size not defined

Addition of scsi_command_size() to plugin_scsi.c in trace-cmd doesn't
help because an expression is used inside TP_printk(). trace-cmd event
parser doesn't understand minus sign inside [ ]:

  Error: expected ']' but read '-'

Rather than duplicating kernel code in plugin_scsi.c, provide a dedicated
field for CONTROL byte.

Link: https://lore.kernel.org/r/20200929125957.83069-1-r.bolshakov@yadro.com
Reviewed-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/scsi/scsi_common.h
include/trace/events/target.h