From patchwork Fri Dec 13 16:17:42 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: 11291169 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D711214E3 for ; Fri, 13 Dec 2019 21:01:18 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A793C2469F for ; Fri, 13 Dec 2019 21:01:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="RglyfGT3" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A793C2469F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ifne6-0008LT-GA; Fri, 13 Dec 2019 16:18:26 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ifne5-0008LO-KK for xen-devel@lists.xenproject.org; Fri, 13 Dec 2019 16:18:25 +0000 X-Inumbo-ID: 3009ebe4-1dc4-11ea-8f6f-12813bfff9fa Received: from us-smtp-delivery-1.mimecast.com (unknown [205.139.110.61]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id 3009ebe4-1dc4-11ea-8f6f-12813bfff9fa; Fri, 13 Dec 2019 16:18:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576253904; 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=zCZ3/HzJt6UebSooqSPs4MgLhNuCHweYJBKUsTXMBXw=; b=RglyfGT3r9CU70deDTCvjAs5XCx3qtvStP4m6DkjyTQrfiM21GcbA+NAnRxI/KyttjdCI6 W1jxIIZ+o+/88oWO3+eFqn3FO0PGLmpJdX8LrQ1PYXB61ihC7lfKJKitd6YQm20d4tbSHq MpgdcYuw+CpGhDmcHc8BsdnKdxHjr7I= 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-312-3ZUD0pJMOhuSY8G0PHLj2g-1; Fri, 13 Dec 2019 11:18:21 -0500 X-MC-Unique: 3ZUD0pJMOhuSY8G0PHLj2g-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3B5BB107ACC4; Fri, 13 Dec 2019 16:18:20 +0000 (UTC) Received: from x1w.redhat.com (ovpn-205-147.brq.redhat.com [10.40.205.147]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CB3BD19C4F; Fri, 13 Dec 2019 16:18:12 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Fri, 13 Dec 2019 17:17:42 +0100 Message-Id: <20191213161753.8051-2-philmd@redhat.com> In-Reply-To: <20191213161753.8051-1-philmd@redhat.com> References: <20191213161753.8051-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Subject: [Xen-devel] [PATCH 01/12] hw/i386/pc: Convert DPRINTF() to trace events X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Sergio Lopez , Eduardo Habkost , kvm@vger.kernel.org, Paul Durrant , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , "Michael S. Tsirkin" , Paolo Bonzini , Marcel Apfelbaum , xen-devel@lists.xenproject.org, Anthony Perard , Igor Mammedov , qemu-block@nongnu.org, John Snow , Richard Henderson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Convert the deprecated DPRINTF() macro to trace events. Signed-off-by: Philippe Mathieu-Daudé --- v2: rename pc_pic -> x86_pic --- 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..5f8e39c025 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_x86_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_x86_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..a608a5b635 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 +x86_gsi_interrupt(int irqn, int level) "GSI interrupt #%d level:%d" +x86_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"