Commit ecf726f5414489fe749477eb77d6cb12bb93c8bc

Authored by Takashi Iwai
1 parent d11b7fa3d5

ALSA: hda - Add tracepoint for unsolicited events

Signed-off-by: Takashi Iwai <tiwai@suse.de>

Showing 3 changed files with 25 additions and 1 deletions Side-by-side Diff

Documentation/sound/alsa/HD-Audio.txt
... ... @@ -529,7 +529,8 @@
529 529 The hd-audio driver gives a few basic tracepoints.
530 530 `hda:hda_send_cmd` traces each CORB write while `hda:hda_get_response`
531 531 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
533 534 `hda:hda_power_down` and `hda:hda_power_up` trace the power down/up
534 535 via power-saving behavior.
535 536  
sound/pci/hda/hda_codec.c
... ... @@ -610,6 +610,7 @@
610 610 struct hda_bus_unsolicited *unsol;
611 611 unsigned int wp;
612 612  
  613 + trace_hda_unsol_event(bus, res, res_ex);
613 614 unsol = bus->unsol;
614 615 if (!unsol)
615 616 return 0;
sound/pci/hda/hda_trace.h
... ... @@ -87,6 +87,28 @@
87 87 TP_ARGS(codec)
88 88 );
89 89  
  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 +
90 112 #endif /* _TRACE_HDA_H */
91 113  
92 114 /* This part must be outside protection */