From patchwork Tue Oct 10 19:29:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 115456 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp4119254qgn; Tue, 10 Oct 2017 12:36:26 -0700 (PDT) X-Received: by 10.200.26.237 with SMTP id h42mr9499307qtk.22.1507664186949; Tue, 10 Oct 2017 12:36:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507664186; cv=none; d=google.com; s=arc-20160816; b=zKPwAifkuMChNMWHHlpjp1c7awBCwEA6bvk/rxg/2KKlxRPAEOZn/rD4FkAxD7vLyg kQLMmNHdZ/TnLALl5rhs5XRb5oCsyczPQODHAmZws64XbKjyPGjfe/OIgl73XAgeDhMu 6MQeFV+Rp80TYUEBGkuDNNzoRTUbRDqKyNx8vXxmz1CVwSmTl5ls9xQB8FfJBBJttyQF tRjvTanFCyFuGbPjRbswfL7dtv9EiCv6xmP4imqlKtGpvB+dUD8mtZOcw8/L2Gh1Ci2N mKb/wCRP8l90uyQat/g7qgN+nFq8+OSgcfSx43U8xjelvVksV895I/N0FkLzJbOecNF4 ryfA== 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=zA5oIbYVlRFzNoQGr2izSl5NylvyqjYBJAP0dwE47pcGcVownXnhDXkW1qwG6WppbF Hkjfu7NqYbprOHZG2uJUriJK42GHZehi7vTfUXz3+EXNoM+S3xK5nwZ53xAwjo5dA+hO fgSWVZcPO6dp8v0YtFpX1gGcJqq0nW5MyaPqZ11XwWxJtyOgbtmpNABpIpjH1Mxg53ot 6MX+exx4pQTfeQ5IhiFzad8SDvI+L65nuTFUwjINosfo5kPVjxrIn7o+i6hJvniAqh/q yDTO74DcHXHhTmluWoDS0s1AGKQUHvYk1/g+luxxJeHNaj3+hRXpZpMaMAUjCI5BdnmH qscA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=R2RlmtJR; 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 m97si3438185qte.487.2017.10.10.12.36.26 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 10 Oct 2017 12:36:26 -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=R2RlmtJR; 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]:36823 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e20KF-00057L-92 for patch@linaro.org; Tue, 10 Oct 2017 15:36:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58871) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e20EX-0000jm-7h for qemu-devel@nongnu.org; Tue, 10 Oct 2017 15:30:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e20ES-000551-KD for qemu-devel@nongnu.org; Tue, 10 Oct 2017 15:30:26 -0400 Received: from mail-pf0-x22f.google.com ([2607:f8b0:400e:c00::22f]:50211) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e20ES-00054Y-DO for qemu-devel@nongnu.org; Tue, 10 Oct 2017 15:30:24 -0400 Received: by mail-pf0-x22f.google.com with SMTP id m63so18277315pfk.7 for ; Tue, 10 Oct 2017 12:30:22 -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=R2RlmtJRj9w1kAvh50kLhqBTWXvpEHU44MmSdBZojYjzn+pW5301bHJpOEHYstmVoL yq27lNS9AD1WfJzUuIhVW078bxovxsIRi199+9r40JiW4REdn2LDKSRHJBhK5gn+ROwI BgcWb1yr9z2MvEb/VjTZHEl4M9HAdOpr3858s= 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=qF7XSGaSFOEgV/tt4RN9Q4PtqyRlRFb1XiFmh3QNUO74v/IofTftjSdzGZmabnrR4r 1qhXUhM4xMQnoDqvAIpj11YNM0ARDNDRhXxg7W9oPGteFAjDzvcfODTTrew6lUVdUAu8 41mJ1UJ8cMyEePtGoLQ1GRuT9WbxGolPIQWXe7IwHFz2KHuDFiXiTmqXXSMBjCLsk4wj Fy7zA9zaJVWabYI707tNb0k00hJhUdnWHGAlUFHDlGCygO0ObolnXhRhpbOteek01Ncx 2gMTfJtLBFic8Q43dtcQGRRxGcr088mW7H7IPx22+O3Dqe662Mbf+RqHfXQWDDEAZF9H tdog== X-Gm-Message-State: AMCzsaX/etP0DFwBWH95IarYh83Pgp8AQK7U0I/698lmtsplayHpBUek Cv80Xi7Pli7xgqFmaZlqfGP0we7gyes= X-Google-Smtp-Source: AOwi7QAtihgPimie+jJyk9mXmiKPrpnCi9eg+iZ8qxBo48wINsHbLjxt+QkcuHTQ9osxcHz3Ue8e5Q== X-Received: by 10.101.78.130 with SMTP id b2mr13067806pgs.160.1507663820909; Tue, 10 Oct 2017 12:30:20 -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 r22sm19859788pfl.15.2017.10.10.12.30.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Oct 2017 12:30:20 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 10 Oct 2017 12:29:54 -0700 Message-Id: <20171010193003.28857-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171010193003.28857-1-richard.henderson@linaro.org> References: <20171010193003.28857-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::22f Subject: [Qemu-devel] [PULL v2 11/20] 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");