qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	"Andrew Jeffery" <andrew@aj.id.au>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	qemu-arm@nongnu.org, "Cédric Le Goater" <clg@kaod.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Luc Michel" <luc.michel@greensocs.com>,
	"Joel Stanley" <joel@jms.id.au>
Subject: [PATCH v5 3/7] hw/misc/led: Emit a trace event when LED intensity has changed
Date: Thu, 10 Sep 2020 22:54:25 +0200	[thread overview]
Message-ID: <20200910205429.727766-4-f4bug@amsat.org> (raw)
In-Reply-To: <20200910205429.727766-1-f4bug@amsat.org>

Track the LED intensity, and emit a trace event when it changes.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/misc/led.c        | 4 ++++
 hw/misc/trace-events | 1 +
 2 files changed, 5 insertions(+)

diff --git a/hw/misc/led.c b/hw/misc/led.c
index 3ef4f5e0469..ebe1fa45b1e 100644
--- a/hw/misc/led.c
+++ b/hw/misc/led.c
@@ -41,6 +41,10 @@ void led_set_intensity(LEDState *s, unsigned intensity_percent)
         intensity_percent = LED_INTENSITY_PERCENT_MAX;
     }
     trace_led_set_intensity(s->description, s->color, intensity_percent);
+    if (intensity_percent != s->intensity_percent) {
+        trace_led_change_intensity(s->description, s->color,
+                                   s->intensity_percent, intensity_percent);
+    }
     s->intensity_percent = intensity_percent;
 }
 
diff --git a/hw/misc/trace-events b/hw/misc/trace-events
index 76c9ddb54fe..89d15f05f9a 100644
--- a/hw/misc/trace-events
+++ b/hw/misc/trace-events
@@ -216,6 +216,7 @@ grlib_apb_pnp_read(uint64_t addr, uint32_t value) "APB PnP read addr:0x%03"PRIx6
 
 # led.c
 led_set_intensity(const char *color, const char *desc, uint8_t intensity_percent) "LED desc:'%s' color:%s intensity: %u%%"
+led_change_intensity(const char *color, const char *desc, uint8_t old_intensity_percent, uint8_t new_intensity_percent) "LED desc:'%s' color:%s intensity %u%% -> %u%%"
 
 # pca9552.c
 pca955x_gpio_status(const char *description, const char *buf) "%s GPIOs 0-15 [%s]"
-- 
2.26.2



  parent reply	other threads:[~2020-09-10 20:57 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-10 20:54 [PATCH v5 0/7] hw/misc: Add LED device Philippe Mathieu-Daudé
2020-09-10 20:54 ` [PATCH v5 1/7] hw/misc/led: Add a " Philippe Mathieu-Daudé
2020-09-11 19:42   ` Luc Michel
2020-09-11 22:37   ` Richard Henderson
2020-09-10 20:54 ` [PATCH v5 2/7] hw/misc/led: Allow connecting from GPIO output Philippe Mathieu-Daudé
2020-09-11 19:42   ` Luc Michel
2020-09-12  9:02     ` Philippe Mathieu-Daudé
2020-09-12  9:14       ` Philippe Mathieu-Daudé
2020-09-11 22:44   ` Richard Henderson
2020-09-12  8:50     ` Philippe Mathieu-Daudé
2020-09-12 13:32       ` Philippe Mathieu-Daudé
2020-09-14  7:27       ` Markus Armbruster
2020-09-14  7:48         ` Philippe Mathieu-Daudé
2020-09-14 14:03           ` Eduardo Habkost
2020-09-14 15:05             ` Philippe Mathieu-Daudé
2020-09-14 15:56               ` Philippe Mathieu-Daudé
2020-09-10 20:54 ` Philippe Mathieu-Daudé [this message]
2020-09-11 19:43   ` [PATCH v5 3/7] hw/misc/led: Emit a trace event when LED intensity has changed Luc Michel
2020-09-10 20:54 ` [PATCH v5 4/7] hw/arm/aspeed: Add the 3 front LEDs drived by the PCA9552 #1 Philippe Mathieu-Daudé
2020-09-11 19:57   ` Luc Michel
2020-09-10 20:54 ` [PATCH v5 5/7] hw/misc/mps2-fpgaio: Use the LED device Philippe Mathieu-Daudé
2020-09-11 20:12   ` Luc Michel
2020-09-12  8:06     ` Philippe Mathieu-Daudé
2020-09-11 22:46   ` Richard Henderson
2020-09-10 20:54 ` [PATCH v5 6/7] hw/misc/mps2-scc: " Philippe Mathieu-Daudé
2020-09-11 20:15   ` Luc Michel
2020-09-11 22:47   ` Richard Henderson
2020-09-10 20:54 ` [PATCH v5 7/7] hw/arm/tosa: Replace fprintf() calls by LED devices Philippe Mathieu-Daudé
2020-09-11 19:55   ` Luc Michel
2020-09-11 22:48   ` Richard Henderson

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=20200910205429.727766-4-f4bug@amsat.org \
    --to=f4bug@amsat.org \
    --cc=andrew@aj.id.au \
    --cc=berrange@redhat.com \
    --cc=clg@kaod.org \
    --cc=ehabkost@redhat.com \
    --cc=joel@jms.id.au \
    --cc=luc.michel@greensocs.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /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).