From patchwork Tue Oct 10 00:55:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 115310 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp3166783qgn; Mon, 9 Oct 2017 17:58:40 -0700 (PDT) X-Received: by 10.200.20.6 with SMTP id k6mr15973038qtj.189.1507597120767; Mon, 09 Oct 2017 17:58:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507597120; cv=none; d=google.com; s=arc-20160816; b=zRwRpvREkT6goZjIAtZcl6P3gEQmxIMjthr07fwo9DCTBUbz8aJxJCl2Gos3jxMHMo 8CctP4Xc8DJkM3mUp3XjlfRYEXNf5BcQLXfqFuUIgZ/Lwmu+hfk91z1gr685wtb9ND5S N5ZCjAsqURQW6WwNyef8w+4l6Imaj5o6umk2554KVOG/oy0pEKaugBN3Au+BQxJncqr2 BU6QwisCwTVdi4bMw8P0TE0zhr4t4U0Ru55JjQmkzFixkkW54l16DnpImeC4oikVdN6v b9CjF6BHObm30wvV77vI2ojojuLFzQQPpc8ok34C2nD5FlYhoHpcFEn4qv4zsXxP/dnR Gnzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=LAawtX8GSa0/i2pqKXJe98VeX6zP0igCbj0ZmpFAsd0=; b=yvMfURLQ8D1R6xycbfl0KWqNEtU0ZLzUGogotbuuqgQOS7bSSkztRpIJc6S4TQYiU/ KAwHEVwcb4bb0mEvfQx9xsMH95oQHU6H0l1dl0szGN+Okc16Af0cZCITcHGlrXaL9FQ+ ore3s3lFTItoiWZblLLtp3qN7i74AUJx9BwhgLXLr+tuYn1bxLkpshvhTNxrZMTVZReT 6qVIMAe06QD4CLSGZ8xoL/Lx7m93/ODrvhYmKP1/8FOqfqEmvx8fxNiCZXHMq0f02t+i +ZFbaKorYtqkNU4AaMM/Qpdu2BFjqUh7NQHxI8FtOjvDcm9KdPz1RyGuxNKPzYnQtr6H 80dQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=c1NXz+LX; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 54si426727qto.365.2017.10.09.17.58.40 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 09 Oct 2017 17:58:40 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=c1NXz+LX; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:60491 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e1isY-0003fS-NK for patch@linaro.org; Mon, 09 Oct 2017 20:58:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60511) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e1iqJ-0002K0-Vj for qemu-devel@nongnu.org; Mon, 09 Oct 2017 20:56:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e1iqJ-0004Sq-10 for qemu-devel@nongnu.org; Mon, 09 Oct 2017 20:56:20 -0400 Received: from mail-pf0-x234.google.com ([2607:f8b0:400e:c00::234]:53904) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e1iqI-0004SJ-S8 for qemu-devel@nongnu.org; Mon, 09 Oct 2017 20:56:18 -0400 Received: by mail-pf0-x234.google.com with SMTP id n73so8794153pfg.10 for ; Mon, 09 Oct 2017 17:56:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LAawtX8GSa0/i2pqKXJe98VeX6zP0igCbj0ZmpFAsd0=; b=c1NXz+LXThyxwUZ8CIutb3UHppOu4bJeRbkF7zOPJSh4qVbmdJqtRf+nwemJEhv81q mWcs4qV5LdPIpSrGYe4prOo2KHKdrJ+68ZrsjLPTti/KPp1EMQEEgmDiR1nSo8FAMh5Q c1DalxgtKm2WcTkDmPzI7z1rGvoue0qB81aLY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LAawtX8GSa0/i2pqKXJe98VeX6zP0igCbj0ZmpFAsd0=; b=hVbTJC38bm29GKinC9e6EFFpr/47r/2sxP4bSRkwJm0VvQOaK2kHRYnjN26sUBc/2a npJEJJQbXHlHJtxGYgHcUVRsA8yufrGGHFecEvv40NeOns31ebG3eyn/ByY3onncyF1j 6mo2mxft/kM3QspRDsEGgJd4q27Yr261THKZYDpiJ7RMry89uV/x44Rrn+aElNQqBMHr vzDWYgz0FfiasBx91vNdPHeUntFeErDN5Vifa3NO4oBoes01QGIaqk1Py5j9vcv9vu4U 5HbCayHOA/gVELS4Dt+9Mt/AolUm8e7c8+fj0inM4FjTaQmLVV5Ry/3UOacA1mnSd1I6 Yxog== X-Gm-Message-State: AMCzsaX8qCRVBKrdn7MSudPsfxppvpZ1n8YU6qe0pxQ34E9cfdy0G+F2 KA9Kn8na78B1dYkqc7RQzBmGHGmEQOM= X-Google-Smtp-Source: AOwi7QBFH1zN+t+8EQgBZ6GLSTHGIvzu0ip73JBzkIZ1AF4KfSVa99c+Ydt5pLJjDONV84bpny8vjg== X-Received: by 10.99.176.79 with SMTP id z15mr10461435pgo.230.1507596977551; Mon, 09 Oct 2017 17:56:17 -0700 (PDT) Received: from bigtime.twiddle.net (97-126-104-76.tukw.qwest.net. [97.126.104.76]) by smtp.gmail.com with ESMTPSA id n19sm17121368pfj.52.2017.10.09.17.56.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Oct 2017 17:56:16 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 9 Oct 2017 17:55:48 -0700 Message-Id: <20171010005600.28735-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171010005600.28735-1-richard.henderson@linaro.org> References: <20171010005600.28735-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::234 Subject: [Qemu-devel] [PULL 11/23] translate-all: define and use DEBUG_TB_FLUSH_GATE 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: peter.maydell@linaro.org, "Emilio G. Cota" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" This gets rid of some ifdef checks while ensuring that the debug code is compiled, which prevents bit rot. Suggested-by: Alex Bennée Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota Signed-off-by: Richard Henderson --- accel/tcg/translate-all.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) -- 2.13.6 diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index ed65d68709..799b027e79 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -65,6 +65,12 @@ /* make various TB consistency checks */ /* #define DEBUG_TB_CHECK */ +#ifdef DEBUG_TB_FLUSH +#define DEBUG_TB_FLUSH_GATE 1 +#else +#define DEBUG_TB_FLUSH_GATE 0 +#endif + #if !defined(CONFIG_USER_ONLY) /* TB consistency checks only implemented for usermode emulation. */ #undef DEBUG_TB_CHECK @@ -899,13 +905,13 @@ static void do_tb_flush(CPUState *cpu, run_on_cpu_data tb_flush_count) goto done; } -#if defined(DEBUG_TB_FLUSH) - printf("qemu: flush code_size=%ld nb_tbs=%d avg_tb_size=%ld\n", - (unsigned long)(tcg_ctx.code_gen_ptr - tcg_ctx.code_gen_buffer), - tcg_ctx.tb_ctx.nb_tbs, tcg_ctx.tb_ctx.nb_tbs > 0 ? - ((unsigned long)(tcg_ctx.code_gen_ptr - tcg_ctx.code_gen_buffer)) / - tcg_ctx.tb_ctx.nb_tbs : 0); -#endif + if (DEBUG_TB_FLUSH_GATE) { + printf("qemu: flush code_size=%td nb_tbs=%d avg_tb_size=%td\n", + tcg_ctx.code_gen_ptr - tcg_ctx.code_gen_buffer, + tcg_ctx.tb_ctx.nb_tbs, tcg_ctx.tb_ctx.nb_tbs > 0 ? + (tcg_ctx.code_gen_ptr - tcg_ctx.code_gen_buffer) / + tcg_ctx.tb_ctx.nb_tbs : 0); + } if ((unsigned long)(tcg_ctx.code_gen_ptr - tcg_ctx.code_gen_buffer) > tcg_ctx.code_gen_buffer_size) { cpu_abort(cpu, "Internal error: code buffer overflow\n");