From patchwork Thu Mar 9 11:17:14 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: 95103 Delivered-To: patch@linaro.org Received: by 10.140.82.71 with SMTP id g65csp311316qgd; Thu, 9 Mar 2017 03:24:23 -0800 (PST) X-Received: by 10.200.50.112 with SMTP id y45mr13115140qta.75.1489058663463; Thu, 09 Mar 2017 03:24:23 -0800 (PST) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 13si5409644qkq.210.2017.03.09.03.24.23 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 09 Mar 2017 03:24:23 -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]:33316 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1clwBB-0001YB-34 for patch@linaro.org; Thu, 09 Mar 2017 06:24:21 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54508) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1clw4M-0005GX-3u for qemu-devel@nongnu.org; Thu, 09 Mar 2017 06:17:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1clw4K-0006a2-R9 for qemu-devel@nongnu.org; Thu, 09 Mar 2017 06:17:18 -0500 Received: from mail-wm0-x22b.google.com ([2a00:1450:400c:c09::22b]:36662) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1clw4K-0006Ym-KM for qemu-devel@nongnu.org; Thu, 09 Mar 2017 06:17:16 -0500 Received: by mail-wm0-x22b.google.com with SMTP id n11so136796593wma.1 for ; Thu, 09 Mar 2017 03:17:16 -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=1iOTsAVz7FhPncJf1PtH+If/ktocyzAz47wlOyDRxNg=; b=h4b9VqAXQjOlO7pQh2XZbDKen/PBiPozKNoFc9hVRqQUagvSmDDOaSCZssH+nwII0f 4gwZj4IUn0WjyrZK1SV4mMc6F3CwpOnJe8NGGyXaH8EFFGw1xdMg6zJGNNYzYb7tBHU+ IecUip/NulbXisMz83qm0nVCKxZufEN2xCDDE= 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=1iOTsAVz7FhPncJf1PtH+If/ktocyzAz47wlOyDRxNg=; b=II8JpX+0rvnu/9ezhvDHEKisLFv2AwfOZMAxkPGSgY1DrDiTwN8nLM44gdrAgsWz7t hugYsOhzpihnwb7wzfRkTcOW/6dC80vlXhpXqqcf1eYkRlvN0qs2STlsdjICOUYdoQ/j w+qo54T10QBgVFhp2pH2xkD2tzriwPGQc9Mqh9DpVnpu0hw0eAZwnyI1ILumx0B78V5A bHaPMXfV7Vf7yYRtIf2FsWWWZ70NezHsMTgzkNOo0E7oJeFvRRdIYH+B0tow2Qb+sAtk ULg0Cyurm2+o+Gqmu56SCvjQpTQPBqcn1Q2cwVhkKqtGt7o4HaNXtK/fLHIcUhAlYBBN v3ZA== X-Gm-Message-State: AMke39k3QvYy7SpyPsQKYxWL59H9pzv49Ulep3aKrjjDSTtD6w9/e0mkwZ2BE5p5w6wZTh+9 X-Received: by 10.28.158.193 with SMTP id h184mr10272338wme.59.1489058235551; Thu, 09 Mar 2017 03:17:15 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id w130sm6214702wmg.0.2017.03.09.03.17.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Mar 2017 03:17:10 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id E69A63E383C; Thu, 9 Mar 2017 11:17:15 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Thu, 9 Mar 2017 11:17:14 +0000 Message-Id: <20170309111714.20394-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170309111714.20394-1-alex.bennee@linaro.org> References: <20170309111714.20394-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::22b Subject: [Qemu-devel] [PULL 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: "open list:ARM cores" , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , qemu-devel@nongnu.org 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 Reviewed-by: Philippe Mathieu-Daudé --- hw/intc/arm_gic.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) -- 2.11.0 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 };