diff options
author | Mark Rustad <mark.d.rustad@intel.com> | 2012-08-01 17:51:53 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2012-08-16 20:33:46 -0400 |
commit | 1fa8f4504130adc34a071a29170f570102136835 (patch) | |
tree | cec8b478dcb3ac66bea69347e0b7cf263d67c9d3 /drivers/target | |
parent | 101998f6fcd680ed12d85633b81504feb1cb0667 (diff) |
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>
Diffstat (limited to 'drivers/target')
-rw-r--r-- | drivers/target/tcm_fc/tcm_fc.h | 1 | ||||
-rw-r--r-- | drivers/target/tcm_fc/tfc_cmd.c | 8 |
2 files changed, 8 insertions, 1 deletions
diff --git a/drivers/target/tcm_fc/tcm_fc.h b/drivers/target/tcm_fc/tcm_fc.h index c5eb3c33c3db..eea69358ced3 100644 --- a/drivers/target/tcm_fc/tcm_fc.h +++ b/drivers/target/tcm_fc/tcm_fc.h | |||
@@ -131,6 +131,7 @@ extern struct list_head ft_lport_list; | |||
131 | extern struct mutex ft_lport_lock; | 131 | extern struct mutex ft_lport_lock; |
132 | extern struct fc4_prov ft_prov; | 132 | extern struct fc4_prov ft_prov; |
133 | extern struct target_fabric_configfs *ft_configfs; | 133 | extern struct target_fabric_configfs *ft_configfs; |
134 | extern unsigned int ft_debug_logging; | ||
134 | 135 | ||
135 | /* | 136 | /* |
136 | * Fabric methods. | 137 | * Fabric methods. |
diff --git a/drivers/target/tcm_fc/tfc_cmd.c b/drivers/target/tcm_fc/tfc_cmd.c index b9cb5006177e..823e6922249d 100644 --- a/drivers/target/tcm_fc/tfc_cmd.c +++ b/drivers/target/tcm_fc/tfc_cmd.c | |||
@@ -48,7 +48,7 @@ | |||
48 | /* | 48 | /* |
49 | * Dump cmd state for debugging. | 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 | struct fc_exch *ep; | 53 | struct fc_exch *ep; |
54 | struct fc_seq *sp; | 54 | struct fc_seq *sp; |
@@ -80,6 +80,12 @@ void ft_dump_cmd(struct ft_cmd *cmd, const char *caller) | |||
80 | } | 80 | } |
81 | } | 81 | } |
82 | 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); | ||
87 | } | ||
88 | |||
83 | static void ft_free_cmd(struct ft_cmd *cmd) | 89 | static void ft_free_cmd(struct ft_cmd *cmd) |
84 | { | 90 | { |
85 | struct fc_frame *fp; | 91 | struct fc_frame *fp; |