Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

tcm_fc: Avoid debug overhead when not debugging

Stop doing a pile of work related to debugging messages when
the ft_debug_logging flag is not set. Use unlikely to add the
check in a way that the check can be inlined without inlining the
whole thing.

Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>

authored by

Mark Rustad and committed by
Nicholas Bellinger
1fa8f450 101998f6

+8 -1
+1
drivers/target/tcm_fc/tcm_fc.h
··· 131 131 extern struct mutex ft_lport_lock; 132 132 extern struct fc4_prov ft_prov; 133 133 extern struct target_fabric_configfs *ft_configfs; 134 + extern unsigned int ft_debug_logging; 134 135 135 136 /* 136 137 * Fabric methods.
+7 -1
drivers/target/tcm_fc/tfc_cmd.c
··· 48 48 /* 49 49 * Dump cmd state for debugging. 50 50 */ 51 - void ft_dump_cmd(struct ft_cmd *cmd, const char *caller) 51 + static void _ft_dump_cmd(struct ft_cmd *cmd, const char *caller) 52 52 { 53 53 struct fc_exch *ep; 54 54 struct fc_seq *sp; ··· 78 78 caller, cmd, ep->sid, ep->did, ep->oxid, ep->rxid, 79 79 sp->id, ep->esb_stat); 80 80 } 81 + } 82 + 83 + void ft_dump_cmd(struct ft_cmd *cmd, const char *caller) 84 + { 85 + if (unlikely(ft_debug_logging)) 86 + _ft_dump_cmd(cmd, caller); 81 87 } 82 88 83 89 static void ft_free_cmd(struct ft_cmd *cmd)