scsi: qla2xxx: Format log strings only if needed
Subsystems (4)
PATCH 1/1 scsi: qla2xxx: Format log strings only if needed
Commit 598a90f2002c4 ("scsi: qla2xxx: add ring buffer for tracing debug logs") introduced unconditional log string formatting to ql_dbg() even if ql_dbg_log event is disabled. It harms performance because some strings are formatted in fastpath and/or interrupt context.
Cc Rajan Shanmugavelu <[email protected]>
Fixes 598a90f2002c4 ("scsi: qla2xxx: add ring buffer for tracing debug logs")
Signed-off-by Roman Bolshakov <[email protected]>
--- drivers/scsi/qla2xxx/qla_dbg.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/scsi/qla2xxx/qla_dbg.c +3 -0
@@ -2491,6 +2491,9 @@ ql_dbg(uint level, scsi_qla_host_t *vha, uint id, const char *fmt, ...)struct va_format vaf;char pbuf[64 ]; +if (!ql_mask_match (level) && !trace_ql_dbg_log_enabled ()) +return ; +va_start (va, fmt); vaf.fmt = fmt;
Signature · 1 line
2.33.1
Martin K. Petersen
AppliedQuoted 6 lines · Roman Bolshakov
Commit
598a90f2002c4("scsi: qla2xxx: add ring buffer for tracing debug logs") introduced unconditional log string formatting toql_dbg()even ifql_dbg_logevent is disabled. It harms performance because some strings are formatted in fastpath and/or interrupt context.
Applied to 5.16/scsi-fixes, thanks!
[1/1] scsi: qla2xxx: Format log strings only if needed
https://git.kernel.org/mkp/scsi/c/69002c8ce914
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering