From nobody Tue Feb 10 18:55:39 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1593164025; cv=none; d=zohomail.com; s=zohoarc; b=NJQMaaLq4xmJQTruffChOVsDnyocb/ayUll12Zh0syBcWhfLm5gtcvaeMUjdNt+bemdel08BnUylp29LhId5wvrQPd7YJpKJ8ngIoTatZHc/z3sqa92uMlD4RktdoLwpJH5okZXqQ5o+iJCDsUWgLFYdyZvGxf8uvQH74BZiGtc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593164025; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=RQ2QKKn1sjcg/4M/VEYCvfiMHSJrvwoSmc9KFcFvoYw=; b=DZ14CtwnVOWUBIvCQXsnPsoCYOdjvsvy1xttlyqLCachviV6e7wf6fJ996dfVy6LFyYuLL6e/AfY7QUUdHkH6m+feHPYlpRznreLIbp2yp9T/Tlts4vQtGDCgwzrry6PLwLL7CL5W27UenNC9fWbB/2CKir78rnR/JnVSa7/rLY= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1593164025451618.6181322250723; Fri, 26 Jun 2020 02:33:45 -0700 (PDT) Received: from localhost ([::1]:51854 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jokjw-0004h9-8b for importer@patchew.org; Fri, 26 Jun 2020 05:33:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55846) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jokcA-0007ad-TT; Fri, 26 Jun 2020 05:25:42 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:34400 helo=mail.default.ilande.uk0.bigv.io) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jokc8-0005qp-V1; Fri, 26 Jun 2020 05:25:42 -0400 Received: from host86-158-109-79.range86-158.btcentralplus.com ([86.158.109.79] helo=kentang.home) by mail.default.ilande.uk0.bigv.io with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jokbm-0007bz-Lg; Fri, 26 Jun 2020 10:25:23 +0100 From: Mark Cave-Ayland To: peter.maydell@linaro.org, laurent@vivier.eu, david@gibson.dropbear.id.au, qemu-devel@nongnu.org, qemu-ppc@nongnu.org Date: Fri, 26 Jun 2020 10:23:17 +0100 Message-Id: <20200626092317.3875-23-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200626092317.3875-1-mark.cave-ayland@ilande.co.uk> References: <20200626092317.3875-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 86.158.109.79 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 22/22] adb: add ADB bus trace events X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.default.ilande.uk0.bigv.io) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.default.ilande.uk0.bigv.io X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Finn Thain Acked-by: Laurent Vivier Message-Id: <20200623204936.24064-23-mark.cave-ayland@ilande.co.uk> --- hw/input/adb.c | 21 ++++++++++++++++++++- hw/input/trace-events | 7 +++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/hw/input/adb.c b/hw/input/adb.c index fe0f6c7ef3..013fcc9c54 100644 --- a/hw/input/adb.c +++ b/hw/input/adb.c @@ -29,10 +29,18 @@ #include "qemu/module.h" #include "qemu/timer.h" #include "adb-internal.h" +#include "trace.h" =20 /* error codes */ #define ADB_RET_NOTPRESENT (-2) =20 +static const char *adb_commands[] =3D { + "RESET", "FLUSH", "(Reserved 0x2)", "(Reserved 0x3)", + "Reserved (0x4)", "(Reserved 0x5)", "(Reserved 0x6)", "(Reserved 0x7)", + "LISTEN r0", "LISTEN r1", "LISTEN r2", "LISTEN r3", + "TALK r0", "TALK r1", "TALK r2", "TALK r3", +}; + static void adb_device_reset(ADBDevice *d) { qdev_reset_all(DEVICE(d)); @@ -86,9 +94,16 @@ static int do_adb_request(ADBBusState *s, uint8_t *obuf,= const uint8_t *buf, =20 int adb_request(ADBBusState *s, uint8_t *obuf, const uint8_t *buf, int len) { + int ret; + + trace_adb_bus_request(buf[0] >> 4, adb_commands[buf[0] & 0xf], len); + assert(s->autopoll_blocked); =20 - return do_adb_request(s, obuf, buf, len); + ret =3D do_adb_request(s, obuf, buf, len); + + trace_adb_bus_request_done(buf[0] >> 4, adb_commands[buf[0] & 0xf], re= t); + return ret; } =20 int adb_poll(ADBBusState *s, uint8_t *obuf, uint16_t poll_mask) @@ -161,6 +176,7 @@ void adb_set_autopoll_mask(ADBBusState *s, uint16_t mas= k) void adb_autopoll_block(ADBBusState *s) { s->autopoll_blocked =3D true; + trace_adb_bus_autopoll_block(s->autopoll_blocked); =20 if (s->autopoll_enabled) { timer_del(s->autopoll_timer); @@ -170,6 +186,7 @@ void adb_autopoll_block(ADBBusState *s) void adb_autopoll_unblock(ADBBusState *s) { s->autopoll_blocked =3D false; + trace_adb_bus_autopoll_block(s->autopoll_blocked); =20 if (s->autopoll_enabled) { timer_mod(s->autopoll_timer, @@ -183,7 +200,9 @@ static void adb_autopoll(void *opaque) ADBBusState *s =3D opaque; =20 if (!s->autopoll_blocked) { + trace_adb_bus_autopoll_cb(s->autopoll_mask); s->autopoll_cb(s->autopoll_cb_opaque); + trace_adb_bus_autopoll_cb_done(s->autopoll_mask); } =20 timer_mod(s->autopoll_timer, diff --git a/hw/input/trace-events b/hw/input/trace-events index 6f0d78241c..1dd8ad6018 100644 --- a/hw/input/trace-events +++ b/hw/input/trace-events @@ -14,6 +14,13 @@ adb_device_mouse_readreg(int reg, uint8_t val0, uint8_t = val1) "reg %d obuf[0] 0x adb_device_mouse_request_change_addr(int devaddr) "change addr to 0x%x" adb_device_mouse_request_change_addr_and_handler(int devaddr, int handler)= "change addr and handler to 0x%x, 0x%x" =20 +# adb.c +adb_bus_request(uint8_t addr, const char *cmd, int size) "device 0x%x %s c= mdsize=3D%d" +adb_bus_request_done(uint8_t addr, const char *cmd, int size) "device 0x%x= %s replysize=3D%d" +adb_bus_autopoll_block(bool blocked) "blocked: %d" +adb_bus_autopoll_cb(uint16_t mask) "executing autopoll_cb with autopoll ma= sk 0x%x" +adb_bus_autopoll_cb_done(uint16_t mask) "done executing autopoll_cb with a= utopoll mask 0x%x" + # pckbd.c pckbd_kbd_read_data(uint32_t val) "0x%02x" pckbd_kbd_read_status(int status) "0x%02x" --=20 2.20.1