From: "Uwe Kleine-König" <u.kleine-koenig@baylibre.com>
To: Steven Rostedt <rostedt@goodmis.org>,
Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-trace-kernel@vger.kernel.org
Subject: [PATCH] pwm: Make info in traces about affected pwm more useful
Date: Fri, 5 Jul 2024 23:14:51 +0200 [thread overview]
Message-ID: <20240705211452.1157967-2-u.kleine-koenig@baylibre.com> (raw)
The hashed pointer isn't useful to identify the pwm device. Instead
store and emit chipid and hwpwm.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
include/trace/events/pwm.h | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/include/trace/events/pwm.h b/include/trace/events/pwm.h
index 12b35e4ff917..8022701c446d 100644
--- a/include/trace/events/pwm.h
+++ b/include/trace/events/pwm.h
@@ -15,7 +15,8 @@ DECLARE_EVENT_CLASS(pwm,
TP_ARGS(pwm, state, err),
TP_STRUCT__entry(
- __field(struct pwm_device *, pwm)
+ __field(unsigned int, chipid)
+ __field(unsigned int, hwpwm)
__field(u64, period)
__field(u64, duty_cycle)
__field(enum pwm_polarity, polarity)
@@ -24,7 +25,8 @@ DECLARE_EVENT_CLASS(pwm,
),
TP_fast_assign(
- __entry->pwm = pwm;
+ __entry->chipid = pwm->chip->id;
+ __entry->hwpwm = pwm->hwpwm;
__entry->period = state->period;
__entry->duty_cycle = state->duty_cycle;
__entry->polarity = state->polarity;
@@ -32,8 +34,8 @@ DECLARE_EVENT_CLASS(pwm,
__entry->err = err;
),
- TP_printk("%p: period=%llu duty_cycle=%llu polarity=%d enabled=%d err=%d",
- __entry->pwm, __entry->period, __entry->duty_cycle,
+ TP_printk("pwmchip%u.%u: period=%llu duty_cycle=%llu polarity=%d enabled=%d err=%d",
+ __entry->chipid, __entry->hwpwm, __entry->period, __entry->duty_cycle,
__entry->polarity, __entry->enabled, __entry->err)
);
base-commit: 6ba37c70795abf1d59976b3a49acafac14b72a4f
--
2.43.0
next reply other threads:[~2024-07-05 21:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-05 21:14 Uwe Kleine-König [this message]
2024-07-30 7:22 ` [PATCH] pwm: Make info in traces about affected pwm more useful Uwe Kleine-König
2024-07-30 14:39 ` Steven Rostedt
2024-07-30 15:13 ` Uwe Kleine-König
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=20240705211452.1157967-2-u.kleine-koenig@baylibre.com \
--to=u.kleine-koenig@baylibre.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=rostedt@goodmis.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