From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: Alistair Francis <alistair.francis@xilinx.com>,
Peter Maydell <peter.maydell@linaro.org>,
Andrey Smirnov <andrew.smirnov@gmail.com>,
Igor Mitsyanko <i.mitsyanko@gmail.com>
Cc: "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
qemu-devel@nongnu.org,
"Edgar E . Iglesias" <edgar.iglesias@xilinx.com>,
"Sai Pavan Boddu" <saipava@xilinx.com>,
"Clement Deschamps" <clement.deschamps@antfield.fr>,
"Jean-Christophe Dubois" <jcd@tribudubois.net>,
"Grégory Estrade" <gregory.estrade@gmail.com>,
"Krzysztof Kozlowski" <krzk@kernel.org>,
"Andrew Baumann" <Andrew.Baumann@microsoft.com>,
"Prasad J Pandit" <pjp@fedoraproject.org>,
"Peter Crosthwaite" <crosthwaite.peter@gmail.com>,
qemu-arm@nongnu.org
Subject: [Qemu-devel] [PATCH v6 19/21] sdbus: add trace events
Date: Thu, 11 Jan 2018 17:56:24 -0300 [thread overview]
Message-ID: <20180111205626.23291-20-f4bug@amsat.org> (raw)
In-Reply-To: <20180111205626.23291-1-f4bug@amsat.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
hw/sd/core.c | 14 ++++++++++++--
hw/sd/trace-events | 5 +++++
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/hw/sd/core.c b/hw/sd/core.c
index 295dc44ab7..498284f109 100644
--- a/hw/sd/core.c
+++ b/hw/sd/core.c
@@ -23,6 +23,12 @@
#include "hw/qdev-core.h"
#include "sysemu/block-backend.h"
#include "hw/sd/sd.h"
+#include "trace.h"
+
+static inline const char *sdbus_name(SDBus *sdbus)
+{
+ return sdbus->qbus.name;
+}
static SDState *get_card(SDBus *sdbus)
{
@@ -39,6 +45,7 @@ int sdbus_do_command(SDBus *sdbus, SDRequest *req, uint8_t *response)
{
SDState *card = get_card(sdbus);
+ trace_sdbus_command(sdbus_name(sdbus), req->cmd, req->arg, req->crc);
if (card) {
SDCardClass *sc = SD_CARD_GET_CLASS(card);
@@ -52,6 +59,7 @@ void sdbus_write_data(SDBus *sdbus, uint8_t value)
{
SDState *card = get_card(sdbus);
+ trace_sdbus_write(sdbus_name(sdbus), value);
if (card) {
SDCardClass *sc = SD_CARD_GET_CLASS(card);
@@ -62,14 +70,16 @@ void sdbus_write_data(SDBus *sdbus, uint8_t value)
uint8_t sdbus_read_data(SDBus *sdbus)
{
SDState *card = get_card(sdbus);
+ uint8_t value = 0;
if (card) {
SDCardClass *sc = SD_CARD_GET_CLASS(card);
- return sc->read_data(card);
+ value = sc->read_data(card);
}
+ trace_sdbus_read(sdbus_name(sdbus), value);
- return 0;
+ return value;
}
bool sdbus_data_ready(SDBus *sdbus)
diff --git a/hw/sd/trace-events b/hw/sd/trace-events
index 0a121156a3..c0f51f11d4 100644
--- a/hw/sd/trace-events
+++ b/hw/sd/trace-events
@@ -1,5 +1,10 @@
# See docs/devel/tracing.txt for syntax documentation.
+# hw/sd/core.c
+sdbus_command(const char *bus_name, uint8_t cmd, uint32_t arg, uint8_t crc) "@%s CMD%02d arg 0x%08x crc 0x%02x"
+sdbus_read(const char *bus_name, uint8_t value) "@%s value 0x%02x"
+sdbus_write(const char *bus_name, uint8_t value) "@%s value 0x%02x"
+
# hw/sd/sdhci.c
sdhci_set_inserted(const char *level) "card state changed: %s"
sdhci_send_command(uint8_t cmd, uint32_t arg) "CMD%02u ARG[0x%08x]"
--
2.15.1
next prev parent reply other threads:[~2018-01-11 20:58 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-11 20:56 [Qemu-devel] [PATCH v6 00/21] SDHCI: clean Specs v1/v2, implement Spec v3 Philippe Mathieu-Daudé
2018-01-11 20:56 ` [Qemu-devel] [PATCH v6 01/21] sdhci: add a 'spec_version property' (default to v2) Philippe Mathieu-Daudé
2018-01-11 20:56 ` [Qemu-devel] [PATCH v6 02/21] sdhci: add basic Spec v1 capabilities Philippe Mathieu-Daudé
2018-01-13 0:00 ` Alistair Francis
2018-01-13 1:56 ` Philippe Mathieu-Daudé
2018-01-13 2:37 ` [Qemu-devel] [PATCH v6 02/21] sdhci: add basic Spec v1capabilities Alistair
2018-01-11 20:56 ` [Qemu-devel] [PATCH v6 03/21] sdhci: add max-block-length capability (Spec v1) Philippe Mathieu-Daudé
2018-01-11 20:56 ` [Qemu-devel] [PATCH v6 04/21] sdhci: add clock capabilities " Philippe Mathieu-Daudé
2018-01-12 23:55 ` Alistair Francis
2018-01-11 20:56 ` [Qemu-devel] [PATCH v6 05/21] sdhci: add DMA and 64-bit capabilities (Spec v2) Philippe Mathieu-Daudé
2018-01-13 0:34 ` Alistair Francis
2018-01-11 20:56 ` [Qemu-devel] [PATCH v6 07/21] sdhci: Fix 64-bit ADMA2 Philippe Mathieu-Daudé
2018-01-11 20:56 ` [Qemu-devel] [PATCH v6 08/21] sdhci: add v3 capabilities Philippe Mathieu-Daudé
[not found] ` <CAKmqyKOJ2eL--7o2UyptujNDxHwVVbmG50K39rZAA+VJgxML8w@mail.gmail.com>
2018-01-15 2:43 ` Philippe Mathieu-Daudé
2018-01-11 20:56 ` [Qemu-devel] [PATCH v6 09/21] sdhci: rename the hostctl1 register Philippe Mathieu-Daudé
2018-01-11 20:56 ` [Qemu-devel] [PATCH v6 10/21] hw/arm/exynos4210: implement SDHCI Spec v2 Philippe Mathieu-Daudé
2018-01-13 1:01 ` Alistair Francis
2018-01-11 20:56 ` [Qemu-devel] [PATCH v6 11/21] hw/arm/xilinx_zynq: " Philippe Mathieu-Daudé
2018-01-16 23:11 ` Alistair Francis
2018-01-11 20:56 ` [Qemu-devel] [PATCH v6 12/21] hw/arm/bcm2835_peripherals: implement SDHCI Spec v3 Philippe Mathieu-Daudé
2018-01-11 20:56 ` [Qemu-devel] [PATCH v6 13/21] hw/arm/bcm2835_peripherals: change maximum block size to 1kB Philippe Mathieu-Daudé
2018-01-11 20:56 ` [Qemu-devel] [PATCH v6 14/21] hw/arm/fsl-imx6: implement SDHCI Spec v3 Philippe Mathieu-Daudé
2018-01-11 20:56 ` [Qemu-devel] [PATCH v6 15/21] hw/arm/xilinx_zynqmp: " Philippe Mathieu-Daudé
2018-01-13 0:51 ` Alistair Francis
2018-01-11 20:56 ` [Qemu-devel] [PATCH v6 16/21] sdhci: remove the deprecated 'capareg' property Philippe Mathieu-Daudé
2018-01-11 20:56 ` [Qemu-devel] [PATCH v6 17/21] sdhci: add Spec v4.2 register definitions Philippe Mathieu-Daudé
2018-01-13 1:10 ` Alistair Francis
2018-01-11 20:56 ` [Qemu-devel] [PATCH v6 18/21] sdhci: implement the Host Control 2 register for the tunning sequence Philippe Mathieu-Daudé
2018-01-11 20:56 ` Philippe Mathieu-Daudé [this message]
2018-01-13 0:09 ` [Qemu-devel] [PATCH v6 19/21] sdbus: add trace events Alistair Francis
2018-01-11 20:56 ` [Qemu-devel] [PATCH v6 20/21] sdhci: implement UHS-I voltage switch Philippe Mathieu-Daudé
2018-01-16 23:13 ` Alistair Francis
2018-01-11 20:56 ` [Qemu-devel] [PATCH v6 21/21] sdhci: implement CMD/DAT[] fields in the Present State register Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180111205626.23291-20-f4bug@amsat.org \
--to=f4bug@amsat.org \
--cc=Andrew.Baumann@microsoft.com \
--cc=alistair.francis@xilinx.com \
--cc=andrew.smirnov@gmail.com \
--cc=clement.deschamps@antfield.fr \
--cc=crosthwaite.peter@gmail.com \
--cc=edgar.iglesias@xilinx.com \
--cc=gregory.estrade@gmail.com \
--cc=i.mitsyanko@gmail.com \
--cc=jcd@tribudubois.net \
--cc=krzk@kernel.org \
--cc=peter.maydell@linaro.org \
--cc=pjp@fedoraproject.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=saipava@xilinx.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).