diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-08-20 04:22:25 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-08-20 05:24:29 -0400 |
commit | b244d335609f9bbf4c0204a365bf03b7ac53c3c8 (patch) | |
tree | 23a0a48e14788fae844c328ff64f97e0f084f9fb /sound/pci/hda | |
parent | 6f0fa66051e92f361bd293432466f5e62832adbf (diff) |
ALSA: hda - Add tracepoints at snd_hda_power_up/down entrances.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda')
-rw-r--r-- | sound/pci/hda/hda_codec.c | 2 | ||||
-rw-r--r-- | sound/pci/hda/hda_trace.h | 24 |
2 files changed, 26 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 408babc10437..ad0101e2d4ff 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -4417,6 +4417,7 @@ static void __snd_hda_power_up(struct hda_codec *codec, bool wait_power_down) | |||
4417 | 4417 | ||
4418 | spin_lock(&codec->power_lock); | 4418 | spin_lock(&codec->power_lock); |
4419 | codec->power_count++; | 4419 | codec->power_count++; |
4420 | trace_hda_power_count(codec); | ||
4420 | /* Return if power_on or transitioning to power_on, unless currently | 4421 | /* Return if power_on or transitioning to power_on, unless currently |
4421 | * powering down. */ | 4422 | * powering down. */ |
4422 | if ((codec->power_on || codec->power_transition > 0) && | 4423 | if ((codec->power_on || codec->power_transition > 0) && |
@@ -4496,6 +4497,7 @@ void snd_hda_power_down(struct hda_codec *codec) | |||
4496 | { | 4497 | { |
4497 | spin_lock(&codec->power_lock); | 4498 | spin_lock(&codec->power_lock); |
4498 | --codec->power_count; | 4499 | --codec->power_count; |
4500 | trace_hda_power_count(codec); | ||
4499 | if (!codec->power_on || codec->power_count || codec->power_transition) { | 4501 | if (!codec->power_on || codec->power_count || codec->power_transition) { |
4500 | spin_unlock(&codec->power_lock); | 4502 | spin_unlock(&codec->power_lock); |
4501 | return; | 4503 | return; |
diff --git a/sound/pci/hda/hda_trace.h b/sound/pci/hda/hda_trace.h index 9884871ddb00..9a34b867d8c2 100644 --- a/sound/pci/hda/hda_trace.h +++ b/sound/pci/hda/hda_trace.h | |||
@@ -87,6 +87,30 @@ DEFINE_EVENT(hda_power, hda_power_up, | |||
87 | TP_ARGS(codec) | 87 | TP_ARGS(codec) |
88 | ); | 88 | ); |
89 | 89 | ||
90 | TRACE_EVENT(hda_power_count, | ||
91 | TP_PROTO(struct hda_codec *codec), | ||
92 | TP_ARGS(codec), | ||
93 | TP_STRUCT__entry( | ||
94 | __field( unsigned int, card ) | ||
95 | __field( unsigned int, addr ) | ||
96 | __field( int, power_count ) | ||
97 | __field( int, power_on ) | ||
98 | __field( int, power_transition ) | ||
99 | ), | ||
100 | |||
101 | TP_fast_assign( | ||
102 | __entry->card = (codec)->bus->card->number; | ||
103 | __entry->addr = (codec)->addr; | ||
104 | __entry->power_count = (codec)->power_count; | ||
105 | __entry->power_on = (codec)->power_on; | ||
106 | __entry->power_transition = (codec)->power_transition; | ||
107 | ), | ||
108 | |||
109 | TP_printk("[%d:%d] power_count=%d, power_on=%d, power_transition=%d", | ||
110 | __entry->card, __entry->addr, __entry->power_count, | ||
111 | __entry->power_on, __entry->power_transition) | ||
112 | ); | ||
113 | |||
90 | TRACE_EVENT(hda_unsol_event, | 114 | TRACE_EVENT(hda_unsol_event, |
91 | 115 | ||
92 | TP_PROTO(struct hda_bus *bus, u32 res, u32 res_ex), | 116 | TP_PROTO(struct hda_bus *bus, u32 res, u32 res_ex), |