From nobody Tue Feb 10 03:37:15 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1530294952609667.4512833131683; Fri, 29 Jun 2018 10:55:52 -0700 (PDT) Received: from localhost ([::1]:43827 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYxcZ-0001VN-2F for importer@patchew.org; Fri, 29 Jun 2018 13:55:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49744) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYxag-0000JA-Eq for qemu-devel@nongnu.org; Fri, 29 Jun 2018 13:53:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fYxac-0008Vo-TL for qemu-devel@nongnu.org; Fri, 29 Jun 2018 13:53:50 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:40258 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fYxac-0008VP-Nk for qemu-devel@nongnu.org; Fri, 29 Jun 2018 13:53:46 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3310F4075767; Fri, 29 Jun 2018 17:53:46 +0000 (UTC) Received: from localhost (ovpn-116-50.ams2.redhat.com [10.36.116.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id D5E5C2026D6A; Fri, 29 Jun 2018 17:53:45 +0000 (UTC) From: Stefan Hajnoczi To: Date: Fri, 29 Jun 2018 18:53:26 +0100 Message-Id: <20180629175330.19391-8-stefanha@redhat.com> In-Reply-To: <20180629175330.19391-1-stefanha@redhat.com> References: <20180629175330.19391-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Fri, 29 Jun 2018 17:53:46 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Fri, 29 Jun 2018 17:53:46 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'stefanha@redhat.com' RCPT:'' Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 07/11] hw/net/ne2000: Add trace events 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: Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Crosthwaite , Juan Quintela , Michael Roth , Markus Armbruster , Stefan Hajnoczi , Paolo Bonzini , "Dr. David Alan Gilbert" , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Stefan Hajnoczi --- hw/net/ne2000.c | 17 ++++++++++++----- hw/net/trace-events | 4 ++++ 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/hw/net/ne2000.c b/hw/net/ne2000.c index 3a9fc89e48..26b234b7eb 100644 --- a/hw/net/ne2000.c +++ b/hw/net/ne2000.c @@ -26,6 +26,7 @@ #include "net/eth.h" #include "ne2000.h" #include "sysemu/sysemu.h" +#include "trace.h" =20 /* debug NE2000 card */ //#define DEBUG_NE2000 @@ -662,19 +663,24 @@ static uint64_t ne2000_read(void *opaque, hwaddr addr, unsigned size) { NE2000State *s =3D opaque; + uint64_t val; =20 if (addr < 0x10 && size =3D=3D 1) { - return ne2000_ioport_read(s, addr); + val =3D ne2000_ioport_read(s, addr); } else if (addr =3D=3D 0x10) { if (size <=3D 2) { - return ne2000_asic_ioport_read(s, addr); + val =3D ne2000_asic_ioport_read(s, addr); } else { - return ne2000_asic_ioport_readl(s, addr); + val =3D ne2000_asic_ioport_readl(s, addr); } } else if (addr =3D=3D 0x1f && size =3D=3D 1) { - return ne2000_reset_ioport_read(s, addr); + val =3D ne2000_reset_ioport_read(s, addr); + } else { + val =3D ((uint64_t)1 << (size * 8)) - 1; } - return ((uint64_t)1 << (size * 8)) - 1; + trace_ne2000_read(addr, val); + + return val; } =20 static void ne2000_write(void *opaque, hwaddr addr, @@ -682,6 +688,7 @@ static void ne2000_write(void *opaque, hwaddr addr, { NE2000State *s =3D opaque; =20 + trace_ne2000_write(addr, data); if (addr < 0x10 && size =3D=3D 1) { ne2000_ioport_write(s, addr, data); } else if (addr =3D=3D 0x10) { diff --git a/hw/net/trace-events b/hw/net/trace-events index 45c4e9fba0..95a1de01e9 100644 --- a/hw/net/trace-events +++ b/hw/net/trace-events @@ -23,6 +23,10 @@ mipsnet_read(uint64_t addr, uint32_t val) "read addr=3D0= x%" PRIx64 " val=3D0x%x" mipsnet_write(uint64_t addr, uint64_t val) "write addr=3D0x%" PRIx64 " val= =3D0x%" PRIx64 mipsnet_irq(uint32_t isr, uint32_t intctl) "set irq to %d (0x%02x)" =20 +# hw/net/ne2000.c +ne2000_read(uint64_t addr, uint64_t val) "read addr=3D0x%" PRIx64 " val=3D= 0x%" PRIx64 +ne2000_write(uint64_t addr, uint64_t val) "write addr=3D0x%" PRIx64 " val= =3D0x%" PRIx64 + # hw/net/opencores_eth.c open_eth_mii_write(unsigned idx, uint16_t v) "MII[0x%02x] <- 0x%04x" open_eth_mii_read(unsigned idx, uint16_t v) "MII[0x%02x] -> 0x%04x" --=20 2.17.1