Skip to content

Commit e45078f

Browse files
author
Jyri Sarha
committed
ASoC: SOF: ipc4-pcm: Pipe instances to dev_dbg in multi_pipeline_state()
Add a dev_dbg to sof_ipc4_set_multi_pipeline_state(). The debug print lists the pipeline instance numbers that are included in the SOF_IPC4_GLB_SET_PIPELINE_STATE message. Without this log its very hard to tell what pipelines are affected. This print is very helpful when analyzing SOF logs automatically. Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
1 parent 30717ab commit e45078f

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

sound/soc/sof/ipc4-pcm.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,41 @@ sof_ipc4_sps_to_time_info(struct snd_sof_pcm_stream *sps)
5656
return stream_priv->time_info;
5757
}
5858

59+
static
60+
char *sof_ipc4_set_multi_pipeline_state_debug(struct snd_sof_dev *sdev, char *buf, size_t size,
61+
struct ipc4_pipeline_set_state_data *trigger_list)
62+
{
63+
int i, offset = 0;
64+
65+
for (i = 0; i < trigger_list->count; i++) {
66+
offset =+ snprintf(buf + offset, size - offset, " %d",
67+
trigger_list->pipeline_instance_ids[i]);
68+
69+
if (offset >= size - 1) {
70+
buf[size - 1] = '\0';
71+
break;
72+
}
73+
}
74+
return buf;
75+
}
76+
5977
static int sof_ipc4_set_multi_pipeline_state(struct snd_sof_dev *sdev, u32 state,
6078
struct ipc4_pipeline_set_state_data *trigger_list)
6179
{
6280
struct sof_ipc4_msg msg = {{ 0 }};
6381
u32 primary, ipc_size;
82+
char debug_buf[32];
6483

6584
/* trigger a single pipeline */
6685
if (trigger_list->count == 1)
6786
return sof_ipc4_set_pipeline_state(sdev, trigger_list->pipeline_instance_ids[0],
6887
state);
6988

89+
dev_dbg(sdev->dev, "Set pipelines %s to state %d %s",
90+
sof_ipc4_set_multi_pipeline_state_debug(sdev, debug_buf, sizeof(debug_buf),
91+
trigger_list),
92+
state, sof_ipc4_pipeline_state_str(state));
93+
7094
primary = state;
7195
primary |= SOF_IPC4_MSG_TYPE_SET(SOF_IPC4_GLB_SET_PIPELINE_STATE);
7296
primary |= SOF_IPC4_MSG_DIR(SOF_IPC4_MSG_REQUEST);

sound/soc/sof/ipc4-priv.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ void sof_ipc4_update_cpc_from_manifest(struct snd_sof_dev *sdev,
121121
size_t sof_ipc4_find_debug_slot_offset_by_type(struct snd_sof_dev *sdev,
122122
u32 slot_type);
123123

124-
125124
void sof_ipc4_mic_privacy_state_change(struct snd_sof_dev *sdev, bool state);
126125

127126
enum sof_ipc4_pipeline_state;

0 commit comments

Comments
 (0)