From patchwork Tue Mar 7 15:50:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 95009 Delivered-To: patch@linaro.org Received: by 10.140.82.71 with SMTP id g65csp1953456qgd; Tue, 7 Mar 2017 08:09:30 -0800 (PST) X-Received: by 10.31.194.200 with SMTP id s191mr626329vkf.101.1488902970065; Tue, 07 Mar 2017 08:09:30 -0800 (PST) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id h141si203658vke.131.2017.03.07.08.09.29 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 07 Mar 2017 08:09:30 -0800 (PST) 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; 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]:51426 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1clHfz-0001oG-CC for patch@linaro.org; Tue, 07 Mar 2017 11:09:27 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45900) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1clHO9-0002Z4-Mc for qemu-devel@nongnu.org; Tue, 07 Mar 2017 10:51:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1clHO8-0005sq-9U for qemu-devel@nongnu.org; Tue, 07 Mar 2017 10:51:01 -0500 Received: from mail-wm0-x22c.google.com ([2a00:1450:400c:c09::22c]:36345) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1clHO8-0005sL-1f for qemu-devel@nongnu.org; Tue, 07 Mar 2017 10:51:00 -0500 Received: by mail-wm0-x22c.google.com with SMTP id n11so93217715wma.1 for ; Tue, 07 Mar 2017 07:50:59 -0800 (PST) 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=SVl932jlvVoYk0EnXQJcOuY9TvQCAjemCw0LjMrZcCE=; b=jJBszKByaN72xtc/G1lxpFv3sfGO7QHUMtnJK/r5y1uMk2gb5A+6nkqRxaWow9arCP RYDBoP63V7SPcT9Ywf3pfQvk5yJ/juub0PYRRkiLeQ942jFsn5DFa5iYXzDITMEFj/l1 tUuI87a6z0B5DFn5sQbC7PhdqfI/NK1+THxCw= 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=SVl932jlvVoYk0EnXQJcOuY9TvQCAjemCw0LjMrZcCE=; b=rQeEehNi2cTbki8D+7J3B7AWWgdBR8DGeRoeGdF8I9fvfRicjTgkRtKRdbDpjXcA4R iuAtTLzP+aRrOx5bW8zq6iAYRdEW6o+0Q56dUcacLWYWasCS/q0fojtTOPbM97Pgxo5g +ZhO89sNBMbPFZODGNw+uDUCq5BOpjjRXWHjkCrSXkptkk/NzY4f0fat51rQQQsO+6f5 19DKascn5nEMqncJiWJ/FGrQjFDxI5T5tgay8xH3CkZAfUWCw6fOun1Bk1mDAqaCpJRe IFluRZbjqgSskbTr+bNVn2/+ZXlz2FDKwhD+YjIORxfS+CwE8/0JivIMgmVHMYS1x+CW jzng== X-Gm-Message-State: AMke39lNt9l6z75S59NAdK+/wsdxH5DngMSsUJ56innqEMl/oouSyGw4JG6ZKGg/2G9oyBrb X-Received: by 10.28.191.24 with SMTP id p24mr18852839wmf.118.1488901858925; Tue, 07 Mar 2017 07:50:58 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id b10sm19523007wmi.34.2017.03.07.07.50.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Mar 2017 07:50:53 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 43C3D3E3035; Tue, 7 Mar 2017 15:50:55 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, rth@twiddle.net, pbonzini@redhat.com Date: Tue, 7 Mar 2017 15:50:54 +0000 Message-Id: <20170307155054.5833-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170307155054.5833-1-alex.bennee@linaro.org> References: <20170307155054.5833-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::22c Subject: [Qemu-devel] [PATCH v3 11/11] hw/intc/arm_gic: modernise the DPRINTF 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: mttcg@listserver.greensocs.com, nikunj@linux.vnet.ibm.com, a.rigo@virtualopensystems.com, qemu-devel@nongnu.org, cota@braap.org, "open list:ARM cores" , bobby.prani@gmail.com, =?utf-8?q?Alex_Benn=C3=A9e?= , fred.konrad@greensocs.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" While I was debugging the icount issues I realised a bunch of the messages look quite similar. I've fixed this by including __func__ in the debug print. At the same time I move the a modern if (GATE) style printf which ensures the compiler can check for format string errors even if the code gets optimised away in the non-DEBUG_GIC case. Signed-off-by: Alex Bennée Reviewed-by: Peter Maydell --- hw/intc/arm_gic.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) -- 2.11.0 Reviewed-by: Philippe Mathieu-Daudé diff --git a/hw/intc/arm_gic.c b/hw/intc/arm_gic.c index 8e5a9d8a3e..b305d9032a 100644 --- a/hw/intc/arm_gic.c +++ b/hw/intc/arm_gic.c @@ -26,15 +26,20 @@ #include "qemu/log.h" #include "trace.h" -//#define DEBUG_GIC +/* #define DEBUG_GIC */ #ifdef DEBUG_GIC -#define DPRINTF(fmt, ...) \ -do { fprintf(stderr, "arm_gic: " fmt , ## __VA_ARGS__); } while (0) +#define DEBUG_GIC_GATE 1 #else -#define DPRINTF(fmt, ...) do {} while(0) +#define DEBUG_GIC_GATE 0 #endif +#define DPRINTF(fmt, ...) do { \ + if (DEBUG_GIC_GATE) { \ + fprintf(stderr, "%s: " fmt, __func__, ## __VA_ARGS__); \ + } \ + } while (0) + static const uint8_t gic_id_11mpcore[] = { 0x00, 0x00, 0x00, 0x00, 0x90, 0x13, 0x04, 0x00, 0x0d, 0xf0, 0x05, 0xb1 };