From patchwork Mon Jan 14 22:52:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 10763587 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3CC891580 for ; Mon, 14 Jan 2019 23:32:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2DE7A2B25D for ; Mon, 14 Jan 2019 23:32:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 21FA92C324; Mon, 14 Jan 2019 23:32:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BBE5D2B25D for ; Mon, 14 Jan 2019 23:32:14 +0000 (UTC) Received: from localhost ([127.0.0.1]:39483 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gjBiH-00034z-S3 for patchwork-qemu-devel@patchwork.kernel.org; Mon, 14 Jan 2019 18:32:13 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35376) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gjB7Q-0004xP-WB for qemu-devel@nongnu.org; Mon, 14 Jan 2019 17:54:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gjB7Q-0001pd-6S for qemu-devel@nongnu.org; Mon, 14 Jan 2019 17:54:08 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:40716) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gjB7P-0001eJ-Ro for qemu-devel@nongnu.org; Mon, 14 Jan 2019 17:54:08 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 6D1481BD6; Mon, 14 Jan 2019 23:53:49 +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 zYbtEXwGuZlK; Mon, 14 Jan 2019 23:53:48 +0100 (CET) Received: from function.home (lfbn-1-11161-124.w86-213.abo.wanadoo.fr [86.213.235.124]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 5B0771C02; Mon, 14 Jan 2019 23:53:13 +0100 (CET) Received: from samy by function.home with local (Exim 4.92-RC4) (envelope-from ) id 1gjB6V-0005gA-86; Mon, 14 Jan 2019 23:53:11 +0100 From: Samuel Thibault To: qemu-devel@nongnu.org Date: Mon, 14 Jan 2019 23:52:58 +0100 Message-Id: <20190114225306.21569-58-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190114225306.21569-1-samuel.thibault@ens-lyon.org> References: <20190114225306.21569-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 185.233.100.1 Subject: [Qemu-devel] [PULL 57/65] slirp: remove remaining DEBUG blocks 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: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Samuel Thibault , stefanha@redhat.com, jan.kiszka@siemens.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Marc-André Lureau Instead, rely on slirp_debug flags, or compile unconditionally (the substraction in cksum is unlikely to affect any benchmark result). Signed-off-by: Marc-André Lureau Signed-off-by: Samuel Thibault --- slirp/cksum.c | 4 ---- slirp/ip_icmp.c | 5 ++--- slirp/slirp.c | 5 +---- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/slirp/cksum.c b/slirp/cksum.c index b9466485b5..0a988b845d 100644 --- a/slirp/cksum.c +++ b/slirp/cksum.c @@ -70,9 +70,7 @@ int cksum(struct mbuf *m, int len) if (len < mlen) mlen = len; -#ifdef DEBUG len -= mlen; -#endif /* * Force to even boundary. */ @@ -122,12 +120,10 @@ int cksum(struct mbuf *m, int len) s_util.c[0] = *(uint8_t *)w; cont: -#ifdef DEBUG if (len) { DEBUG_ERROR("cksum: out of data\n"); DEBUG_ERROR(" len = %d\n", len); } -#endif if (mlen == -1) { /* The last mbuf has odd # of bytes. Follow the standard (the odd byte may be shifted left by 8 bits diff --git a/slirp/ip_icmp.c b/slirp/ip_icmp.c index 6c7e375ff8..cd2faeacb6 100644 --- a/slirp/ip_icmp.c +++ b/slirp/ip_icmp.c @@ -257,13 +257,12 @@ icmp_send_error(struct mbuf *msrc, u_char type, u_char code, int minsize, /* check msrc */ if(!msrc) goto end_error; ip = mtod(msrc, struct ip *); -#ifdef DEBUG - { char bufa[20], bufb[20]; + if (slirp_debug & DBG_MISC) { + char bufa[20], bufb[20]; strcpy(bufa, inet_ntoa(ip->ip_src)); strcpy(bufb, inet_ntoa(ip->ip_dst)); DEBUG_MISC(" %.16s to %.16s\n", bufa, bufb); } -#endif if(ip->ip_off & IP_OFFMASK) goto end_error; /* Only reply to fragment 0 */ /* Do not reply to source-only IPs */ diff --git a/slirp/slirp.c b/slirp/slirp.c index 0b70cb9fb6..6c732cd15b 100644 --- a/slirp/slirp.c +++ b/slirp/slirp.c @@ -195,9 +195,7 @@ static int get_dns_addr_resolv_conf(int af, void *pdns_addr, void *cached_addr, if (++found > 3) { DEBUG_MISC("(more)"); break; - } -#ifdef DEBUG - else { + } else if (slirp_debug & DBG_MISC) { char s[INET6_ADDRSTRLEN]; const char *res = inet_ntop(af, tmp_addr, s, sizeof(s)); if (!res) { @@ -205,7 +203,6 @@ static int get_dns_addr_resolv_conf(int af, void *pdns_addr, void *cached_addr, } DEBUG_MISC("%s", res); } -#endif } } fclose(f);