From patchwork Sun Apr 15 18:38:46 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 152722 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)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id B1008B6FDE for ; Mon, 16 Apr 2012 06:30:13 +1000 (EST) Received: from localhost ([::1]:45997 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SJUNC-0002An-DP for incoming@patchwork.ozlabs.org; Sun, 15 Apr 2012 14:40:30 -0400 Received: from eggs.gnu.org ([208.118.235.92]:37232) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SJUMC-0008Ej-6Z for qemu-devel@nongnu.org; Sun, 15 Apr 2012 14:39:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SJUMA-0002pW-2y for qemu-devel@nongnu.org; Sun, 15 Apr 2012 14:39:27 -0400 Received: from cantor2.suse.de ([195.135.220.15]:35592 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SJUM9-0002om-QI; Sun, 15 Apr 2012 14:39:26 -0400 Received: from relay1.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id A08AE8FD0F; Sun, 15 Apr 2012 20:39:23 +0200 (CEST) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Sun, 15 Apr 2012 20:38:46 +0200 Message-Id: <1334515144-26485-3-git-send-email-afaerber@suse.de> X-Mailer: git-send-email 1.7.7 In-Reply-To: <1334515144-26485-1-git-send-email-afaerber@suse.de> References: <1334515144-26485-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 195.135.220.15 Cc: Michael Ellerman , Anthony Liguori , Dong Xu Wang , agraf@suse.de, blauwirbel@gmail.com, qemu-ppc@nongnu.org, Paolo Bonzini , =?UTF-8?q?Andreas=20F=C3=A4rber?= , David Gibson Subject: [Qemu-devel] [PATCH 02/20] pseries: Clean up hcall_dprintf() debugging messages 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: David Gibson The pseries machine code has a number of debug messages for debugging PAPR hypercalls, dependent on DEBUG_SPAPR_HCALLS. This patch cleans these messages up a bit, by adding __func__ to the hcall_dprintf() macro and simplifying up a number of the individual messages accordingly. Signed-off-by: David Gibson Signed-off-by: Andreas Färber --- hw/spapr.h | 2 +- hw/spapr_llan.c | 12 +++++------- hw/spapr_vio.c | 25 +++++++++---------------- 3 files changed, 15 insertions(+), 24 deletions(-) diff --git a/hw/spapr.h b/hw/spapr.h index 11160b0..654a7a8 100644 --- a/hw/spapr.h +++ b/hw/spapr.h @@ -272,7 +272,7 @@ extern sPAPREnvironment *spapr; #ifdef DEBUG_SPAPR_HCALLS #define hcall_dprintf(fmt, ...) \ - do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0) + do { fprintf(stderr, "%s: " fmt, __func__, ## __VA_ARGS__); } while (0) #else #define hcall_dprintf(fmt, ...) \ do { } while (0) diff --git a/hw/spapr_llan.c b/hw/spapr_llan.c index cfc7778..32dce17 100644 --- a/hw/spapr_llan.c +++ b/hw/spapr_llan.c @@ -279,21 +279,19 @@ static target_ulong h_register_logical_lan(CPUPPCState *env, if (check_bd(dev, VLAN_VALID_BD(buf_list, SPAPR_VIO_TCE_PAGE_SIZE), SPAPR_VIO_TCE_PAGE_SIZE) < 0) { - hcall_dprintf("Bad buf_list 0x" TARGET_FMT_lx " for " - "H_REGISTER_LOGICAL_LAN\n", buf_list); + hcall_dprintf("Bad buf_list 0x" TARGET_FMT_lx "\n", buf_list); return H_PARAMETER; } filter_list_bd = VLAN_VALID_BD(filter_list, SPAPR_VIO_TCE_PAGE_SIZE); if (check_bd(dev, filter_list_bd, SPAPR_VIO_TCE_PAGE_SIZE) < 0) { - hcall_dprintf("Bad filter_list 0x" TARGET_FMT_lx " for " - "H_REGISTER_LOGICAL_LAN\n", filter_list); + hcall_dprintf("Bad filter_list 0x" TARGET_FMT_lx "\n", filter_list); return H_PARAMETER; } if (!(rec_queue & VLAN_BD_VALID) || (check_bd(dev, rec_queue, VLAN_RQ_ALIGNMENT) < 0)) { - hcall_dprintf("Bad receive queue for H_REGISTER_LOGICAL_LAN\n"); + hcall_dprintf("Bad receive queue\n"); return H_PARAMETER; } @@ -358,13 +356,13 @@ static target_ulong h_add_logical_lan_buffer(CPUPPCState *env, ", 0x" TARGET_FMT_lx ")\n", reg, buf); if (!sdev) { - hcall_dprintf("Wrong device in h_add_logical_lan_buffer\n"); + hcall_dprintf("Bad device\n"); return H_PARAMETER; } if ((check_bd(dev, buf, 4) < 0) || (VLAN_BD_LEN(buf) < 16)) { - hcall_dprintf("Bad buffer enqueued in h_add_logical_lan_buffer\n"); + hcall_dprintf("Bad buffer enqueued\n"); return H_PARAMETER; } diff --git a/hw/spapr_vio.c b/hw/spapr_vio.c index dbf5a90..1f67e64 100644 --- a/hw/spapr_vio.c +++ b/hw/spapr_vio.c @@ -204,8 +204,7 @@ static target_ulong h_put_tce(CPUPPCState *env, sPAPREnvironment *spapr, VIOsPAPR_RTCE *rtce; if (!dev) { - hcall_dprintf("spapr_vio_put_tce on non-existent LIOBN " - TARGET_FMT_lx "\n", liobn); + hcall_dprintf("LIOBN 0x" TARGET_FMT_lx " does not exist\n", liobn); return H_PARAMETER; } @@ -217,8 +216,7 @@ static target_ulong h_put_tce(CPUPPCState *env, sPAPREnvironment *spapr, #endif if (ioba >= dev->rtce_window_size) { - hcall_dprintf("spapr_vio_put_tce on out-of-boards IOBA 0x" - TARGET_FMT_lx "\n", ioba); + hcall_dprintf("Out-of-bounds IOBA 0x" TARGET_FMT_lx "\n", ioba); return H_PARAMETER; } @@ -414,22 +412,20 @@ static target_ulong h_reg_crq(CPUPPCState *env, sPAPREnvironment *spapr, VIOsPAPRDevice *dev = spapr_vio_find_by_reg(spapr->vio_bus, reg); if (!dev) { - hcall_dprintf("h_reg_crq on non-existent unit 0x" - TARGET_FMT_lx "\n", reg); + hcall_dprintf("Unit 0x" TARGET_FMT_lx " does not exist\n", reg); return H_PARAMETER; } /* We can't grok a queue size bigger than 256M for now */ if (queue_len < 0x1000 || queue_len > 0x10000000) { - hcall_dprintf("h_reg_crq, queue size too small or too big (0x%llx)\n", - (unsigned long long)queue_len); + hcall_dprintf("Queue size too small or too big (0x" TARGET_FMT_lx + ")\n", queue_len); return H_PARAMETER; } /* Check queue alignment */ if (queue_addr & 0xfff) { - hcall_dprintf("h_reg_crq, queue not aligned (0x%llx)\n", - (unsigned long long)queue_addr); + hcall_dprintf("Queue not aligned (0x" TARGET_FMT_lx ")\n", queue_addr); return H_PARAMETER; } @@ -460,8 +456,7 @@ static target_ulong h_free_crq(CPUPPCState *env, sPAPREnvironment *spapr, VIOsPAPRDevice *dev = spapr_vio_find_by_reg(spapr->vio_bus, reg); if (!dev) { - hcall_dprintf("h_free_crq on non-existent unit 0x" - TARGET_FMT_lx "\n", reg); + hcall_dprintf("Unit 0x" TARGET_FMT_lx " does not exist\n", reg); return H_PARAMETER; } @@ -484,8 +479,7 @@ static target_ulong h_send_crq(CPUPPCState *env, sPAPREnvironment *spapr, uint64_t crq_mangle[2]; if (!dev) { - hcall_dprintf("h_send_crq on non-existent unit 0x" - TARGET_FMT_lx "\n", reg); + hcall_dprintf("Unit 0x" TARGET_FMT_lx " does not exist\n", reg); return H_PARAMETER; } crq_mangle[0] = cpu_to_be64(msg_hi); @@ -505,8 +499,7 @@ static target_ulong h_enable_crq(CPUPPCState *env, sPAPREnvironment *spapr, VIOsPAPRDevice *dev = spapr_vio_find_by_reg(spapr->vio_bus, reg); if (!dev) { - hcall_dprintf("h_enable_crq on non-existent unit 0x" - TARGET_FMT_lx "\n", reg); + hcall_dprintf("Unit 0x" TARGET_FMT_lx " does not exist\n", reg); return H_PARAMETER; }