From patchwork Mon Apr 28 08:26:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc_Mar=C3=AD?= X-Patchwork-Id: 343302 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 16EF61400B7 for ; Mon, 28 Apr 2014 18:33:13 +1000 (EST) Received: from localhost ([::1]:42422 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wegzu-0005cf-Ma for incoming@patchwork.ozlabs.org; Mon, 28 Apr 2014 04:33:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58086) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wegti-0002hu-IP for qemu-devel@nongnu.org; Mon, 28 Apr 2014 04:26:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wegtd-0004uB-2x for qemu-devel@nongnu.org; Mon, 28 Apr 2014 04:26:46 -0400 Received: from mail-wi0-x229.google.com ([2a00:1450:400c:c05::229]:38511) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wegtc-0004te-T6 for qemu-devel@nongnu.org; Mon, 28 Apr 2014 04:26:41 -0400 Received: by mail-wi0-f169.google.com with SMTP id hm4so5105413wib.0 for ; Mon, 28 Apr 2014 01:26:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=E6Bsh3O4BE+Vfzs00pRofTxO3HPsAFXslz3g4SyzDZY=; b=ImXQENvGKPFi2zu+DciMeNsNHSqtiUctVn3zEw6VFIPMWLZeZ55LwM0qG5G0H37tPN Tn8qDI19dVm+p4fQAZ/xeCAnsKdcY+c27g9o35cqboGCSBEA/IUdliFQpy8X467KCkHI WZtq16jmdRidqZZ3zeRJKrg5FLWHnSFFmBAhe0UswpOMDF2jNp12/Rh3/51HsOdRRzqZ Z9JYDdhw3gi24xXAIFfXtl6PnJMQNcyMf6IxRSUkCH2HXDepC5SRweVzOSWmw7IOTtjO AxmZ7JZijr9VW0TsuJ/EDs0JHy0bmcqoBOp9GX4k6bvvbIoBWZtpb+Xg84cKtYesl9s3 xBvA== X-Received: by 10.194.19.161 with SMTP id g1mr17816792wje.20.1398673600113; Mon, 28 Apr 2014 01:26:40 -0700 (PDT) Received: from crunchbang.upc.es (cisne-cn07.upc.es. [147.83.182.7]) by mx.google.com with ESMTPSA id pn9sm16211730wic.17.2014.04.28.01.26.38 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Apr 2014 01:26:39 -0700 (PDT) From: =?UTF-8?q?Marc=20Mar=C3=AD?= To: qemu-devel@nongnu.org Date: Mon, 28 Apr 2014 10:26:14 +0200 Message-Id: <1398673575-7773-13-git-send-email-marc.mari.barcelo@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1398673575-7773-1-git-send-email-marc.mari.barcelo@gmail.com> References: <1398673575-7773-1-git-send-email-marc.mari.barcelo@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::229 Cc: Peter Crosthwaite , =?UTF-8?q?Marc=20Mar=C3=AD?= <5.markmb.5@gmail.com>, =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [Qemu-devel] [PATCH 13/14] target-s390: Convert conditional compilation of debug printfs to regular ifs X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Marc MarĂ­ <5.markmb.5@gmail.com> Modify debug macros as explained in https://lists.gnu.org/archive/html/qemu-devel/2014-04/msg03642.html Signed-off-by: Marc MarĂ­ <5.markmb.5@gmail.com> --- target-s390x/helper.c | 32 ++++++++++++++++++-------------- target-s390x/kvm.c | 17 ++++++++++------- 2 files changed, 28 insertions(+), 21 deletions(-) diff --git a/target-s390x/helper.c b/target-s390x/helper.c index aa628b8..8a38f90 100644 --- a/target-s390x/helper.c +++ b/target-s390x/helper.c @@ -25,24 +25,28 @@ #include "sysemu/sysemu.h" #endif -//#define DEBUG_S390 -//#define DEBUG_S390_PTE -//#define DEBUG_S390_STDOUT +//#define DEBUG_S390 1 +//#define DEBUG_S390_PTE 1 +//#define DEBUG_S390_STDOUT 1 -#ifdef DEBUG_S390 -#ifdef DEBUG_S390_STDOUT -#define DPRINTF(fmt, ...) \ - do { fprintf(stderr, fmt, ## __VA_ARGS__); \ - qemu_log(fmt, ##__VA_ARGS__); } while (0) -#else -#define DPRINTF(fmt, ...) \ - do { qemu_log(fmt, ## __VA_ARGS__); } while (0) +#ifndef DEBUG_S390 +#define DEBUG_S390 0 #endif -#else -#define DPRINTF(fmt, ...) \ - do { } while (0) + +#ifndef DEBUG_S390_STDOUT +#define DEBUG_S390_STDOUT 0 #endif +#define DPRINTF(fmt, ...) \ + do { \ + if(DEBUG_S390) { \ + qemu_log(fmt, ##__VA_ARGS__); \ + if(DEBUG_S390_STDOUT) { \ + fprintf(stderr, fmt, ## __VA_ARGS__); \ + } \ + } \ + } while (0) + #ifdef DEBUG_S390_PTE #define PTE_DPRINTF DPRINTF #else diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c index 56b9af7..3f20b6b 100644 --- a/target-s390x/kvm.c +++ b/target-s390x/kvm.c @@ -37,16 +37,19 @@ #include "qapi/qmp/qjson.h" #include "monitor/monitor.h" -/* #define DEBUG_KVM */ +/* #define DEBUG_KVM 1*/ -#ifdef DEBUG_KVM -#define DPRINTF(fmt, ...) \ - do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0) -#else -#define DPRINTF(fmt, ...) \ - do { } while (0) +#ifndef DEBUG_KVM +#define DEBUG_KVM 0 #endif +#define DPRINTF(fmt, ...) \ + do { \ + if(DEBUG_KVM) { \ + fprintf(stderr, fmt, ## __VA_ARGS__); \ + } \ + } while (0) + #define IPA0_DIAG 0x8300 #define IPA0_SIGP 0xae00 #define IPA0_B2 0xb200