From: Titus Rwantare <titusr@google.com>
To: peter.maydell@linaro.org, minyard@acm.org, clg@redhat.com
Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org, philmd@linaro.org,
venture@google.com, wuhaotsh@google.com,
milesg@linux.vnet.ibm.com, Titus Rwantare <titusr@google.com>
Subject: [PATCH 4/6] hw/i2c: add canonical path to i2c event traces
Date: Thu, 7 Nov 2024 19:54:51 +0000 [thread overview]
Message-ID: <20241107195453.2684138-5-titusr@google.com> (raw)
In-Reply-To: <20241107195453.2684138-1-titusr@google.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Titus Rwantare <titusr@google.com>
---
hw/i2c/core.c | 8 +++++---
hw/i2c/trace-events | 2 +-
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/hw/i2c/core.c b/hw/i2c/core.c
index 4cf30b2c86..d238311776 100644
--- a/hw/i2c/core.c
+++ b/hw/i2c/core.c
@@ -161,7 +161,8 @@ static int i2c_do_start_transfer(I2CBus *bus, uint8_t address,
start condition. */
if (sc->event) {
- trace_i2c_event(event == I2C_START_SEND ? "start" : "start_async",
+ trace_i2c_event(DEVICE(s)->canonical_path,
+ event == I2C_START_SEND ? "start" : "start_async",
s->address);
rv = sc->event(s, event);
if (rv && !bus->broadcast) {
@@ -244,7 +245,7 @@ void i2c_end_transfer(I2CBus *bus)
I2CSlave *s = node->elt;
sc = I2C_SLAVE_GET_CLASS(s);
if (sc->event) {
- trace_i2c_event("finish", s->address);
+ trace_i2c_event(DEVICE(s)->canonical_path, "finish", s->address);
sc->event(s, I2C_FINISH);
}
QLIST_REMOVE(node, next);
@@ -321,7 +322,8 @@ void i2c_nack(I2CBus *bus)
QLIST_FOREACH(node, &bus->current_devs, next) {
sc = I2C_SLAVE_GET_CLASS(node->elt);
if (sc->event) {
- trace_i2c_event("nack", node->elt->address);
+ trace_i2c_event(DEVICE(node->elt)->canonical_path,
+ "nack", node->elt->address);
sc->event(node->elt, I2C_NACK);
}
}
diff --git a/hw/i2c/trace-events b/hw/i2c/trace-events
index f708a7ace1..e5f2dc643e 100644
--- a/hw/i2c/trace-events
+++ b/hw/i2c/trace-events
@@ -9,7 +9,7 @@ bitbang_i2c_data(unsigned clk, unsigned dat, unsigned old_out, unsigned new_out)
# core.c
-i2c_event(const char *event, uint8_t address) "%s(addr:0x%02x)"
+i2c_event(const char *id, const char *event, uint8_t address) "%s: %s(addr:0x%02x)"
i2c_send(uint8_t address, uint8_t data) "send(addr:0x%02x) data:0x%02x"
i2c_send_async(uint8_t address, uint8_t data) "send_async(addr:0x%02x) data:0x%02x"
i2c_recv(uint8_t address, uint8_t data) "recv(addr:0x%02x) data:0x%02x"
--
2.47.0.277.g8800431eea-goog
next prev parent reply other threads:[~2024-11-07 19:56 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-07 19:54 [PATCH 0/6] Add Quanta GSZ BMC machine and PCA I2C GPIO expanders Titus Rwantare
2024-11-07 19:54 ` [PATCH 1/6] bitops.h: add deposit16 function Titus Rwantare
2024-11-11 22:03 ` Miles Glenn
2024-11-13 15:46 ` Peter Maydell
2024-11-07 19:54 ` [PATCH 2/6] hw/gpio: add PCA953x i2c GPIO expanders Titus Rwantare
2024-11-07 19:54 ` [PATCH 3/6] hw/gpio: add PCA9536 i2c gpio expander Titus Rwantare
2024-11-07 19:54 ` Titus Rwantare [this message]
2024-11-08 14:23 ` [PATCH 4/6] hw/i2c: add canonical path to i2c event traces Corey Minyard
2024-11-07 19:54 ` [PATCH 5/6] hw/arm: imply I2C_DEVICES on NPCM7xx Titus Rwantare
2024-11-07 19:54 ` [PATCH 6/6] hw/arm: add Quanta GSZ bmc machine Titus Rwantare
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=20241107195453.2684138-5-titusr@google.com \
--to=titusr@google.com \
--cc=clg@redhat.com \
--cc=milesg@linux.vnet.ibm.com \
--cc=minyard@acm.org \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=venture@google.com \
--cc=wuhaotsh@google.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).