Skip to content

Commit 1c3e34b

Browse files
ukleinekUwe Kleine-König
authored andcommitted
pwm: Make info in traces about affected pwm more useful
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Uwe Kleine-König <[email protected]>
1 parent 9407f23 commit 1c3e34b

File tree

1 file changed

+6
-4
lines changed
  • include/trace/events

1 file changed

+6
-4
lines changed

include/trace/events/pwm.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ DECLARE_EVENT_CLASS(pwm,
1515
TP_ARGS(pwm, state, err),
1616

1717
TP_STRUCT__entry(
18-
__field(struct pwm_device *, pwm)
18+
__field(unsigned int, chipid)
19+
__field(unsigned int, hwpwm)
1920
__field(u64, period)
2021
__field(u64, duty_cycle)
2122
__field(enum pwm_polarity, polarity)
@@ -24,16 +25,17 @@ DECLARE_EVENT_CLASS(pwm,
2425
),
2526

2627
TP_fast_assign(
27-
__entry->pwm = pwm;
28+
__entry->chipid = pwm->chip->id;
29+
__entry->hwpwm = pwm->hwpwm;
2830
__entry->period = state->period;
2931
__entry->duty_cycle = state->duty_cycle;
3032
__entry->polarity = state->polarity;
3133
__entry->enabled = state->enabled;
3234
__entry->err = err;
3335
),
3436

35-
TP_printk("%p: period=%llu duty_cycle=%llu polarity=%d enabled=%d err=%d",
36-
__entry->pwm, __entry->period, __entry->duty_cycle,
37+
TP_printk("pwmchip%u.%u: period=%llu duty_cycle=%llu polarity=%d enabled=%d err=%d",
38+
__entry->chipid, __entry->hwpwm, __entry->period, __entry->duty_cycle,
3739
__entry->polarity, __entry->enabled, __entry->err)
3840

3941
);

0 commit comments

Comments
 (0)