7#ifndef ZEPHYR_INCLUDE_LOGGING_LOG_FRONTEND_STMESP_DEMUX_H_
8#define ZEPHYR_INCLUDE_LOGGING_LOG_FRONTEND_STMESP_DEMUX_H_
27#define LOG_FRONTEND_STMESP_DEMUX_MAJOR_BITS 3
30#define LOG_FRONTEND_STMESP_DEMUX_LEVEL_BITS 3
33#define LOG_FRONTEND_STMESP_DEMUX_TLENGTH_BITS 16
36#define LOG_FRONTEND_STMESP_DEMUX_PLENGTH_BITS 10
39#define LOG_FRONTEND_STMESP_DEMUX_MAJOR_MAX BIT(LOG_FRONTEND_STMESP_DEMUX_MAJOR_BITS)
42#define LOG_FRONTEND_STMESP_DEMUX_TYPE_LOG 0
45#define LOG_FRONTEND_STMESP_DEMUX_TYPE_TRACE_POINT 1
48#define LOG_FRONTEND_STMESP_DEMUX_TYPE_HW_EVENT 2
void log_frontend_stmesp_demux_timestamp(uint64_t ts)
Indicate timestamp.
bool log_frontend_stmesp_demux_is_idle(void)
Check if there are any started but not completed log messages.
void log_frontend_stmesp_demux_data(uint8_t *data, size_t len)
Indicate data.
#define LOG_FRONTEND_STMESP_DEMUX_MAJOR_BITS
Bits used to store major index.
Definition log_frontend_stmesp_demux.h:27
void log_frontend_stmesp_demux_packet_end(void)
Indicate packet end (Flag).
void log_frontend_stmesp_demux_reset(void)
Close any opened messages and mark them as invalid.
void log_frontend_stmesp_demux_channel(uint16_t id)
Indicate channel opcode in the STPv2 stream.
#define LOG_FRONTEND_STMESP_DEMUX_PLENGTH_BITS
Bits used to store package length.
Definition log_frontend_stmesp_demux.h:36
int log_frontend_stmesp_demux_max_utilization(void)
Get maximum buffer utilization.
void log_frontend_stmesp_demux_major(uint16_t id)
Indicate major opcode in the STPv2 stream.
int log_frontend_stmesp_demux_init(const struct log_frontend_stmesp_demux_config *config)
Initialize the demultiplexer.
uint32_t log_frontend_stmesp_demux_get_dropped(void)
Get number of dropped messages and reset the counter.
void log_frontend_stmesp_demux_free(union log_frontend_stmesp_demux_packet packet)
Free previously claimed packet.
#define LOG_FRONTEND_STMESP_DEMUX_TLENGTH_BITS
Bits used to store total length.
Definition log_frontend_stmesp_demux.h:33
int log_frontend_stmesp_demux_packet_start(uint32_t *data, uint64_t *ts)
Indicate detected packet start (DMTS).
#define LOG_FRONTEND_STMESP_DEMUX_LEVEL_BITS
Bits used to store severity level.
Definition log_frontend_stmesp_demux.h:30
union log_frontend_stmesp_demux_packet log_frontend_stmesp_demux_claim(void)
Claim packet.
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT64_TYPE__ uint64_t
Definition stdint.h:91
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
Demultiplexer configuration.
Definition log_frontend_stmesp_demux.h:177
uint32_t m_ids_cnt
Array length.
Definition log_frontend_stmesp_demux.h:182
const uint16_t * m_ids
Array with expected major ID's.
Definition log_frontend_stmesp_demux.h:179
Packet with HW event.
Definition log_frontend_stmesp_demux.h:138
uint64_t timestamp
Timestamp.
Definition log_frontend_stmesp_demux.h:149
uint8_t evt
HW event ID.
Definition log_frontend_stmesp_demux.h:152
uint64_t type
Type.
Definition log_frontend_stmesp_demux.h:143
MPSC_PBUF_HDR
Data for MPSC packet handling.
Definition log_frontend_stmesp_demux.h:140
uint64_t content_invalid
Flag indicating if packet is valid.
Definition log_frontend_stmesp_demux.h:146
Packet with logging message.
Definition log_frontend_stmesp_demux.h:87
uint64_t content_invalid
Flag indicating if packet is valid.
Definition log_frontend_stmesp_demux.h:95
struct log_frontend_stmesp_demux_log_header hdr
Logging header.
Definition log_frontend_stmesp_demux.h:101
uint32_t padding
Padding so that data is 8 bytes aligned.
Definition log_frontend_stmesp_demux.h:104
MPSC_PBUF_HDR
Data for MPSC packet handling.
Definition log_frontend_stmesp_demux.h:89
uint64_t type
Type.
Definition log_frontend_stmesp_demux.h:92
uint8_t data[]
Content.
Definition log_frontend_stmesp_demux.h:107
uint64_t timestamp
Timestamp.
Definition log_frontend_stmesp_demux.h:98
Generic STP demux packet.
Definition log_frontend_stmesp_demux.h:75
uint64_t content_invalid
Flag indicating if packet is valid.
Definition log_frontend_stmesp_demux.h:83
uint64_t type
Type.
Definition log_frontend_stmesp_demux.h:80
MPSC_PBUF_HDR
Data for MPSC packet handling.
Definition log_frontend_stmesp_demux.h:77
Packet with trace point.
Definition log_frontend_stmesp_demux.h:111
uint16_t major
Major ID.
Definition log_frontend_stmesp_demux.h:128
uint64_t has_data
Flag indicating if trace point includes data.
Definition log_frontend_stmesp_demux.h:122
uint64_t content_invalid
Flag indicating if packet is valid.
Definition log_frontend_stmesp_demux.h:119
uint64_t timestamp
Timestamp.
Definition log_frontend_stmesp_demux.h:125
uint64_t type
Type.
Definition log_frontend_stmesp_demux.h:116
uint32_t data
Content.
Definition log_frontend_stmesp_demux.h:134
MPSC_PBUF_HDR
Data for MPSC packet handling.
Definition log_frontend_stmesp_demux.h:113
uint16_t id
ID.
Definition log_frontend_stmesp_demux.h:131
Union of all packet types.
Definition log_frontend_stmesp_demux.h:156
struct log_frontend_stmesp_demux_packet_generic * generic_packet
Pointer to the generic log_frontend_stmesp_demux packet.
Definition log_frontend_stmesp_demux.h:173
struct log_frontend_stmesp_demux_trace_point * trace_point
Pointer to the trace point message.
Definition log_frontend_stmesp_demux.h:167
const union mpsc_pbuf_generic * rgeneric
Pointer to generic mpsc_pbuf const packet.
Definition log_frontend_stmesp_demux.h:158
struct log_frontend_stmesp_demux_log * log
Pointer to the log message.
Definition log_frontend_stmesp_demux.h:164
struct log_frontend_stmesp_demux_hw_event * hw_event
Pointer to the HW event message.
Definition log_frontend_stmesp_demux.h:170
Generic packet header.
Definition mpsc_packet.h:49