Percepio Trace Recorder v4.11.0
Loading...
Searching...
No Matches
trcStreamPort.h
1/*
2 * Trace Recorder for Tracealyzer v4.11.0
3 * Copyright 2025 Percepio AB
4 * www.percepio.com
5 *
6 * SPDX-License-Identifier: Apache-2.0
7 *
8 * The interface definitions for trace streaming ("stream ports").
9 * This "stream port" sets up the recorder to use TCP/IP as streaming channel.
10 * The example is for Windows sockets (Winsock), for use with Windows ports.
11 */
12
13#ifndef TRC_STREAM_PORT_H
14#define TRC_STREAM_PORT_H
15
16#if (TRC_USE_TRACEALYZER_RECORDER == 1)
17
18#include <stdint.h>
19#include <trcTypes.h>
20#include <trcStreamPortConfig.h>
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26typedef struct TraceStreamPortBuffer /* Aligned */
27{
28 TraceUnsignedBaseType_t dummy;
29} TraceStreamPortBuffer_t;
30
31int32_t prvTraceWriteToSocket(void* data, uint32_t size, uint32_t uiChannel, int32_t* ptrBytesWritten);
32int32_t prvTraceReadFromSocket(void* data, uint32_t bufsize, int32_t* ptrBytesRead);
33
34traceResult xTraceStreamPortInitialize(TraceStreamPortBuffer_t* pxBuffer);
35
36#define xTraceStreamPortWriteData(pvData, uiSize, uiChannel, piBytesWritten) (prvTraceWriteToSocket(pvData, uiSize, uiChannel, piBytesWritten) == 0 ? TRC_SUCCESS : TRC_FAIL)
37
38#define xTraceStreamPortReadData(pvData, uiSize, piBytesRead) (prvTraceReadFromSocket(pvData, uiSize, piBytesRead) == 0 ? TRC_SUCCESS : TRC_FAIL)
39
40#define xTraceStreamPortOnEnable(uiStartOption) ((void)(uiStartOption), TRC_SUCCESS)
41
42#define xTraceStreamPortOnDisable() (TRC_SUCCESS)
43
44#define xTraceStreamPortOnTraceBegin() (TRC_SUCCESS)
45
46traceResult xTraceStreamPortOnTraceEnd(void);
47
48#ifdef __cplusplus
49}
50#endif
51
52#endif /*(TRC_USE_TRACEALYZER_RECORDER == 1)*/
53
54#endif /* TRC_STREAM_PORT_H */
A structure representing the trace stream port buffer.
Definition trcStreamPort.h:71