* [Qemu-devel] [PATCH] pckbd: Convert DPRINTF->trace
@ 2018-10-16 11:22 Dr. David Alan Gilbert (git)
2018-10-16 16:08 ` Philippe Mathieu-Daudé
2018-10-17 9:37 ` Stefan Hajnoczi
0 siblings, 2 replies; 3+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2018-10-16 11:22 UTC (permalink / raw)
To: qemu-devel
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
hw/input/pckbd.c | 19 ++++++-------------
hw/input/trace-events | 7 +++++++
2 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c
index 07c8801387..3d9eded323 100644
--- a/hw/input/pckbd.c
+++ b/hw/input/pckbd.c
@@ -30,14 +30,7 @@
#include "hw/input/i8042.h"
#include "sysemu/sysemu.h"
-/* debug PC keyboard */
-//#define DEBUG_KBD
-#ifdef DEBUG_KBD
-#define DPRINTF(fmt, ...) \
- do { printf("KBD: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...)
-#endif
+#include "trace.h"
/* Keyboard Controller Commands */
#define KBD_CCMD_READ_MODE 0x20 /* Read mode bits */
@@ -210,7 +203,7 @@ static uint64_t kbd_read_status(void *opaque, hwaddr addr,
KBDState *s = opaque;
int val;
val = s->status;
- DPRINTF("kbd: read status=0x%02x\n", val);
+ trace_pckbd_kbd_read_status(val);
return val;
}
@@ -224,7 +217,7 @@ static void kbd_queue(KBDState *s, int b, int aux)
static void outport_write(KBDState *s, uint32_t val)
{
- DPRINTF("kbd: write outport=0x%02x\n", val);
+ trace_pckbd_outport_write(val);
s->outport = val;
qemu_set_irq(s->a20_out, (val >> 1) & 1);
if (!(val & 1)) {
@@ -237,7 +230,7 @@ static void kbd_write_command(void *opaque, hwaddr addr,
{
KBDState *s = opaque;
- DPRINTF("kbd: write cmd=0x%02" PRIx64 "\n", val);
+ trace_pckbd_kbd_write_command(val);
/* Bits 3-0 of the output port P2 of the keyboard controller may be pulsed
* low for approximately 6 micro seconds. Bits 3-0 of the KBD_CCMD_PULSE
@@ -326,7 +319,7 @@ static uint64_t kbd_read_data(void *opaque, hwaddr addr,
else
val = ps2_read_data(s->kbd);
- DPRINTF("kbd: read data=0x%02x\n", val);
+ trace_pckbd_kbd_read_data(val);
return val;
}
@@ -335,7 +328,7 @@ static void kbd_write_data(void *opaque, hwaddr addr,
{
KBDState *s = opaque;
- DPRINTF("kbd: write data=0x%02" PRIx64 "\n", val);
+ trace_pckbd_kbd_write_data(val);
switch(s->write_cmd) {
case 0:
diff --git a/hw/input/trace-events b/hw/input/trace-events
index 3965a842ae..8e53ae5bbf 100644
--- a/hw/input/trace-events
+++ b/hw/input/trace-events
@@ -14,6 +14,13 @@ adb_mouse_readreg(int reg, uint8_t val0, uint8_t val1) "reg %d obuf[0] 0x%2.2x o
adb_mouse_request_change_addr(int devaddr) "change addr to 0x%x"
adb_mouse_request_change_addr_and_handler(int devaddr, int handler) "change addr and handler to 0x%x, 0x%x"
+# hw/input/pckbd.c
+pckbd_kbd_read_data(uint32_t val) "0x%02x"
+pckbd_kbd_read_status(int status) "0x%02x"
+pckbd_outport_write(uint32_t val) "0x%02x"
+pckbd_kbd_write_command(uint64_t val) "0x%02"PRIx64
+pckbd_kbd_write_data(uint64_t val) "0x%02"PRIx64
+
# hw/input/ps2.c
ps2_put_keycode(void *opaque, int keycode) "%p keycode 0x%02x"
ps2_keyboard_event(void *opaque, int qcode, int down, unsigned int modifier, unsigned int modifiers) "%p qcode %d down %d modifier 0x%x modifiers 0x%x"
--
2.19.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] pckbd: Convert DPRINTF->trace
2018-10-16 11:22 [Qemu-devel] [PATCH] pckbd: Convert DPRINTF->trace Dr. David Alan Gilbert (git)
@ 2018-10-16 16:08 ` Philippe Mathieu-Daudé
2018-10-17 9:37 ` Stefan Hajnoczi
1 sibling, 0 replies; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-10-16 16:08 UTC (permalink / raw)
To: Dr. David Alan Gilbert (git), qemu-devel
On 16/10/2018 13:22, Dr. David Alan Gilbert (git) wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
>
> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> ---
> hw/input/pckbd.c | 19 ++++++-------------
> hw/input/trace-events | 7 +++++++
> 2 files changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c
> index 07c8801387..3d9eded323 100644
> --- a/hw/input/pckbd.c
> +++ b/hw/input/pckbd.c
> @@ -30,14 +30,7 @@
> #include "hw/input/i8042.h"
> #include "sysemu/sysemu.h"
>
> -/* debug PC keyboard */
> -//#define DEBUG_KBD
> -#ifdef DEBUG_KBD
> -#define DPRINTF(fmt, ...) \
> - do { printf("KBD: " fmt , ## __VA_ARGS__); } while (0)
> -#else
> -#define DPRINTF(fmt, ...)
> -#endif
> +#include "trace.h"
>
> /* Keyboard Controller Commands */
> #define KBD_CCMD_READ_MODE 0x20 /* Read mode bits */
> @@ -210,7 +203,7 @@ static uint64_t kbd_read_status(void *opaque, hwaddr addr,
> KBDState *s = opaque;
> int val;
> val = s->status;
> - DPRINTF("kbd: read status=0x%02x\n", val);
> + trace_pckbd_kbd_read_status(val);
> return val;
> }
>
> @@ -224,7 +217,7 @@ static void kbd_queue(KBDState *s, int b, int aux)
>
> static void outport_write(KBDState *s, uint32_t val)
> {
> - DPRINTF("kbd: write outport=0x%02x\n", val);
> + trace_pckbd_outport_write(val);
> s->outport = val;
> qemu_set_irq(s->a20_out, (val >> 1) & 1);
> if (!(val & 1)) {
> @@ -237,7 +230,7 @@ static void kbd_write_command(void *opaque, hwaddr addr,
> {
> KBDState *s = opaque;
>
> - DPRINTF("kbd: write cmd=0x%02" PRIx64 "\n", val);
> + trace_pckbd_kbd_write_command(val);
>
> /* Bits 3-0 of the output port P2 of the keyboard controller may be pulsed
> * low for approximately 6 micro seconds. Bits 3-0 of the KBD_CCMD_PULSE
> @@ -326,7 +319,7 @@ static uint64_t kbd_read_data(void *opaque, hwaddr addr,
> else
> val = ps2_read_data(s->kbd);
>
> - DPRINTF("kbd: read data=0x%02x\n", val);
> + trace_pckbd_kbd_read_data(val);
> return val;
> }
>
> @@ -335,7 +328,7 @@ static void kbd_write_data(void *opaque, hwaddr addr,
> {
> KBDState *s = opaque;
>
> - DPRINTF("kbd: write data=0x%02" PRIx64 "\n", val);
> + trace_pckbd_kbd_write_data(val);
>
> switch(s->write_cmd) {
> case 0:
> diff --git a/hw/input/trace-events b/hw/input/trace-events
> index 3965a842ae..8e53ae5bbf 100644
> --- a/hw/input/trace-events
> +++ b/hw/input/trace-events
> @@ -14,6 +14,13 @@ adb_mouse_readreg(int reg, uint8_t val0, uint8_t val1) "reg %d obuf[0] 0x%2.2x o
> adb_mouse_request_change_addr(int devaddr) "change addr to 0x%x"
> adb_mouse_request_change_addr_and_handler(int devaddr, int handler) "change addr and handler to 0x%x, 0x%x"
>
> +# hw/input/pckbd.c
> +pckbd_kbd_read_data(uint32_t val) "0x%02x"
I usually prefer same read/write pairs, but that doesn't matter here.
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> +pckbd_kbd_read_status(int status) "0x%02x"
> +pckbd_outport_write(uint32_t val) "0x%02x"
> +pckbd_kbd_write_command(uint64_t val) "0x%02"PRIx64
> +pckbd_kbd_write_data(uint64_t val) "0x%02"PRIx64
> +
> # hw/input/ps2.c
> ps2_put_keycode(void *opaque, int keycode) "%p keycode 0x%02x"
> ps2_keyboard_event(void *opaque, int qcode, int down, unsigned int modifier, unsigned int modifiers) "%p qcode %d down %d modifier 0x%x modifiers 0x%x"
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] pckbd: Convert DPRINTF->trace
2018-10-16 11:22 [Qemu-devel] [PATCH] pckbd: Convert DPRINTF->trace Dr. David Alan Gilbert (git)
2018-10-16 16:08 ` Philippe Mathieu-Daudé
@ 2018-10-17 9:37 ` Stefan Hajnoczi
1 sibling, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2018-10-17 9:37 UTC (permalink / raw)
To: Dr. David Alan Gilbert (git); +Cc: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 408 bytes --]
On Tue, Oct 16, 2018 at 12:22:32PM +0100, Dr. David Alan Gilbert (git) wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
>
> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> ---
> hw/input/pckbd.c | 19 ++++++-------------
> hw/input/trace-events | 7 +++++++
> 2 files changed, 13 insertions(+), 13 deletions(-)
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-10-17 9:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-16 11:22 [Qemu-devel] [PATCH] pckbd: Convert DPRINTF->trace Dr. David Alan Gilbert (git)
2018-10-16 16:08 ` Philippe Mathieu-Daudé
2018-10-17 9:37 ` Stefan Hajnoczi
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.