mbox series

[00/10] Improve SCSI target logs

Message ID 20241129153056.6985-1-a.kovaleva@yadro.com
Headers show
Series Improve SCSI target logs | expand

Message

Anastasia Kovaleva Nov. 29, 2024, 3:30 p.m. UTC
This patch series address two main issues of the current logs in SCSI
target (discussed in [1]):

  1. Absence of a common prefix for the subsystem to make it possible to
     filter them out to a separate file.
  2. Absence of an I-T-L nexus in a log message to understand what is
     that log for.

Patches 2 - 6 of the series are automated. So, we also included fixes
[PATCH 04] of other style errors and warnings that checkpatch can fix.
We've been using these logs for almost an year and didn't encounter any
kind of problems.

Code style of all patches was made by git clang-format with these
additional parameters:

+AllowAllArgumentsOnNextLine: false
+ColumnLimit: 100
+PenaltyBreakOpenParenthesis: 12000
+PenaltyBreakBeforeFirstCallParameter: 12000
+PenaltyBreakString: 12000

In general, logs present in the following format:
  target <file_prefix>: General log Message
  target <file_prefix> (<iqn_initiator> -> <RTPI>): Session Log Message
  target <file_prefix> (<iqn_initiator> -> <RTPI>/<MappedLun>): Command Log Message
  target <file_prefix> <fabric_name>_tpg[<tpg_tag>](<tpg_rtpi>/<LUN>): Lun Log Message

Examples:
  target sbp: initiator already logged-in
  target core (iqn.2001-09.com.example:foobar-1 -> 1): ABORT_TASK: Sending TMR_TASK_DOES_NOT_EXIST for ref_tag: 2281488
  target core (iqn.2001-09.com.example:foobar-1 -> 1/99): Unknown PERSISTENT_RESERVE_OUT service action: 0x11
  target core iSCSI_tpg[1](1/99): Unable to extract alua_tg_pt_status

[1] - https://lore.kernel.org/target-devel/ZF0MiCRW8HWm8YYj@yadro.com/

Anastasia Kovaleva (10):
  target: core: Improve SCSI target logs
  target: Use new log wrappers
  target: Fix quoted strings splitting
  target: Fix some obvious style problems
  target: Add log prefix to all tcm files
  target: Remove old prefixes from log messages
  target: core: Extend CaW logging
  target: core: Use extended logs where possible
  target: Use __func__ in logs
  target: iscsi: Improve a log message

 drivers/target/iscsi/cxgbit/cxgbit_cm.c       | 191 +++---
 drivers/target/iscsi/cxgbit/cxgbit_ddp.c      |  19 +-
 drivers/target/iscsi/cxgbit/cxgbit_main.c     |  47 +-
 drivers/target/iscsi/cxgbit/cxgbit_target.c   | 115 ++--
 drivers/target/iscsi/iscsi_target.c           | 559 +++++++--------
 drivers/target/iscsi/iscsi_target_auth.c      | 123 ++--
 drivers/target/iscsi/iscsi_target_configfs.c  |  91 +--
 .../target/iscsi/iscsi_target_datain_values.c |  20 +-
 drivers/target/iscsi/iscsi_target_device.c    |   4 +-
 drivers/target/iscsi/iscsi_target_erl0.c      | 149 ++--
 drivers/target/iscsi/iscsi_target_erl1.c      | 158 ++---
 drivers/target/iscsi/iscsi_target_erl2.c      |  60 +-
 drivers/target/iscsi/iscsi_target_login.c     | 157 ++---
 drivers/target/iscsi/iscsi_target_nego.c      | 187 +++---
 .../target/iscsi/iscsi_target_nodeattrib.c    |  94 ++-
 .../target/iscsi/iscsi_target_parameters.c    | 354 ++++------
 .../target/iscsi/iscsi_target_seq_pdu_list.c  |  86 +--
 drivers/target/iscsi/iscsi_target_stat.c      |   2 +
 drivers/target/iscsi/iscsi_target_tmr.c       | 121 ++--
 drivers/target/iscsi/iscsi_target_tpg.c       | 172 +++--
 drivers/target/iscsi/iscsi_target_transport.c |   6 +-
 drivers/target/iscsi/iscsi_target_util.c      | 133 ++--
 drivers/target/loopback/tcm_loop.c            | 114 ++--
 drivers/target/sbp/sbp_target.c               | 156 +++--
 drivers/target/target_core_alua.c             | 192 +++---
 drivers/target/target_core_configfs.c         | 533 ++++++---------
 drivers/target/target_core_device.c           |  99 +--
 drivers/target/target_core_fabric_configfs.c  |  65 +-
 drivers/target/target_core_fabric_lib.c       |  27 +-
 drivers/target/target_core_file.c             | 126 ++--
 drivers/target/target_core_hba.c              |  15 +-
 drivers/target/target_core_iblock.c           |  96 ++-
 drivers/target/target_core_pr.c               | 635 ++++++++----------
 drivers/target/target_core_pscsi.c            | 160 ++---
 drivers/target/target_core_rd.c               |  87 ++-
 drivers/target/target_core_sbc.c              | 159 ++---
 drivers/target/target_core_spc.c              |  32 +-
 drivers/target/target_core_stat.c             |   4 +-
 drivers/target/target_core_tmr.c              |  57 +-
 drivers/target/target_core_tpg.c              |  81 +--
 drivers/target/target_core_transport.c        | 226 +++----
 drivers/target/target_core_ua.c               |  27 +-
 drivers/target/target_core_user.c             | 257 ++++---
 drivers/target/target_core_xcopy.c            | 228 +++----
 drivers/target/tcm_fc/tcm_fc.h                |   2 +-
 drivers/target/tcm_fc/tfc_cmd.c               |  47 +-
 drivers/target/tcm_fc/tfc_conf.c              |  18 +-
 drivers/target/tcm_fc/tfc_io.c                |  22 +-
 drivers/target/tcm_fc/tfc_sess.c              |   7 +-
 drivers/target/tcm_remote/tcm_remote.c        |  41 +-
 include/target/target_core_base.h             |  92 +++
 51 files changed, 2847 insertions(+), 3606 deletions(-)