From patchwork Wed Nov 21 22:42:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 1001464 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 430dC24q7Pz9s1x for ; Thu, 22 Nov 2018 09:53:02 +1100 (AEDT) Received: from localhost ([::1]:42843 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPbMh-0002su-Lr for incoming@patchwork.ozlabs.org; Wed, 21 Nov 2018 17:52:59 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43726) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPbCs-0002og-0A for qemu-devel@nongnu.org; Wed, 21 Nov 2018 17:42:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPbCm-0004pE-RL for qemu-devel@nongnu.org; Wed, 21 Nov 2018 17:42:49 -0500 Received: from hera.aquilenet.fr ([2a0c:e300::1]:33032) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gPbCl-0004MU-1j for qemu-devel@nongnu.org; Wed, 21 Nov 2018 17:42:44 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id DD07D3821; Wed, 21 Nov 2018 23:42:31 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dILZxCJkr_RW; Wed, 21 Nov 2018 23:42:31 +0100 (CET) Received: from function (94.222.26.109.rev.sfr.net [109.26.222.94]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 042B3381D; Wed, 21 Nov 2018 23:42:30 +0100 (CET) Received: from samy by function with local (Exim 4.91) (envelope-from ) id 1gPbCQ-0002la-Ru; Wed, 21 Nov 2018 23:42:22 +0100 From: Samuel Thibault To: qemu-devel@nongnu.org Date: Wed, 21 Nov 2018 23:42:20 +0100 Message-Id: <20181121224220.10595-1-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a0c:e300::1 Subject: [Qemu-devel] [PATCH] slirp: Mark debugging calls as unlikely X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lizhijian@cn.fujitsu.com, jan.kiszka@siemens.com, jasowang@redhat.com, marcandre.lureau@redhat.com, zhangckid@gmail.com, Samuel Thibault Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" to get them out of the hot path. Signed-off-by: Samuel Thibault Reviewed-by: Marc-André Lureau --- 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); \ } \