ALSA: hda - Add tracepoint for unsolicited events
authorTakashi Iwai <tiwai@suse.de>
Tue, 9 Aug 2011 12:22:44 +0000 (14:22 +0200)
committerTakashi Iwai <tiwai@suse.de>
Tue, 9 Aug 2011 12:24:17 +0000 (14:24 +0200)
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Documentation/sound/alsa/HD-Audio.txt
sound/pci/hda/hda_codec.c
sound/pci/hda/hda_trace.h

index ba2a155f3a30b49225128f364cf43f1dc26aeb65..850b1b3956aeb8feaa6ecb55f8e4da583461e931 100644 (file)
@@ -529,7 +529,8 @@ Tracepoints
 The hd-audio driver gives a few basic tracepoints.
 `hda:hda_send_cmd` traces each CORB write while `hda:hda_get_response`
 traces the response from RIRB (only when read from the codec driver).
-`hda:hda_bus_reset` traces the bus-reset due to fatal error, etc, and
+`hda:hda_bus_reset` traces the bus-reset due to fatal error, etc,
+`hda:hda_unsol_event` traces the unsolicited events, and
 `hda:hda_power_down` and `hda:hda_power_up` trace the power down/up
 via power-saving behavior.
 
index e105b653130dc2772829f638365226939dc5894b..2a8d447c8ed6f9dc8cc9ad707276f60f3e948bf3 100644 (file)
@@ -610,6 +610,7 @@ int snd_hda_queue_unsol_event(struct hda_bus *bus, u32 res, u32 res_ex)
        struct hda_bus_unsolicited *unsol;
        unsigned int wp;
 
+       trace_hda_unsol_event(bus, res, res_ex);
        unsol = bus->unsol;
        if (!unsol)
                return 0;
index b446cfcf60de05d090eac1418778b00c2891b0ee..9884871ddb0009f07dda1514e7576b076dfba446 100644 (file)
@@ -87,6 +87,28 @@ DEFINE_EVENT(hda_power, hda_power_up,
        TP_ARGS(codec)
 );
 
+TRACE_EVENT(hda_unsol_event,
+
+       TP_PROTO(struct hda_bus *bus, u32 res, u32 res_ex),
+
+       TP_ARGS(bus, res, res_ex),
+
+       TP_STRUCT__entry(
+               __field( unsigned int, card )
+               __field( u32, res )
+               __field( u32, res_ex )
+       ),
+
+       TP_fast_assign(
+               __entry->card = (bus)->card->number;
+               __entry->res = res;
+               __entry->res_ex = res_ex;
+       ),
+
+       TP_printk("[%d] res=%x, res_ex=%x", __entry->card,
+                 __entry->res, __entry->res_ex)
+);
+
 #endif /* _TRACE_HDA_H */
 
 /* This part must be outside protection */