From nobody Thu Nov 6 18:12:53 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 15428408653282.5260209867624326; Wed, 21 Nov 2018 14:54:25 -0800 (PST) Received: from localhost ([::1]:42850 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPbO0-0004op-FH for importer@patchew.org; Wed, 21 Nov 2018 17:54:20 -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) 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 X-Virus-Scanned: Debian amavisd-new at aquilenet.fr 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 Content-Transfer-Encoding: quoted-printable 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" to get them out of the hot path. Signed-off-by: Samuel Thibault Reviewed-by: Marc-Andr=C3=A9 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; =20 #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) =20 #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__) =20 #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) =20 #define DEBUG_ERROR(fmt, ...) do { \ - if (slirp_debug & DBG_ERROR) { \ + if (unlikely(slirp_debug & DBG_ERROR)) { \ fprintf(dfd, fmt, ##__VA_ARGS__); \ fflush(dfd); \ } \ --=20 2.19.1