Skip to content

Commit ecf726f

Browse files
committed
ALSA: hda - Add tracepoint for unsolicited events
Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent d11b7fa commit ecf726f

3 files changed

Lines changed: 25 additions & 1 deletion

File tree

‎Documentation/sound/alsa/HD-Audio.txt‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,8 @@ Tracepoints
529529
The hd-audio driver gives a few basic tracepoints.
530530
`hda:hda_send_cmd` traces each CORB write while `hda:hda_get_response`
531531
traces the response from RIRB (only when read from the codec driver).
532-
`hda:hda_bus_reset` traces the bus-reset due to fatal error, etc, and
532+
`hda:hda_bus_reset` traces the bus-reset due to fatal error, etc,
533+
`hda:hda_unsol_event` traces the unsolicited events, and
533534
`hda:hda_power_down` and `hda:hda_power_up` trace the power down/up
534535
via power-saving behavior.
535536

‎sound/pci/hda/hda_codec.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,7 @@ int snd_hda_queue_unsol_event(struct hda_bus *bus, u32 res, u32 res_ex)
610610
struct hda_bus_unsolicited *unsol;
611611
unsigned int wp;
612612

613+
trace_hda_unsol_event(bus, res, res_ex);
613614
unsol = bus->unsol;
614615
if (!unsol)
615616
return 0;

‎sound/pci/hda/hda_trace.h‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,28 @@ DEFINE_EVENT(hda_power, hda_power_up,
8787
TP_ARGS(codec)
8888
);
8989

90+
TRACE_EVENT(hda_unsol_event,
91+
92+
TP_PROTO(struct hda_bus *bus, u32 res, u32 res_ex),
93+
94+
TP_ARGS(bus, res, res_ex),
95+
96+
TP_STRUCT__entry(
97+
__field( unsigned int, card )
98+
__field( u32, res )
99+
__field( u32, res_ex )
100+
),
101+
102+
TP_fast_assign(
103+
__entry->card = (bus)->card->number;
104+
__entry->res = res;
105+
__entry->res_ex = res_ex;
106+
),
107+
108+
TP_printk("[%d] res=%x, res_ex=%x", __entry->card,
109+
__entry->res, __entry->res_ex)
110+
);
111+
90112
#endif /* _TRACE_HDA_H */
91113

92114
/* This part must be outside protection */

0 commit comments

Comments
 (0)