forked from thesofproject/sof
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprobe.h
More file actions
111 lines (94 loc) · 2.97 KB
/
probe.h
File metadata and controls
111 lines (94 loc) · 2.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
/* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright(c) 2019 Intel Corporation. All rights reserved.
*
* Author: Artur Kloniecki <arturx.kloniecki@linux.intel.com>
*/
#ifndef __SOF_PROBE_PROBE_H__
#define __SOF_PROBE_PROBE_H__
#if CONFIG_PROBE
#include <ipc/probe.h>
/**
* A buffer of logging data is available for processing.
*/
typedef void(*probe_logging_hook_t)(uint8_t *buffer, size_t length);
#if CONFIG_LOG_BACKEND_SOF_PROBE
void probe_logging_hook(uint8_t *buffer, size_t length);
const struct log_backend *log_backend_probe_get(void);
#endif
/**
* @brief Initialize the probe logging backend.
*
* @param hook Function is called when new logging data is written
* out by the logger.
*/
void probe_logging_init(probe_logging_hook_t hook);
/*
* \brief Initialize probes subsystem
*
* param[in,optional] extraction_probe_dma - DMA associated with extraction
* In case extraction_probe_dma is NULL, extraction probes
* are unavailable.
*/
int probe_init(const struct probe_dma *extraction_probe_dma);
/*
* \brief Deinitialize probes subsystem.
*
* Detach extraction DMA if was enabled. Return -EINVAL in case some probes
* are still in use.
*/
int probe_deinit(void);
/*
* \brief Setup injection DMAs for probes.
*
* param[in] count - number of DMAs configured during this call
* param[in] probe_dma - Array of size 'count' with configuration data for DMAs
*/
int probe_dma_add(uint32_t count, const struct probe_dma *probe_dma);
/*
* \brief Get info about connected injection DMAs
*
* param[in,out] data - reply to write data to
* param[in] max_size - maximum number of bytes available in data
*/
int probe_dma_info(struct sof_ipc_probe_info_params *data, uint32_t max_size);
/*
* \brief Remove injection DMAs
*
* param[in] count - number of DMAs removed during this call
* param[in] stream_tag - array for size 'count' with stream tags associated
* with DMAs to be removed
*/
int probe_dma_remove(uint32_t count, const uint32_t *stream_tag);
/*
* \brief Set probe points
*
* param[in] count - number of probe points configured this call
* param[in] probe - array of size 'count' with configuration of probe points
*/
int probe_point_add(uint32_t count, const struct probe_point *probe);
/*
* \brief Get info about connected probe points
*
* param[in,out] data - reply to write data to
* param[in] max_size - maximum number of bytes available in data
*/
int probe_point_info(struct sof_ipc_probe_info_params *data, uint32_t max_size);
/*
* \brief Remove probe points
*
* param[in] count - number of probe points removed this call
* param[in] buffer_id - array of size 'count' with IDs of buffers to which
* probes were attached
*/
int probe_point_remove(uint32_t count, const uint32_t *buffer_id);
/**
* \brief Retrieves probes structure.
* \return Pointer to probes structure.
*/
static inline struct probe_pdata *probe_get(void)
{
return sof_get()->probe;
}
#endif /* CONFIG_PROBE */
#endif /* __SOF_PROBE_PROBE_H__ */