From patchwork Thu Mar 2 19:53:37 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: 94810 Delivered-To: patch@linaro.org Received: by 10.140.82.71 with SMTP id g65csp324688qgd; Thu, 2 Mar 2017 12:00:14 -0800 (PST) X-Received: by 10.200.51.92 with SMTP id u28mr20026354qta.151.1488484814436; Thu, 02 Mar 2017 12:00:14 -0800 (PST) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id h15si7715033qth.204.2017.03.02.12.00.14 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 02 Mar 2017 12:00:14 -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]:54292 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cjWtY-0004Jq-5k for patch@linaro.org; Thu, 02 Mar 2017 15:00:12 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59761) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cjWnO-00088e-Mr for qemu-devel@nongnu.org; Thu, 02 Mar 2017 14:53:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cjWnM-0002Xb-Tr for qemu-devel@nongnu.org; Thu, 02 Mar 2017 14:53:50 -0500 Received: from mail-wm0-x22d.google.com ([2a00:1450:400c:c09::22d]:36200) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cjWnM-0002XF-Nr for qemu-devel@nongnu.org; Thu, 02 Mar 2017 14:53:48 -0500 Received: by mail-wm0-x22d.google.com with SMTP id n11so96810wma.1 for ; Thu, 02 Mar 2017 11:53:48 -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=KWSZlo/VylAEpDhSQ11RJbzh5kr+PSDdFD5j+DQAcZc=; b=NvKxlrNGs+aZ/cHMdrHjQdmSXDes64Gp/FBGGvAv6Uq1XuMCZYZ45A8Tu44ChxbcQw C6nqvLB91GjxD2+9kiaJxc86JnctMth7n/fcVCL8JFm7yHyJdsBVP9gtgDAH1pbqVEOD zsd4YR1FLLT1Umhhjxbz2VJiIwEyos/Cw3kxE= 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=KWSZlo/VylAEpDhSQ11RJbzh5kr+PSDdFD5j+DQAcZc=; b=onyTmq1RihsJYejgV1YETAoI/cBHdg/ysDxXkt5M/QkoIR41tnce7pg6kzmb+M868H 2a8RWAlUsAOrS//2dWHkM42i1KJ3pCk60WFZayHOCZVyFsyU8xe+WB0Wnh+RF64bh3s7 zljolBWRwvsJxvG8apkpzpFR3IzVDL9AgWUYN+zHcGGimUAHtHdiqLzcsp9alHyXla0r tMXzVo1KbAua4nQLg/cy4UDime8kdVe7UcFC8WMUr2mMX0FJH6om4nk30dJ2TED55IcA sxf8sWIso1nEY6TOPW7mqYT5q+oTvP4aVJJ+sC/QzdPylySXXFZZeMwLQdZ55p9pR8gb c8NA== X-Gm-Message-State: AMke39lQmFVuVTaPGiuwdH8yHfwMPZwgd+2fvnBMOBHxzcrfXA3oL30X3OR1LuACT4wOy85c X-Received: by 10.28.179.7 with SMTP id c7mr8382wmf.128.1488484427603; Thu, 02 Mar 2017 11:53:47 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id t194sm24255300wmd.13.2017.03.02.11.53.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Mar 2017 11:53:43 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id D84C83E0BD2; Thu, 2 Mar 2017 19:53:37 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, rth@twiddle.net, pbonzini@redhat.com Date: Thu, 2 Mar 2017 19:53:37 +0000 Message-Id: <20170302195337.31558-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170302195337.31558-1-alex.bennee@linaro.org> References: <20170302195337.31558-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::22d Subject: [Qemu-devel] [PATCH v2 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 --- hw/intc/arm_gic.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) -- 2.11.0 Reviewed-by: Peter Maydell 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 };