[stgt] [PATCH] Moved check for is_debug from log_debug() function to dprintf() macro.
FUJITA Tomonori
fujita.tomonori at lab.ntt.co.jp
Thu Jun 3 04:17:29 CEST 2010
On Wed, 02 Jun 2010 20:12:57 +0300
Alexander Nezhinsky <alexandern at Voltaire.COM> wrote:
> To minimize the overhead of debug printouts during non-debug runs,
> the check for "is_debug" is moved from log_debug() function
> to dprintf() macro.
>
> Now log_debug is called only if "is_debug" is set.
> This spares a function call, parameter passing and the costs of
> complex arguments expanding and evaluation.
> To minimize the potential cost of log_debug() even more,
> the check for is_debug is put under unlikely() statement.
>
> Signed-off-by: Alexander Nezhinsky <alexandern at voltaire.com>
> ---
> usr/log.c | 5 +----
> usr/log.h | 6 +++++-
> usr/tgtd.h | 1 +
> 3 files changed, 7 insertions(+), 5 deletions(-)
Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
More information about the stgt
mailing list