diff mbox

[10/26] sdcard: use more detailled state/mode trace events

Message ID 20171213232025.24503-11-f4bug@amsat.org (mailing list archive)
State New, archived
Headers show

Commit Message

Philippe Mathieu-Daudé Dec. 13, 2017, 11:20 p.m. UTC
sd_set_mode() can now use sd_state_name(),
and sd_set_state() use sd_mode_name().

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/sd/sd.c         | 6 ++++--
 hw/sd/trace-events | 4 ++--
 2 files changed, 6 insertions(+), 4 deletions(-)
diff mbox

Patch

diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index bd4a896cba..c1ed7b59f1 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -161,7 +161,8 @@  static const char *sd_state_name(enum SDCardStates state)
 static void sd_set_mode(SDState *sd, enum SDCardModes mode)
 {
     if (sd->mode != mode) {
-        trace_sdcard_set_mode(sd_mode_name(sd->mode), sd_mode_name(mode));
+        trace_sdcard_set_mode(sd_mode_name(sd->mode), sd_mode_name(mode),
+                              sd_state_name(sd->state));
         sd->mode = mode;
     }
 }
@@ -193,7 +194,8 @@  static void sd_update_mode(SDState *sd)
 static void sd_set_state(SDState *sd, enum SDCardStates state)
 {
     if (sd->state != state) {
-        trace_sdcard_set_state(sd_state_name(sd->state), sd_state_name(state));
+        trace_sdcard_set_state(sd_state_name(sd->state), sd_state_name(state),
+                               sd_mode_name(sd->mode));
         sd->state = state;
     }
 }
diff --git a/hw/sd/trace-events b/hw/sd/trace-events
index 2677c2195d..db5a5e62f2 100644
--- a/hw/sd/trace-events
+++ b/hw/sd/trace-events
@@ -22,8 +22,8 @@  sdhci_write_dataport(uint16_t data_count) "write buffer filled with %u bytes of
 sdhci_led(bool state) "LED: %u"
 
 # hw/sd/sd.c
-sdcard_set_mode(const char *current_mode, const char *new_mode) "%s -> %s"
-sdcard_set_state(const char *current_state, const char *new_state) "%s -> %s"
+sdcard_set_mode(const char *current_mode, const char *new_mode, const char *state) "%s -> %s (state: %s)"
+sdcard_set_state(const char *current_state, const char *new_state, const char *mode) "%s -> %s (mode: %s)"
 
 # hw/sd/milkymist-memcard.c
 milkymist_memcard_memory_read(uint32_t addr, uint32_t value) "addr 0x%08x value 0x%08x"