qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] slirp: Mark debugging calls as unlikely


From: Marc-André Lureau
Subject: Re: [Qemu-devel] [PATCH] slirp: Mark debugging calls as unlikely
Date: Thu, 22 Nov 2018 11:13:51 +0400

Hi

On Thu, Nov 22, 2018 at 2:54 AM Samuel Thibault
<address@hidden> wrote:
>
> to get them out of the hot path.
>
> Signed-off-by: Samuel Thibault <address@hidden>
> ---
>  slirp/debug.h | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/slirp/debug.h b/slirp/debug.h
> index ff920f0b87..ad4e07aa01 100644
> --- a/slirp/debug.h
> +++ b/slirp/debug.h
> @@ -17,7 +17,7 @@
>  extern int slirp_debug;
>
>  #define DEBUG_CALL(fmt, ...) do {               \
> -    if (slirp_debug & DBG_CALL) {               \
> +    if (unlikely(slirp_debug & DBG_CALL)) {     \
>          fprintf(dfd, fmt, ##__VA_ARGS__);       \
>          fprintf(dfd, "...\n");                  \
>          fflush(dfd);                            \
> @@ -25,7 +25,7 @@ extern int slirp_debug;
>  } while (0)
>
>  #define DEBUG_ARG(fmt, ...) do {                \
> -    if (slirp_debug & DBG_CALL) {               \
> +    if (unlikely(slirp_debug & DBG_CALL)) {     \
>          fputc(' ', dfd);                        \
>          fprintf(dfd, fmt, ##__VA_ARGS__);       \
>          fputc('\n', dfd);                       \
> @@ -36,14 +36,14 @@ extern int slirp_debug;
>  #define DEBUG_ARGS(fmt, ...) DEBUG_ARG(fmt, ##__VA_ARGS__)
>
>  #define DEBUG_MISC(fmt, ...) do {               \
> -    if (slirp_debug & DBG_MISC) {               \
> +    if (unlikely(slirp_debug & DBG_MISC)) {     \
>          fprintf(dfd, fmt, ##__VA_ARGS__);       \
>          fflush(dfd);                            \
>      }                                           \
>  } while (0)
>
>  #define DEBUG_ERROR(fmt, ...) do {              \
> -    if (slirp_debug & DBG_ERROR) {              \
> +    if (unlikely(slirp_debug & DBG_ERROR)) {    \
>          fprintf(dfd, fmt, ##__VA_ARGS__);       \
>          fflush(dfd);                            \
>      }                                           \
> --
> 2.19.1
>
>

With s/unlikely/G_UNLIKELY:
Reviewed-by: Marc-André Lureau <address@hidden>


-- 
Marc-André Lureau



reply via email to

[Prev in Thread] Current Thread [Next in Thread]