Sound Open Firmware
Loading...
Searching...
No Matches
probe.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause
2 *
3 * Copyright(c) 2019 Intel Corporation. All rights reserved.
4 *
5 * Author: Artur Kloniecki <arturx.kloniecki@linux.intel.com>
6 */
7
8#ifndef __SOF_PROBE_PROBE_H__
9#define __SOF_PROBE_PROBE_H__
10
11#include <ipc/probe.h>
12#include <sys/types.h>
13
17typedef ssize_t(*probe_logging_hook_t)(uint8_t *buffer, size_t length);
18
19#if CONFIG_LOG_BACKEND_SOF_PROBE
20const struct log_backend *log_backend_probe_get(void);
21bool probe_is_backend_configured(void);
22#endif
23
31
32/*
33 * \brief Initialize probes subsystem
34 *
35 * param[in,optional] extraction_probe_dma - DMA associated with extraction
36 * In case extraction_probe_dma is NULL, extraction probes
37 * are unavailable.
38 */
39int probe_init(const struct probe_dma *extraction_probe_dma);
40
41/*
42 * \brief Deinitialize probes subsystem.
43 *
44 * Detach extraction DMA if was enabled. Return -EINVAL in case some probes
45 * are still in use.
46 */
47int probe_deinit(void);
48
49/*
50 * \brief Setup injection DMAs for probes.
51 *
52 * param[in] count - number of DMAs configured during this call
53 * param[in] probe_dma - Array of size 'count' with configuration data for DMAs
54 */
55int probe_dma_add(uint32_t count, const struct probe_dma *probe_dma);
56
57/*
58 * \brief Get info about connected injection DMAs
59 *
60 * param[in,out] data - reply to write data to
61 * param[in] max_size - maximum number of bytes available in data
62 */
63int probe_dma_info(struct sof_ipc_probe_info_params *data, uint32_t max_size);
64
65/*
66 * \brief Remove injection DMAs
67 *
68 * param[in] count - number of DMAs removed during this call
69 * param[in] stream_tag - array for size 'count' with stream tags associated
70 * with DMAs to be removed
71 */
72int probe_dma_remove(uint32_t count, const uint32_t *stream_tag);
73
74/*
75 * \brief Set probe points
76 *
77 * param[in] count - number of probe points configured this call
78 * param[in] probe - array of size 'count' with configuration of probe points
79 */
80int probe_point_add(uint32_t count, const struct probe_point *probe);
81
82/*
83 * \brief Get info about connected probe points
84 *
85 * param[in,out] data - reply to write data to
86 * param[in] max_size - maximum number of bytes available in data
87 */
88int probe_point_info(struct sof_ipc_probe_info_params *data, uint32_t max_size);
89
90/*
91 * \brief Remove probe points
92 *
93 * param[in] count - number of probe points removed this call
94 * param[in] buffer_id - array of size 'count' with IDs of buffers to which
95 * probes were attached
96 */
97int probe_point_remove(uint32_t count, const uint32_t *buffer_id);
98
103static inline struct probe_pdata *probe_get(void)
104{
105 return sof_get()->probe;
106}
107
108#endif /* __SOF_PROBE_PROBE_H__ */
uint32_t data[]
Definition debug_stream_slot.h:2
int probe_dma_info(struct sof_ipc_probe_info_params *data, uint32_t max_size)
void probe_logging_init(probe_logging_hook_t hook)
Initialize the probe logging backend.
int probe_deinit(void)
int probe_dma_add(uint32_t count, const struct probe_dma *probe_dma)
int probe_dma_remove(uint32_t count, const uint32_t *stream_tag)
int probe_point_info(struct sof_ipc_probe_info_params *data, uint32_t max_size)
ssize_t(* probe_logging_hook_t)(uint8_t *buffer, size_t length)
A buffer of logging data is available for processing.
Definition probe.h:17
int probe_init(const struct probe_dma *extraction_probe_dma)
int probe_point_remove(uint32_t count, const uint32_t *buffer_id)
int probe_point_add(uint32_t count, const struct probe_point *probe)
static struct probe_pdata * probe_get(void)
Retrieves probes structure.
Definition probe.h:103
struct probe_pdata * probe
Definition sof.h:61
struct sof * sof_get(void)
struct probe_pdata * probe
Definition sof.h:106
uint32_t length
Definition tlv.h:1