File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -338,6 +338,29 @@ static enum task_state probe_task(void *data)
338338 return SOF_TASK_STATE_RESCHEDULE ;
339339}
340340
341+ #if CONFIG_LOG_BACKEND_SOF_PROBE_OUTPUT_AUTO_ENABLE
342+ static void probe_auto_enable_logs (uint32_t stream_tag )
343+ {
344+ struct probe_point log_point = {
345+ #if CONFIG_IPC_MAJOR_4
346+ .buffer_id = {
347+ .full_id = 0 ,
348+ },
349+ #else
350+ .buffer_id = 0 ,
351+ #endif
352+ .purpose = PROBE_PURPOSE_EXTRACTION ,
353+ .stream_tag = stream_tag ,
354+ };
355+ int ret ;
356+
357+ ret = probe_point_add (1 , & log_point );
358+
359+ if (ret )
360+ tr_err (& pr_tr , "probe_auto_enable_logs() failed" );
361+ }
362+ #endif
363+
341364int probe_init (const struct probe_dma * probe_dma )
342365{
343366 struct probe_pdata * _probe = probe_get ();
@@ -402,6 +425,10 @@ int probe_init(const struct probe_dma *probe_dma)
402425 SOF_UUID (probe_task_uuid ),
403426 SOF_SCHEDULE_LL_TIMER , SOF_TASK_PRI_LOW ,
404427 probe_task , _probe , 0 , 0 );
428+
429+ #if CONFIG_LOG_BACKEND_SOF_PROBE_OUTPUT_AUTO_ENABLE
430+ probe_auto_enable_logs (probe_dma -> stream_tag );
431+ #endif
405432 } else {
406433 tr_dbg (& pr_tr , "\tno extraction DMA setup" );
407434
Original file line number Diff line number Diff line change @@ -108,6 +108,16 @@ config LOG_BACKEND_SOF_PROBE
108108 Logging is enabled by setting up a probe point with
109109 probe purpose value of PROBE_PURPOSE_LOGGING.
110110
111+ config LOG_BACKEND_SOF_PROBE_OUTPUT_AUTO_ENABLE
112+ bool "Automatically enable probes logging when probe dma is started"
113+ depends on LOG_BACKEND_SOF_PROBE
114+ help
115+ Automatically enable logging as soon as probes DMA
116+ starts. This option simplifies probes logging back
117+ end usage as there is no need to enable logs after
118+ every boot. The probes DMA is still needed before the
119+ log output can be enabled.
120+
111121config LOG_BACKEND_SOF_PROBE_OUTPUT_DICTIONARY
112122 bool "Dictionary"
113123 select LOG_DICTIONARY_SUPPORT
You can’t perform that action at this time.
0 commit comments