Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: hda - rename hda_intel_trace.h to hda_controller_trace.h

This patch does:

1. Rename the hda_intel_trace.h to hda_controller_trace.h as
this trace is used in hda_controller.c

2. Add some trace function for pcm flow.

Signed-off-by: Libin Yang <libin.yang@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Libin Yang and committed by
Takashi Iwai
18486508 598dfb56

+103 -63
+5 -1
sound/pci/hda/hda_controller.c
··· 32 32 #include "hda_controller.h" 33 33 34 34 #define CREATE_TRACE_POINTS 35 - #include "hda_intel_trace.h" 35 + #include "hda_controller_trace.h" 36 36 37 37 /* DSP lock helpers */ 38 38 #define dsp_lock(dev) snd_hdac_dsp_lock(azx_stream(dev)) ··· 95 95 struct azx *chip = apcm->chip; 96 96 struct azx_dev *azx_dev = get_azx_dev(substream); 97 97 98 + trace_azx_pcm_close(chip, azx_dev); 98 99 mutex_lock(&chip->open_mutex); 99 100 azx_release_device(azx_dev); 100 101 if (hinfo->ops.close) ··· 114 113 struct azx_dev *azx_dev = get_azx_dev(substream); 115 114 int ret; 116 115 116 + trace_azx_pcm_hw_params(chip, azx_dev); 117 117 dsp_lock(azx_dev); 118 118 if (dsp_is_locked(azx_dev)) { 119 119 ret = -EBUSY; ··· 165 163 snd_hda_spdif_out_of_nid(apcm->codec, hinfo->nid); 166 164 unsigned short ctls = spdif ? spdif->ctls : 0; 167 165 166 + trace_azx_pcm_prepare(chip, azx_dev); 168 167 dsp_lock(azx_dev); 169 168 if (dsp_is_locked(azx_dev)) { 170 169 err = -EBUSY; ··· 406 403 snd_hda_codec_pcm_get(apcm->info); 407 404 mutex_lock(&chip->open_mutex); 408 405 azx_dev = azx_assign_device(chip, substream); 406 + trace_azx_pcm_open(chip, azx_dev); 409 407 if (azx_dev == NULL) { 410 408 err = -EBUSY; 411 409 goto unlock;
+98
sound/pci/hda/hda_controller_trace.h
··· 1 + #undef TRACE_SYSTEM 2 + #define TRACE_SYSTEM hda_controller 3 + #define TRACE_INCLUDE_FILE hda_controller_trace 4 + 5 + #if !defined(_TRACE_HDA_CONTROLLER_H) || defined(TRACE_HEADER_MULTI_READ) 6 + #define _TRACE_HDA_CONTROLLER_H 7 + 8 + #include <linux/tracepoint.h> 9 + 10 + struct azx; 11 + struct azx_dev; 12 + 13 + TRACE_EVENT(azx_pcm_trigger, 14 + 15 + TP_PROTO(struct azx *chip, struct azx_dev *dev, int cmd), 16 + 17 + TP_ARGS(chip, dev, cmd), 18 + 19 + TP_STRUCT__entry( 20 + __field( int, card ) 21 + __field( int, idx ) 22 + __field( int, cmd ) 23 + ), 24 + 25 + TP_fast_assign( 26 + __entry->card = (chip)->card->number; 27 + __entry->idx = (dev)->core.index; 28 + __entry->cmd = cmd; 29 + ), 30 + 31 + TP_printk("[%d:%d] cmd=%d", __entry->card, __entry->idx, __entry->cmd) 32 + ); 33 + 34 + TRACE_EVENT(azx_get_position, 35 + 36 + TP_PROTO(struct azx *chip, struct azx_dev *dev, unsigned int pos, unsigned int delay), 37 + 38 + TP_ARGS(chip, dev, pos, delay), 39 + 40 + TP_STRUCT__entry( 41 + __field( int, card ) 42 + __field( int, idx ) 43 + __field( unsigned int, pos ) 44 + __field( unsigned int, delay ) 45 + ), 46 + 47 + TP_fast_assign( 48 + __entry->card = (chip)->card->number; 49 + __entry->idx = (dev)->core.index; 50 + __entry->pos = pos; 51 + __entry->delay = delay; 52 + ), 53 + 54 + TP_printk("[%d:%d] pos=%u, delay=%u", __entry->card, __entry->idx, __entry->pos, __entry->delay) 55 + ); 56 + 57 + DECLARE_EVENT_CLASS(azx_pcm, 58 + TP_PROTO(struct azx *chip, struct azx_dev *azx_dev), 59 + 60 + TP_ARGS(chip, azx_dev), 61 + 62 + TP_STRUCT__entry( 63 + __field( unsigned char, stream_tag ) 64 + ), 65 + 66 + TP_fast_assign( 67 + __entry->stream_tag = (azx_dev)->core.stream_tag; 68 + ), 69 + 70 + TP_printk("stream_tag: %d", __entry->stream_tag) 71 + ); 72 + 73 + DEFINE_EVENT(azx_pcm, azx_pcm_open, 74 + TP_PROTO(struct azx *chip, struct azx_dev *azx_dev), 75 + TP_ARGS(chip, azx_dev) 76 + ); 77 + 78 + DEFINE_EVENT(azx_pcm, azx_pcm_close, 79 + TP_PROTO(struct azx *chip, struct azx_dev *azx_dev), 80 + TP_ARGS(chip, azx_dev) 81 + ); 82 + 83 + DEFINE_EVENT(azx_pcm, azx_pcm_hw_params, 84 + TP_PROTO(struct azx *chip, struct azx_dev *azx_dev), 85 + TP_ARGS(chip, azx_dev) 86 + ); 87 + 88 + DEFINE_EVENT(azx_pcm, azx_pcm_prepare, 89 + TP_PROTO(struct azx *chip, struct azx_dev *azx_dev), 90 + TP_ARGS(chip, azx_dev) 91 + ); 92 + 93 + #endif /* _TRACE_HDA_CONTROLLER_H */ 94 + 95 + /* This part must be outside protection */ 96 + #undef TRACE_INCLUDE_PATH 97 + #define TRACE_INCLUDE_PATH . 98 + #include <trace/define_trace.h>
-62
sound/pci/hda/hda_intel_trace.h
··· 1 - #undef TRACE_SYSTEM 2 - #define TRACE_SYSTEM hda_intel 3 - #define TRACE_INCLUDE_FILE hda_intel_trace 4 - 5 - #if !defined(_TRACE_HDA_INTEL_H) || defined(TRACE_HEADER_MULTI_READ) 6 - #define _TRACE_HDA_INTEL_H 7 - 8 - #include <linux/tracepoint.h> 9 - 10 - struct azx; 11 - struct azx_dev; 12 - 13 - TRACE_EVENT(azx_pcm_trigger, 14 - 15 - TP_PROTO(struct azx *chip, struct azx_dev *dev, int cmd), 16 - 17 - TP_ARGS(chip, dev, cmd), 18 - 19 - TP_STRUCT__entry( 20 - __field( int, card ) 21 - __field( int, idx ) 22 - __field( int, cmd ) 23 - ), 24 - 25 - TP_fast_assign( 26 - __entry->card = (chip)->card->number; 27 - __entry->idx = (dev)->core.index; 28 - __entry->cmd = cmd; 29 - ), 30 - 31 - TP_printk("[%d:%d] cmd=%d", __entry->card, __entry->idx, __entry->cmd) 32 - ); 33 - 34 - TRACE_EVENT(azx_get_position, 35 - 36 - TP_PROTO(struct azx *chip, struct azx_dev *dev, unsigned int pos, unsigned int delay), 37 - 38 - TP_ARGS(chip, dev, pos, delay), 39 - 40 - TP_STRUCT__entry( 41 - __field( int, card ) 42 - __field( int, idx ) 43 - __field( unsigned int, pos ) 44 - __field( unsigned int, delay ) 45 - ), 46 - 47 - TP_fast_assign( 48 - __entry->card = (chip)->card->number; 49 - __entry->idx = (dev)->core.index; 50 - __entry->pos = pos; 51 - __entry->delay = delay; 52 - ), 53 - 54 - TP_printk("[%d:%d] pos=%u, delay=%u", __entry->card, __entry->idx, __entry->pos, __entry->delay) 55 - ); 56 - 57 - #endif /* _TRACE_HDA_INTEL_H */ 58 - 59 - /* This part must be outside protection */ 60 - #undef TRACE_INCLUDE_PATH 61 - #define TRACE_INCLUDE_PATH . 62 - #include <trace/define_trace.h>