From patchwork Fri Dec 13 10:50:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1209082 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="V9jqgMqL"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47Z6tK2V2gz9sPh for ; Fri, 13 Dec 2019 21:51:52 +1100 (AEDT) Received: from localhost ([::1]:45936 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ifiY2-0005ZU-Jg for incoming@patchwork.ozlabs.org; Fri, 13 Dec 2019 05:51:50 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60054) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ifiXZ-0005Xv-5K for qemu-devel@nongnu.org; Fri, 13 Dec 2019 05:51:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ifiXY-0001Xi-2u for qemu-devel@nongnu.org; Fri, 13 Dec 2019 05:51:21 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:36542 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ifiXX-0001VO-VQ for qemu-devel@nongnu.org; Fri, 13 Dec 2019 05:51:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576234278; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=X5K7ONr2rRKoOKjnPt4dYZ5TprIjSuVC0cOky3wXTxE=; b=V9jqgMqLbVO7+SZWN7d6RiYUdv7mIES7PW5m3IlmPZQuUjyj3KTkg1uqYH9j37p48F17de +RLgU44sI98rUf2d5o+pxm+f5nTZ0z/RwM8dHos35PYaRH3yiMn3yS5dzy0P1vxwRoOx8G nEEAgUZzGlSmhsa9epdb9sfWRcRO8jk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-141-X08GZLzuMcqwU-pRKg3hyQ-1; Fri, 13 Dec 2019 05:51:15 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3FC45DB60; Fri, 13 Dec 2019 10:51:14 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-134.brq.redhat.com [10.40.204.134]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8974210013A1; Fri, 13 Dec 2019 10:51:11 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 1/4] hw/i386/pc: Convert DPRINTF() to trace events Date: Fri, 13 Dec 2019 11:50:57 +0100 Message-Id: <20191213105100.8173-2-philmd@redhat.com> In-Reply-To: <20191213105100.8173-1-philmd@redhat.com> References: <20191213105100.8173-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: X08GZLzuMcqwU-pRKg3hyQ-1 X-Mimecast-Spam-Score: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , "Michael S. Tsirkin" , Paolo Bonzini , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= , Richard Henderson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Convert the deprecated DPRINTF() macro to trace events. Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc.c | 19 +++++-------------- hw/i386/trace-events | 6 ++++++ 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index ac08e63604..66a30cfdf5 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -90,16 +90,7 @@ #include "config-devices.h" #include "e820_memory_layout.h" #include "fw_cfg.h" - -/* debug PC/ISA interrupts */ -//#define DEBUG_IRQ - -#ifdef DEBUG_IRQ -#define DPRINTF(fmt, ...) \ - do { printf("CPUIRQ: " fmt , ## __VA_ARGS__); } while (0) -#else -#define DPRINTF(fmt, ...) -#endif +#include "trace.h" struct hpet_fw_config hpet_cfg = {.count = UINT8_MAX}; @@ -348,7 +339,7 @@ void gsi_handler(void *opaque, int n, int level) { GSIState *s = opaque; - DPRINTF("pc: %s GSI %d\n", level ? "raising" : "lowering", n); + trace_pc_gsi_interrupt(n, level); if (n < ISA_NUM_IRQS) { qemu_set_irq(s->i8259_irq[n], level); } @@ -426,7 +417,7 @@ static void pic_irq_request(void *opaque, int irq, int level) CPUState *cs = first_cpu; X86CPU *cpu = X86_CPU(cs); - DPRINTF("pic_irqs: %s irq %d\n", level? "raise" : "lower", irq); + trace_pc_pic_interrupt(irq, level); if (cpu->apic_state && !kvm_irqchip_in_kernel()) { CPU_FOREACH(cs) { cpu = X86_CPU(cs); @@ -760,7 +751,7 @@ static void port92_write(void *opaque, hwaddr addr, uint64_t val, Port92State *s = opaque; int oldval = s->outport; - DPRINTF("port92: write 0x%02" PRIx64 "\n", val); + trace_port92_write(val); s->outport = val; qemu_set_irq(s->a20_out, (val >> 1) & 1); if ((val & 1) && !(oldval & 1)) { @@ -775,7 +766,7 @@ static uint64_t port92_read(void *opaque, hwaddr addr, uint32_t ret; ret = s->outport; - DPRINTF("port92: read 0x%02x\n", ret); + trace_port92_read(ret); return ret; } diff --git a/hw/i386/trace-events b/hw/i386/trace-events index c8bc464bc5..43f33cf7e2 100644 --- a/hw/i386/trace-events +++ b/hw/i386/trace-events @@ -111,3 +111,9 @@ amdvi_ir_irte_ga_val(uint64_t hi, uint64_t lo) "hi 0x%"PRIx64" lo 0x%"PRIx64 # vmport.c vmport_register(unsigned char command, void *func, void *opaque) "command: 0x%02x func: %p opaque: %p" vmport_command(unsigned char command) "command: 0x%02x" + +# pc.c +pc_gsi_interrupt(int irqn, int level) "GSI interrupt #%d level:%d" +pc_pic_interrupt(int irqn, int level) "PIC interrupt #%d level:%d" +port92_read(uint8_t val) "port92: read 0x%02x" +port92_write(uint8_t val) "port92: write 0x%02x"