]> git.proxmox.com Git - mirror_qemu.git/commitdiff
input: Add trace event for empty keyboard queue
authorAlexander Graf <agraf@suse.de>
Thu, 30 Mar 2017 14:22:55 +0000 (16:22 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Wed, 3 May 2017 12:20:12 +0000 (14:20 +0200)
When driving QEMU from the outside, we have basically no chance to
determine how quickly the guest OS picks up key events, so we usually
have to limit ourselves to very slow keyboard presses to make sure
the guest always has enough chance to pick them up.

This patch adds a trace events when the keyboarde queue is drained.
An external driver can use that as hint that new keys can be pressed.

Signed-off-by: Alexander Graf <agraf@suse.de>
Message-id: 1490883775-94658-1-git-send-email-agraf@suse.de
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/input/hid.c
hw/input/trace-events

index fa9cc4c61630e0f562137081dae41a6f7db53b2b..93887ecc43acce453e8aa977be18d451e7d9a247 100644 (file)
@@ -256,6 +256,10 @@ static void hid_keyboard_process_keycode(HIDState *hs)
     slot = hs->head & QUEUE_MASK; QUEUE_INCR(hs->head); hs->n--;
     keycode = hs->kbd.keycodes[slot];
 
+    if (!hs->n) {
+        trace_hid_kbd_queue_empty();
+    }
+
     key = keycode & 0x7f;
     index = key | ((hs->kbd.modifiers & (1 << 8)) >> 1);
     hid_code = hid_usage_keys[index];
index f3bfbede5c4363f1cd8aa71144f914e2044160a4..5a87818b4929a3a9b4672cfd61e92c22e9b2b030 100644 (file)
@@ -24,6 +24,7 @@ milkymist_softusb_pulse_irq(void) "Pulse IRQ"
 
 # hw/input/hid.c
 hid_kbd_queue_full(void) "queue full"
+hid_kbd_queue_empty(void) "queue empty"
 
 # hw/input/virtio
 virtio_input_queue_full(void) "queue full"