Skip to content

Commit 69002c8

Browse files
Roman Bolshakovmartinkpetersen
authored andcommitted
scsi: qla2xxx: Format log strings only if needed
Commit 598a90f ("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. Link: https://lore.kernel.org/r/[email protected] Fixes: 598a90f ("scsi: qla2xxx: add ring buffer for tracing debug logs") Cc: Rajan Shanmugavelu <[email protected]> Cc: [email protected] Signed-off-by: Roman Bolshakov <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 7db0e0c commit 69002c8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/scsi/qla2xxx/qla_dbg.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2491,6 +2491,9 @@ ql_dbg(uint level, scsi_qla_host_t *vha, uint id, const char *fmt, ...)
24912491
struct va_format vaf;
24922492
char pbuf[64];
24932493

2494+
if (!ql_mask_match(level) && !trace_ql_dbg_log_enabled())
2495+
return;
2496+
24942497
va_start(va, fmt);
24952498

24962499
vaf.fmt = fmt;

0 commit comments

Comments
 (0)