From nobody Sun Feb 8 23:13:13 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 1530294933645158.56982862246855; Fri, 29 Jun 2018 10:55:33 -0700 (PDT) Received: from localhost ([::1]:43822 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYxcK-0001Hg-QZ for importer@patchew.org; Fri, 29 Jun 2018 13:55:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49648) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYxaV-0000CQ-Od for qemu-devel@nongnu.org; Fri, 29 Jun 2018 13:53:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fYxaU-0008Ln-06 for qemu-devel@nongnu.org; Fri, 29 Jun 2018 13:53:39 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:42160 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 1fYxaT-0008LO-SD for qemu-devel@nongnu.org; Fri, 29 Jun 2018 13:53:37 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4C95A401D781; Fri, 29 Jun 2018 17:53:37 +0000 (UTC) Received: from localhost (ovpn-116-50.ams2.redhat.com [10.36.116.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id 37D7C1D084; Fri, 29 Jun 2018 17:53:35 +0000 (UTC) From: Stefan Hajnoczi To: Date: Fri, 29 Jun 2018 18:53:20 +0100 Message-Id: <20180629175330.19391-2-stefanha@redhat.com> In-Reply-To: <20180629175330.19391-1-stefanha@redhat.com> References: <20180629175330.19391-1-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 29 Jun 2018 17:53:37 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 29 Jun 2018 17:53:37 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'stefanha@redhat.com' RCPT:'' 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 01/11] simpletrace: Convert name from mapping record to str 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 , Eduardo Habkost , 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-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Eduardo Habkost The rest of the code assumes that idtoname is a (int -> str) dictionary, so convert the data accordingly. This is necessary to make the script work with Python 3 (where reads from a binary file return 'bytes' objects, not 'str'). Fixes the following error: $ python3 ./scripts/simpletrace.py trace-events-all trace-27445 b'object_class_dynamic_cast_assert' event is logged but is not \ declared in the trace events file, try using trace-events-all instead. Signed-off-by: Eduardo Habkost Message-id: 20180619194549.15584-1-ehabkost@redhat.com Signed-off-by: Stefan Hajnoczi --- scripts/simpletrace.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/simpletrace.py b/scripts/simpletrace.py index d4a50a1e2b..4ad34f90cd 100755 --- a/scripts/simpletrace.py +++ b/scripts/simpletrace.py @@ -70,7 +70,7 @@ def get_record(edict, idtoname, rechdr, fobj): def get_mapping(fobj): (event_id, ) =3D struct.unpack('=3DQ', fobj.read(8)) (len, ) =3D struct.unpack('=3DL', fobj.read(4)) - name =3D fobj.read(len) + name =3D fobj.read(len).decode() =20 return (event_id, name) =20 --=20 2.17.1 From nobody Sun Feb 8 23:13:13 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 1530295155485178.81894180195854; Fri, 29 Jun 2018 10:59:15 -0700 (PDT) Received: from localhost ([::1]:43843 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYxfk-0004M5-2f for importer@patchew.org; Fri, 29 Jun 2018 13:59:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49664) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYxaW-0000Cy-Na for qemu-devel@nongnu.org; Fri, 29 Jun 2018 13:53:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fYxaV-0008Ne-Pw for qemu-devel@nongnu.org; Fri, 29 Jun 2018 13:53:40 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:53410 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 1fYxaV-0008NH-L1 for qemu-devel@nongnu.org; Fri, 29 Jun 2018 13:53:39 -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 0B01387929; Fri, 29 Jun 2018 17:53:39 +0000 (UTC) Received: from localhost (ovpn-116-50.ams2.redhat.com [10.36.116.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7B7AA2026D68; Fri, 29 Jun 2018 17:53:38 +0000 (UTC) From: Stefan Hajnoczi To: Date: Fri, 29 Jun 2018 18:53:21 +0100 Message-Id: <20180629175330.19391-3-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.1]); Fri, 29 Jun 2018 17:53:39 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Fri, 29 Jun 2018 17:53:39 +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 02/11] trace: Fix format string for the struct timeval members casted to size_t 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 This fixes when using GCC with -Wformat-signedness: migration/trace.h: In function =E2=80=98_nocheck__trace_dirty_bitmap_lo= ad_success=E2=80=99: migration/trace.h:6368:24: error: format =E2=80=98%zd=E2=80=99 expects = argument of type =E2=80=98signed size_t=E2=80=99, but argument 3 has type = =E2=80=98long unsigned int=E2=80=99 [-Werror=3Dformat=3D] qemu_log("%d@%zd.%06zd:dirty_bitmap_load_success " "" "\n", ~~^ %ld migration/trace.h:6370:18: (size_t)_now.tv_sec, (size_t)_now.tv_usec ~~~~~~~~~~~~~~~~~~~ migration/trace.h:6368:30: error: format =E2=80=98%zd=E2=80=99 expects = argument of type =E2=80=98signed size_t=E2=80=99, but argument 4 has type = =E2=80=98long unsigned int=E2=80=99 [-Werror=3Dformat=3D] qemu_log("%d@%zd.%06zd:dirty_bitmap_load_success " "" "\n", ~~~~^ %06ld migration/trace.h:6370:39: (size_t)_now.tv_sec, (size_t)_now.tv_usec ~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Stefan Hajnoczi --- scripts/tracetool/backend/log.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/tracetool/backend/log.py b/scripts/tracetool/backend/l= og.py index 78933d03ad..6751f41bc5 100644 --- a/scripts/tracetool/backend/log.py +++ b/scripts/tracetool/backend/log.py @@ -38,7 +38,7 @@ def generate_h(event, group): out(' if (%(cond)s && qemu_loglevel_mask(LOG_TRACE)) {', ' struct timeval _now;', ' gettimeofday(&_now, NULL);', - ' qemu_log("%%d@%%zd.%%06zd:%(name)s " %(fmt)s "\\n",', + ' qemu_log("%%d@%%zu.%%06zu:%(name)s " %(fmt)s "\\n",', ' getpid(),', ' (size_t)_now.tv_sec, (size_t)_now.tv_usec', ' %(argnames)s);', --=20 2.17.1 From nobody Sun Feb 8 23:13:13 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 153029526957030.856792086561768; Fri, 29 Jun 2018 11:01:09 -0700 (PDT) Received: from localhost ([::1]:43862 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYxhj-0006J8-Tn for importer@patchew.org; Fri, 29 Jun 2018 14:01:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49677) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYxaY-0000Ds-AV for qemu-devel@nongnu.org; Fri, 29 Jun 2018 13:53:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fYxaX-0008PB-DS for qemu-devel@nongnu.org; Fri, 29 Jun 2018 13:53:42 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:53416 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 1fYxaX-0008Ov-9K for qemu-devel@nongnu.org; Fri, 29 Jun 2018 13:53:41 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C2F6687A6E; Fri, 29 Jun 2018 17:53:40 +0000 (UTC) Received: from localhost (ovpn-116-50.ams2.redhat.com [10.36.116.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id 54F0921B5848; Fri, 29 Jun 2018 17:53:40 +0000 (UTC) From: Stefan Hajnoczi To: Date: Fri, 29 Jun 2018 18:53:22 +0100 Message-Id: <20180629175330.19391-4-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.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Fri, 29 Jun 2018 17:53:40 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Fri, 29 Jun 2018 17:53:40 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.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 03/11] sdcard: Reduce sdcard_set_blocklen() trace digits 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 Per the Physical Layer Simplified Spec. "5.3 CSD Register": "The maximum block length might therefore be in the range 512...2048 byte= s" Therefore 3 hexdigits are enough to report the block length. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Stefan Hajnoczi --- hw/sd/trace-events | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/sd/trace-events b/hw/sd/trace-events index bfd1d62efc..d7880bcea5 100644 --- a/hw/sd/trace-events +++ b/hw/sd/trace-events @@ -37,7 +37,7 @@ sdcard_powerup(void) "" sdcard_inquiry_cmd41(void) "" sdcard_set_enable(bool current_state, bool new_state) "%u -> %u" sdcard_reset(void) "" -sdcard_set_blocklen(uint16_t length) "0x%04x" +sdcard_set_blocklen(uint16_t length) "0x%03x" sdcard_inserted(bool readonly) "read_only: %u" sdcard_ejected(void) "" sdcard_erase(void) "" --=20 2.17.1 From nobody Sun Feb 8 23:13:13 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 1530295435218194.69756477941178; Fri, 29 Jun 2018 11:03:55 -0700 (PDT) Received: from localhost ([::1]:43875 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYxkK-00084n-JP for importer@patchew.org; Fri, 29 Jun 2018 14:03:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49689) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYxaZ-0000FF-Vv for qemu-devel@nongnu.org; Fri, 29 Jun 2018 13:53:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fYxaZ-0008RQ-4I for qemu-devel@nongnu.org; Fri, 29 Jun 2018 13:53:44 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:53428 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 1fYxaZ-0008QV-0G for qemu-devel@nongnu.org; Fri, 29 Jun 2018 13:53:43 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4EA95F68AB; Fri, 29 Jun 2018 17:53:42 +0000 (UTC) Received: from localhost (ovpn-116-50.ams2.redhat.com [10.36.116.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id F115B111671B; Fri, 29 Jun 2018 17:53:41 +0000 (UTC) From: Stefan Hajnoczi To: Date: Fri, 29 Jun 2018 18:53:23 +0100 Message-Id: <20180629175330.19391-5-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.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Fri, 29 Jun 2018 17:53:42 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Fri, 29 Jun 2018 17:53:42 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.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 04/11] hw/char/serial: Convert from DPRINTF macro to 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/char/serial.c | 5 +++-- hw/char/trace-events | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/hw/char/serial.c b/hw/char/serial.c index 605b0d02f9..26f53ba02f 100644 --- a/hw/char/serial.c +++ b/hw/char/serial.c @@ -29,6 +29,7 @@ #include "qapi/error.h" #include "qemu/timer.h" #include "qemu/error-report.h" +#include "trace.h" =20 //#define DEBUG_SERIAL =20 @@ -335,7 +336,7 @@ static void serial_ioport_write(void *opaque, hwaddr ad= dr, uint64_t val, SerialState *s =3D opaque; =20 addr &=3D 7; - DPRINTF("write addr=3D0x%" HWADDR_PRIx " val=3D0x%" PRIx64 "\n", addr,= val); + trace_serial_ioport_write(addr, val); switch(addr) { default: case 0: @@ -548,7 +549,7 @@ static uint64_t serial_ioport_read(void *opaque, hwaddr= addr, unsigned size) ret =3D s->scr; break; } - DPRINTF("read addr=3D0x%" HWADDR_PRIx " val=3D0x%02x\n", addr, ret); + trace_serial_ioport_read(addr, ret); return ret; } =20 diff --git a/hw/char/trace-events b/hw/char/trace-events index ebd8a92450..158957627e 100644 --- a/hw/char/trace-events +++ b/hw/char/trace-events @@ -1,5 +1,9 @@ # See docs/devel/tracing.txt for syntax documentation. =20 +# hw/char/serial.c +serial_ioport_read(uint16_t addr, uint8_t value) "read addr 0x%02x val 0x%= 02x" +serial_ioport_write(uint16_t addr, uint8_t value) "write addr 0x%02x val 0= x%02x" + # hw/char/virtio-serial-bus.c virtio_serial_send_control_event(unsigned int port, uint16_t event, uint16= _t value) "port %u, event %u, value %u" virtio_serial_throttle_port(unsigned int port, bool throttle) "port %u, th= rottle %d" --=20 2.17.1 From nobody Sun Feb 8 23:13:13 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 1530295518626872.2479785880764; Fri, 29 Jun 2018 11:05:18 -0700 (PDT) Received: from localhost ([::1]:43887 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYxli-0000XK-6h for importer@patchew.org; Fri, 29 Jun 2018 14:05:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49706) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYxab-0000GU-IA for qemu-devel@nongnu.org; Fri, 29 Jun 2018 13:53:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fYxaa-0008TG-Ew for qemu-devel@nongnu.org; Fri, 29 Jun 2018 13:53:45 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:40230 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 1fYxaa-0008Sj-9U for qemu-devel@nongnu.org; Fri, 29 Jun 2018 13:53:44 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A8EA94074459; Fri, 29 Jun 2018 17:53:43 +0000 (UTC) Received: from localhost (ovpn-116-50.ams2.redhat.com [10.36.116.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5BF971102E29; Fri, 29 Jun 2018 17:53:43 +0000 (UTC) From: Stefan Hajnoczi To: Date: Fri, 29 Jun 2018 18:53:24 +0100 Message-Id: <20180629175330.19391-6-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.3 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:43 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Fri, 29 Jun 2018 17:53:43 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.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 05/11] hw/char/parallel: Convert from pdebug() macro to 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/char/parallel.c | 16 +++++++++++++--- hw/char/trace-events | 4 ++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/hw/char/parallel.c b/hw/char/parallel.c index 35748e6c1b..a80da47ecf 100644 --- a/hw/char/parallel.c +++ b/hw/char/parallel.c @@ -30,6 +30,7 @@ #include "hw/isa/isa.h" #include "hw/char/parallel.h" #include "sysemu/sysemu.h" +#include "trace.h" =20 //#define DEBUG_PARALLEL =20 @@ -110,9 +111,8 @@ parallel_ioport_write_sw(void *opaque, uint32_t addr, u= int32_t val) { ParallelState *s =3D opaque; =20 - pdebug("write addr=3D0x%02x val=3D0x%02x\n", addr, val); - addr &=3D 7; + trace_parallel_ioport_write("SW", addr, val); switch(addr) { case PARA_REG_DATA: s->dataw =3D val; @@ -157,6 +157,7 @@ static void parallel_ioport_write_hw(void *opaque, uint= 32_t addr, uint32_t val) s->last_read_offset =3D ~0U; =20 addr &=3D 7; + trace_parallel_ioport_write("HW", addr, val); switch(addr) { case PARA_REG_DATA: if (s->dataw =3D=3D val) @@ -230,6 +231,8 @@ parallel_ioport_eppdata_write_hw2(void *opaque, uint32_= t addr, uint32_t val) struct ParallelIOArg ioarg =3D { .buffer =3D &eppdata, .count =3D sizeof(eppdata) }; + + trace_parallel_ioport_write("EPP", addr, val); if ((s->control & (PARA_CTR_DIR|PARA_CTR_SIGNAL)) !=3D PARA_CTR_INIT) { /* Controls not correct for EPP data cycle, so do nothing */ pdebug("we%04x s\n", val); @@ -253,6 +256,8 @@ parallel_ioport_eppdata_write_hw4(void *opaque, uint32_= t addr, uint32_t val) struct ParallelIOArg ioarg =3D { .buffer =3D &eppdata, .count =3D sizeof(eppdata) }; + + trace_parallel_ioport_write("EPP", addr, val); if ((s->control & (PARA_CTR_DIR|PARA_CTR_SIGNAL)) !=3D PARA_CTR_INIT) { /* Controls not correct for EPP data cycle, so do nothing */ pdebug("we%08x s\n", val); @@ -299,7 +304,7 @@ static uint32_t parallel_ioport_read_sw(void *opaque, u= int32_t addr) ret =3D s->control; break; } - pdebug("read addr=3D0x%02x val=3D0x%02x\n", addr, ret); + trace_parallel_ioport_read("SW", addr, ret); return ret; } =20 @@ -371,6 +376,7 @@ static uint32_t parallel_ioport_read_hw(void *opaque, u= int32_t addr) } break; } + trace_parallel_ioport_read("HW", addr, ret); s->last_read_offset =3D addr; return ret; } @@ -399,6 +405,7 @@ parallel_ioport_eppdata_read_hw2(void *opaque, uint32_t= addr) } else pdebug("re%04x\n", ret); + trace_parallel_ioport_read("EPP", addr, ret); return ret; } =20 @@ -426,11 +433,13 @@ parallel_ioport_eppdata_read_hw4(void *opaque, uint32= _t addr) } else pdebug("re%08x\n", ret); + trace_parallel_ioport_read("EPP", addr, ret); return ret; } =20 static void parallel_ioport_ecp_write(void *opaque, uint32_t addr, uint32_= t val) { + trace_parallel_ioport_write("ECP", addr & 7, val); pdebug("wecp%d=3D%02x\n", addr & 7, val); } =20 @@ -438,6 +447,7 @@ static uint32_t parallel_ioport_ecp_read(void *opaque, = uint32_t addr) { uint8_t ret =3D 0xff; =20 + trace_parallel_ioport_read("ECP", addr & 7, ret); pdebug("recp%d:%02x\n", addr & 7, ret); return ret; } diff --git a/hw/char/trace-events b/hw/char/trace-events index 158957627e..b64213d4dd 100644 --- a/hw/char/trace-events +++ b/hw/char/trace-events @@ -1,5 +1,9 @@ # See docs/devel/tracing.txt for syntax documentation. =20 +# hw/char/parallel.c +parallel_ioport_read(const char *desc, uint16_t addr, uint8_t value) "read= [%s] addr 0x%02x val 0x%02x" +parallel_ioport_write(const char *desc, uint16_t addr, uint8_t value) "wri= te [%s] addr 0x%02x val 0x%02x" + # hw/char/serial.c serial_ioport_read(uint16_t addr, uint8_t value) "read addr 0x%02x val 0x%= 02x" serial_ioport_write(uint16_t addr, uint8_t value) "write addr 0x%02x val 0= x%02x" --=20 2.17.1 From nobody Sun Feb 8 23:13:13 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 1530294947562859.1799073702527; Fri, 29 Jun 2018 10:55:47 -0700 (PDT) Received: from localhost ([::1]:43826 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYxcY-0001Uf-Pc for importer@patchew.org; Fri, 29 Jun 2018 13:55:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49746) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYxag-0000JD-FE 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 1fYxab-0008UT-FY for qemu-devel@nongnu.org; Fri, 29 Jun 2018 13:53:50 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:40242 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 1fYxab-0008Tl-AP for qemu-devel@nongnu.org; Fri, 29 Jun 2018 13:53:45 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C63B34075172; Fri, 29 Jun 2018 17:53:44 +0000 (UTC) Received: from localhost (ovpn-116-50.ams2.redhat.com [10.36.116.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7683621B5848; Fri, 29 Jun 2018 17:53:44 +0000 (UTC) From: Stefan Hajnoczi To: Date: Fri, 29 Jun 2018 18:53:25 +0100 Message-Id: <20180629175330.19391-7-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.6 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:44 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Fri, 29 Jun 2018 17:53:44 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.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 06/11] hw/input/tsc2005: Convert a fprintf() call to 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/input/tsc2005.c | 7 +++---- hw/input/trace-events | 3 +++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/input/tsc2005.c b/hw/input/tsc2005.c index 4dd95596ab..2b9108a193 100644 --- a/hw/input/tsc2005.c +++ b/hw/input/tsc2005.c @@ -24,6 +24,7 @@ #include "qemu/timer.h" #include "ui/console.h" #include "hw/devices.h" +#include "trace.h" =20 #define TSC_CUT_RESOLUTION(value, p) ((value) >> (16 - (p ? 12 : 10))) =20 @@ -201,8 +202,7 @@ static void tsc2005_write(TSC2005State *s, int reg, uin= t16_t data) s->host_mode =3D (data >> 15) !=3D 0; if (s->enabled !=3D !(data & 0x4000)) { s->enabled =3D !(data & 0x4000); - fprintf(stderr, "%s: touchscreen sense %sabled\n", - __func__, s->enabled ? "en" : "dis"); + trace_tsc2005_sense(s->enabled ? "enabled" : "disabled"); if (s->busy && !s->enabled) timer_del(s->timer); s->busy =3D s->busy && s->enabled; @@ -340,8 +340,7 @@ static uint8_t tsc2005_txrx_word(void *opaque, uint8_t = value) s->nextprecision =3D (value >> 2) & 1; if (s->enabled !=3D !(value & 1)) { s->enabled =3D !(value & 1); - fprintf(stderr, "%s: touchscreen sense %sabled\n", - __func__, s->enabled ? "en" : "dis"); + trace_tsc2005_sense(s->enabled ? "enabled" : "disabled= "); if (s->busy && !s->enabled) timer_del(s->timer); s->busy =3D s->busy && s->enabled; diff --git a/hw/input/trace-events b/hw/input/trace-events index db72484a25..3965a842ae 100644 --- a/hw/input/trace-events +++ b/hw/input/trace-events @@ -41,5 +41,8 @@ milkymist_softusb_pulse_irq(void) "Pulse IRQ" hid_kbd_queue_full(void) "queue full" hid_kbd_queue_empty(void) "queue empty" =20 +# hw/input/tsc2005.c +tsc2005_sense(const char *state) "touchscreen sense %s" + # hw/input/virtio virtio_input_queue_full(void) "queue full" --=20 2.17.1 From nobody Sun Feb 8 23:13:13 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 From nobody Sun Feb 8 23:13:13 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 1530295082960477.6771660323154; Fri, 29 Jun 2018 10:58:02 -0700 (PDT) Received: from localhost ([::1]:43840 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYxek-0003XT-6j for importer@patchew.org; Fri, 29 Jun 2018 13:58:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49745) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYxag-0000JB-Et 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 1fYxae-00005t-TX for qemu-devel@nongnu.org; Fri, 29 Jun 2018 13:53:50 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:40264 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 1fYxae-00005Y-OM for qemu-devel@nongnu.org; Fri, 29 Jun 2018 13:53:48 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3D3784077B74; Fri, 29 Jun 2018 17:53:48 +0000 (UTC) Received: from localhost (ovpn-116-50.ams2.redhat.com [10.36.116.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7D9B51D089; Fri, 29 Jun 2018 17:53:47 +0000 (UTC) From: Stefan Hajnoczi To: Date: Fri, 29 Jun 2018 18:53:27 +0100 Message-Id: <20180629175330.19391-9-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.79 on 10.11.54.5 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:48 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Fri, 29 Jun 2018 17:53:48 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.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 08/11] hw/net/ne2000: Convert printf() calls to 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 | 8 ++------ hw/net/trace-events | 2 ++ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/hw/net/ne2000.c b/hw/net/ne2000.c index 26b234b7eb..07d79e317f 100644 --- a/hw/net/ne2000.c +++ b/hw/net/ne2000.c @@ -277,9 +277,7 @@ static void ne2000_ioport_write(void *opaque, uint32_t = addr, uint32_t val) int offset, page, index; =20 addr &=3D 0xf; -#ifdef DEBUG_NE2000 - printf("NE2000: write addr=3D0x%x val=3D0x%02x\n", addr, val); -#endif + trace_ne2000_ioport_write(addr, val); if (addr =3D=3D E8390_CMD) { /* control register */ s->cmd =3D val; @@ -442,9 +440,7 @@ static uint32_t ne2000_ioport_read(void *opaque, uint32= _t addr) break; } } -#ifdef DEBUG_NE2000 - printf("NE2000: read addr=3D0x%x val=3D%02x\n", addr, ret); -#endif + trace_ne2000_ioport_read(addr, ret); return ret; } =20 diff --git a/hw/net/trace-events b/hw/net/trace-events index 95a1de01e9..f57010df37 100644 --- a/hw/net/trace-events +++ b/hw/net/trace-events @@ -26,6 +26,8 @@ mipsnet_irq(uint32_t isr, uint32_t intctl) "set irq to %d= (0x%02x)" # 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 +ne2000_ioport_read(uint64_t addr, uint64_t val) "io read addr=3D0x%02" PRI= x64 " val=3D0x%02" PRIx64 +ne2000_ioport_write(uint64_t addr, uint64_t val) "io write addr=3D0x%02" P= RIx64 " val=3D0x%02" PRIx64 =20 # hw/net/opencores_eth.c open_eth_mii_write(unsigned idx, uint16_t v) "MII[0x%02x] <- 0x%04x" --=20 2.17.1 From nobody Sun Feb 8 23:13:13 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 1530295084299826.2333447092079; Fri, 29 Jun 2018 10:58:04 -0700 (PDT) Received: from localhost ([::1]:43841 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYxel-0003ZO-Gi for importer@patchew.org; Fri, 29 Jun 2018 13:58:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49772) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYxaj-0000LP-P4 for qemu-devel@nongnu.org; Fri, 29 Jun 2018 13:53:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fYxai-0000B2-Ta for qemu-devel@nongnu.org; Fri, 29 Jun 2018 13:53:53 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:40278 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 1fYxai-0000Ar-OP for qemu-devel@nongnu.org; Fri, 29 Jun 2018 13:53:52 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3F7C340796BA; Fri, 29 Jun 2018 17:53:52 +0000 (UTC) Received: from localhost (ovpn-116-50.ams2.redhat.com [10.36.116.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id 706FE1101E87; Fri, 29 Jun 2018 17:53:49 +0000 (UTC) From: Stefan Hajnoczi To: Date: Fri, 29 Jun 2018 18:53:28 +0100 Message-Id: <20180629175330.19391-10-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.3 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:52 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Fri, 29 Jun 2018 17:53:52 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.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 09/11] hw/net/etraxfs_eth: Convert printf() calls to 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 Suggested-by: Alistair Francis Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Stefan Hajnoczi --- hw/net/etraxfs_eth.c | 8 ++++---- hw/net/trace-events | 5 +++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/hw/net/etraxfs_eth.c b/hw/net/etraxfs_eth.c index 013c8d0a41..a6932432b1 100644 --- a/hw/net/etraxfs_eth.c +++ b/hw/net/etraxfs_eth.c @@ -27,6 +27,7 @@ #include "net/net.h" #include "hw/cris/etraxfs.h" #include "qemu/error-report.h" +#include "trace.h" =20 #define D(x) =20 @@ -106,7 +107,7 @@ static unsigned int tdk_read(struct qemu_phy *phy, unsi= gned int req) r =3D phy->regs[regnum]; break; } - D(printf("\n%s %x =3D reg[%d]\n", __func__, r, regnum)); + trace_mdio_phy_read(regnum, r); return r; } =20 @@ -116,7 +117,7 @@ tdk_write(struct qemu_phy *phy, unsigned int req, unsig= ned int data) int regnum; =20 regnum =3D req & 0x1f; - D(printf("%s reg[%d] =3D %x\n", __func__, regnum, data)); + trace_mdio_phy_write(regnum, data); switch (regnum) { default: phy->regs[regnum] =3D data; @@ -206,8 +207,7 @@ static void mdio_cycle(struct qemu_mdio *bus) { bus->cnt++; =20 - D(printf("mdc=3D%d mdio=3D%d state=3D%d cnt=3D%d drv=3D%d\n", - bus->mdc, bus->mdio, bus->state, bus->cnt, bus->drive)); + trace_mdio_bitbang(bus->mdc, bus->mdio, bus->state, bus->cnt, bus->dri= ve); #if 0 if (bus->mdc) { printf("%d", bus->mdio); diff --git a/hw/net/trace-events b/hw/net/trace-events index f57010df37..663bea1b74 100644 --- a/hw/net/trace-events +++ b/hw/net/trace-events @@ -1,5 +1,10 @@ # See docs/devel/tracing.txt for syntax documentation. =20 +# hw/net/etraxfs_eth.c +mdio_phy_read(int regnum, uint16_t value) "read phy_reg:%d value:0x%04x" +mdio_phy_write(int regnum, uint16_t value) "write phy_reg:%d value:0x%04x" +mdio_bitbang(bool mdc, bool mdio, int state, uint16_t cnt, unsigned int dr= ive) "bitbang mdc=3D%u mdio=3D%u state=3D%d cnt=3D%u drv=3D%d" + # hw/net/lance.c lance_mem_readw(uint64_t addr, uint32_t ret) "addr=3D0x%"PRIx64"val=3D0x%0= 4x" lance_mem_writew(uint64_t addr, uint32_t val) "addr=3D0x%"PRIx64"val=3D0x%= 04x" --=20 2.17.1 From nobody Sun Feb 8 23:13:13 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 1530295596768296.16482929981294; Fri, 29 Jun 2018 11:06:36 -0700 (PDT) Received: from localhost ([::1]:43896 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYxmy-0001FW-7P for importer@patchew.org; Fri, 29 Jun 2018 14:06:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49785) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYxal-0000N3-8M for qemu-devel@nongnu.org; Fri, 29 Jun 2018 13:53:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fYxak-0000CE-EF for qemu-devel@nongnu.org; Fri, 29 Jun 2018 13:53:55 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:42168 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 1fYxak-0000Bn-9u for qemu-devel@nongnu.org; Fri, 29 Jun 2018 13:53:54 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C1C814007874; Fri, 29 Jun 2018 17:53:53 +0000 (UTC) Received: from localhost (ovpn-116-50.ams2.redhat.com [10.36.116.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6F77221B5848; Fri, 29 Jun 2018 17:53:53 +0000 (UTC) From: Stefan Hajnoczi To: Date: Fri, 29 Jun 2018 18:53:29 +0100 Message-Id: <20180629175330.19391-11-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.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 29 Jun 2018 17:53:53 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 29 Jun 2018 17:53:53 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.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 10/11] hw/block/fdc: Convert from FLOPPY_DPRINTF() macro to 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 Reviewed-by: John Snow Signed-off-by: Stefan Hajnoczi --- hw/block/fdc.c | 6 +++--- hw/block/trace-events | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/hw/block/fdc.c b/hw/block/fdc.c index cd29e27d8f..c7b4fe9b3e 100644 --- a/hw/block/fdc.c +++ b/hw/block/fdc.c @@ -40,6 +40,7 @@ #include "sysemu/blockdev.h" #include "sysemu/sysemu.h" #include "qemu/log.h" +#include "trace.h" =20 /********************************************************/ /* debug Floppy devices */ @@ -934,7 +935,7 @@ static uint32_t fdctrl_read (void *opaque, uint32_t reg) retval =3D (uint32_t)(-1); break; } - FLOPPY_DPRINTF("read reg%d: 0x%02x\n", reg & 7, retval); + trace_fdc_ioport_read(reg, retval); =20 return retval; } @@ -943,9 +944,8 @@ static void fdctrl_write (void *opaque, uint32_t reg, u= int32_t value) { FDCtrl *fdctrl =3D opaque; =20 - FLOPPY_DPRINTF("write reg%d: 0x%02x\n", reg & 7, value); - reg &=3D 7; + trace_fdc_ioport_write(reg, value); switch (reg) { case FD_REG_DOR: fdctrl_write_dor(fdctrl, value); diff --git a/hw/block/trace-events b/hw/block/trace-events index 6b9e733412..d842c45409 100644 --- a/hw/block/trace-events +++ b/hw/block/trace-events @@ -1,5 +1,9 @@ # See docs/devel/tracing.txt for syntax documentation. =20 +# hw/block/fdc.c +fdc_ioport_read(uint8_t reg, uint8_t value) "read reg 0x%02x val 0x%02x" +fdc_ioport_write(uint8_t reg, uint8_t value) "write reg 0x%02x val 0x%02x" + # hw/block/virtio-blk.c virtio_blk_req_complete(void *vdev, void *req, int status) "vdev %p req %p= status %d" virtio_blk_rw_complete(void *vdev, void *req, int ret) "vdev %p req %p ret= %d" --=20 2.17.1 From nobody Sun Feb 8 23:13:13 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 1530295221689354.6962354258395; Fri, 29 Jun 2018 11:00:21 -0700 (PDT) Received: from localhost ([::1]:43853 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYxgy-0005XC-Tm for importer@patchew.org; Fri, 29 Jun 2018 14:00:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49827) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYxas-0000V3-Qe for qemu-devel@nongnu.org; Fri, 29 Jun 2018 13:54:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fYxan-0000FN-R7 for qemu-devel@nongnu.org; Fri, 29 Jun 2018 13:54:02 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:42180 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 1fYxan-0000Ev-Kl for qemu-devel@nongnu.org; Fri, 29 Jun 2018 13:53:57 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 204AF401D781; Fri, 29 Jun 2018 17:53:57 +0000 (UTC) Received: from localhost (ovpn-116-50.ams2.redhat.com [10.36.116.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1673E1D084; Fri, 29 Jun 2018 17:53:54 +0000 (UTC) From: Stefan Hajnoczi To: Date: Fri, 29 Jun 2018 18:53:30 +0100 Message-Id: <20180629175330.19391-12-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.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 29 Jun 2018 17:53:57 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 29 Jun 2018 17:53:57 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.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 11/11] hw/block/pflash_cfi: Convert from DPRINTF() macro to 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 [Fixed lx -> PRIx64 as suggested by Philippe. --Stefan] Signed-off-by: Stefan Hajnoczi --- hw/block/pflash_cfi01.c | 42 +++++++++++++++-------------------------- hw/block/pflash_cfi02.c | 18 +++++++++--------- hw/block/trace-events | 13 +++++++++++++ 3 files changed, 37 insertions(+), 36 deletions(-) diff --git a/hw/block/pflash_cfi01.c b/hw/block/pflash_cfi01.c index e4b5b3c273..bffb4c40e7 100644 --- a/hw/block/pflash_cfi01.c +++ b/hw/block/pflash_cfi01.c @@ -47,6 +47,7 @@ #include "qemu/log.h" #include "hw/sysbus.h" #include "sysemu/sysemu.h" +#include "trace.h" =20 #define PFLASH_BUG(fmt, ...) \ do { \ @@ -120,7 +121,7 @@ static void pflash_timer (void *opaque) { pflash_t *pfl =3D opaque; =20 - DPRINTF("%s: command %02x done\n", __func__, pfl->cmd); + trace_pflash_timer_expired(pfl->cmd); /* Reset flash */ pfl->status ^=3D 0x80; memory_region_rom_device_set_romd(&pfl->mem, true); @@ -218,15 +219,14 @@ static uint32_t pflash_devid_query(pflash_t *pfl, hwa= ddr offset) switch (boff & 0xFF) { case 0: resp =3D pfl->ident0; - DPRINTF("%s: Manufacturer Code %04x\n", __func__, resp); + trace_pflash_manufacturer_id(resp); break; case 1: resp =3D pfl->ident1; - DPRINTF("%s: Device ID Code %04x\n", __func__, resp); + trace_pflash_device_id(resp); break; default: - DPRINTF("%s: Read Device Information offset=3D%x\n", __func__, - (unsigned)offset); + trace_pflash_device_info(offset); return 0; break; } @@ -251,8 +251,7 @@ static uint32_t pflash_data_read(pflash_t *pfl, hwaddr = offset, switch (width) { case 1: ret =3D p[offset]; - DPRINTF("%s: data offset " TARGET_FMT_plx " %02x\n", - __func__, offset, ret); + trace_pflash_data_read8(offset, ret); break; case 2: if (be) { @@ -262,8 +261,7 @@ static uint32_t pflash_data_read(pflash_t *pfl, hwaddr = offset, ret =3D p[offset]; ret |=3D p[offset + 1] << 8; } - DPRINTF("%s: data offset " TARGET_FMT_plx " %04x\n", - __func__, offset, ret); + trace_pflash_data_read16(offset, ret); break; case 4: if (be) { @@ -277,8 +275,7 @@ static uint32_t pflash_data_read(pflash_t *pfl, hwaddr = offset, ret |=3D p[offset + 2] << 16; ret |=3D p[offset + 3] << 24; } - DPRINTF("%s: data offset " TARGET_FMT_plx " %08x\n", - __func__, offset, ret); + trace_pflash_data_read32(offset, ret); break; default: DPRINTF("BUG in %s\n", __func__); @@ -294,11 +291,7 @@ static uint32_t pflash_read (pflash_t *pfl, hwaddr off= set, uint32_t ret; =20 ret =3D -1; - -#if 0 - DPRINTF("%s: reading offset " TARGET_FMT_plx " under cmd %02x width %d= \n", - __func__, offset, pfl->cmd, width); -#endif + trace_pflash_read(offset, pfl->cmd, width, pfl->wcycle); switch (pfl->cmd) { default: /* This should never happen : reset state & treat it as a read */ @@ -349,15 +342,14 @@ static uint32_t pflash_read (pflash_t *pfl, hwaddr of= fset, switch (boff) { case 0: ret =3D pfl->ident0 << 8 | pfl->ident1; - DPRINTF("%s: Manufacturer Code %04x\n", __func__, ret); + trace_pflash_manufacturer_id(ret); break; case 1: ret =3D pfl->ident2 << 8 | pfl->ident3; - DPRINTF("%s: Device ID Code %04x\n", __func__, ret); + trace_pflash_device_id(ret); break; default: - DPRINTF("%s: Read Device Information boff=3D%x\n", __func_= _, - (unsigned)boff); + trace_pflash_device_info(boff); ret =3D 0; break; } @@ -425,9 +417,7 @@ static inline void pflash_data_write(pflash_t *pfl, hwa= ddr offset, { uint8_t *p =3D pfl->storage; =20 - DPRINTF("%s: block write offset " TARGET_FMT_plx - " value %x counter %016" PRIx64 "\n", - __func__, offset, value, pfl->counter); + trace_pflash_data_write(offset, value, width, pfl->counter); switch (width) { case 1: p[offset] =3D value; @@ -466,9 +456,7 @@ static void pflash_write(pflash_t *pfl, hwaddr offset, =20 cmd =3D value; =20 - DPRINTF("%s: writing offset " TARGET_FMT_plx " value %08x width %d wcy= cle 0x%x\n", - __func__, offset, value, width, pfl->wcycle); - + trace_pflash_write(offset, value, width, pfl->wcycle); if (!pfl->wcycle) { /* Set the device in I/O access mode */ memory_region_rom_device_set_romd(&pfl->mem, false); @@ -656,8 +644,8 @@ static void pflash_write(pflash_t *pfl, hwaddr offset, "\n", __func__, offset, pfl->wcycle, pfl->cmd, value); =20 reset_flash: + trace_pflash_reset(); memory_region_rom_device_set_romd(&pfl->mem, true); - pfl->wcycle =3D 0; pfl->cmd =3D 0; } diff --git a/hw/block/pflash_cfi02.c b/hw/block/pflash_cfi02.c index 6c18e5e578..0f8b7b8c7b 100644 --- a/hw/block/pflash_cfi02.c +++ b/hw/block/pflash_cfi02.c @@ -43,6 +43,7 @@ #include "sysemu/block-backend.h" #include "qemu/host-utils.h" #include "hw/sysbus.h" +#include "trace.h" =20 //#define PFLASH_DEBUG #ifdef PFLASH_DEBUG @@ -124,7 +125,7 @@ static void pflash_timer (void *opaque) { pflash_t *pfl =3D opaque; =20 - DPRINTF("%s: command %02x done\n", __func__, pfl->cmd); + trace_pflash_timer_expired(pfl->cmd); /* Reset flash */ pfl->status ^=3D 0x80; if (pfl->bypass) { @@ -143,8 +144,8 @@ static uint32_t pflash_read (pflash_t *pfl, hwaddr offs= et, uint32_t ret; uint8_t *p; =20 - DPRINTF("%s: offset " TARGET_FMT_plx "\n", __func__, offset); ret =3D -1; + trace_pflash_read(offset, pfl->cmd, width, pfl->wcycle); /* Lazy reset to ROMD mode after a certain amount of read accesses */ if (!pfl->rom_mode && pfl->wcycle =3D=3D 0 && ++pfl->read_counter > PFLASH_LAZY_ROMD_THRESHOLD) { @@ -172,7 +173,7 @@ static uint32_t pflash_read (pflash_t *pfl, hwaddr offs= et, switch (width) { case 1: ret =3D p[offset]; -// DPRINTF("%s: data offset %08x %02x\n", __func__, offset, ret= ); + trace_pflash_data_read8(offset, ret); break; case 2: if (be) { @@ -182,7 +183,7 @@ static uint32_t pflash_read (pflash_t *pfl, hwaddr offs= et, ret =3D p[offset]; ret |=3D p[offset + 1] << 8; } -// DPRINTF("%s: data offset %08x %04x\n", __func__, offset, ret= ); + trace_pflash_data_read16(offset, ret); break; case 4: if (be) { @@ -196,7 +197,7 @@ static uint32_t pflash_read (pflash_t *pfl, hwaddr offs= et, ret |=3D p[offset + 2] << 16; ret |=3D p[offset + 3] << 24; } -// DPRINTF("%s: data offset %08x %08x\n", __func__, offset, ret= ); + trace_pflash_data_read32(offset, ret); break; } break; @@ -274,8 +275,7 @@ static void pflash_write (pflash_t *pfl, hwaddr offset, #endif goto reset_flash; } - DPRINTF("%s: offset " TARGET_FMT_plx " %08x %d %d\n", __func__, - offset, value, width, pfl->wcycle); + trace_pflash_write(offset, value, width, pfl->wcycle); offset &=3D pfl->chip_len - 1; =20 DPRINTF("%s: offset " TARGET_FMT_plx " %08x %d\n", __func__, @@ -345,8 +345,7 @@ static void pflash_write (pflash_t *pfl, hwaddr offset, /* We need another unlock sequence */ goto check_unlock0; case 0xA0: - DPRINTF("%s: write data offset " TARGET_FMT_plx " %08x %d\n", - __func__, offset, value, width); + trace_pflash_data_write(offset, value, width, 0); p =3D pfl->storage; if (!pfl->ro) { switch (width) { @@ -483,6 +482,7 @@ static void pflash_write (pflash_t *pfl, hwaddr offset, =20 /* Reset flash */ reset_flash: + trace_pflash_reset(); pfl->bypass =3D 0; pfl->wcycle =3D 0; pfl->cmd =3D 0; diff --git a/hw/block/trace-events b/hw/block/trace-events index d842c45409..335c092450 100644 --- a/hw/block/trace-events +++ b/hw/block/trace-events @@ -4,6 +4,19 @@ fdc_ioport_read(uint8_t reg, uint8_t value) "read reg 0x%02x val 0x%02x" fdc_ioport_write(uint8_t reg, uint8_t value) "write reg 0x%02x val 0x%02x" =20 +# hw/block/pflash_cfi0?.c +pflash_reset(void) "reset" +pflash_read(uint64_t offset, uint8_t cmd, int width, uint8_t wcycle) "offs= et:0x%04"PRIx64" cmd:0x%02x width:%d wcycle:%u" +pflash_write(uint64_t offset, uint32_t value, int width, uint8_t wcycle) "= offset:0x%04"PRIx64" value:0x%03x width:%d wcycle:%u" +pflash_timer_expired(uint8_t cmd) "command 0x%02x done" +pflash_data_read8(uint64_t offset, uint32_t value) "data offset:0x%04"PRIx= 64" value:0x%02x" +pflash_data_read16(uint64_t offset, uint32_t value) "data offset:0x%04"PRI= x64" value:0x%04x" +pflash_data_read32(uint64_t offset, uint32_t value) "data offset:0x%04"PRI= x64" value:0x%08x" +pflash_data_write(uint64_t offset, uint32_t value, int width, uint64_t cou= nter) "data offset:0x%04"PRIx64" value:0x%08x width:%d counter:0x%016"PRIx64 +pflash_manufacturer_id(uint16_t id) "Read Manufacturer ID: 0x%04x" +pflash_device_id(uint16_t id) "Read Device ID: 0x%04x" +pflash_device_info(uint64_t offset) "Read Device Information offset:0x%04"= PRIx64 + # hw/block/virtio-blk.c virtio_blk_req_complete(void *vdev, void *req, int status) "vdev %p req %p= status %d" virtio_blk_rw_complete(void *vdev, void *req, int ret) "vdev %p req %p ret= %d" --=20 2.17.1