Zephyr Project API 4.0.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Logging frontend STMESP Demultiplexer API

Data Structures

struct  log_frontend_stmesp_demux_log_header
 Logging message header. More...
 
union  log_frontend_stmesp_demux_header
 Union for writing raw data to the logging message header. More...
 
struct  log_frontend_stmesp_demux_packet_generic
 Generic STP demux packet. More...
 
struct  log_frontend_stmesp_demux_log
 Packet with logging message. More...
 
struct  log_frontend_stmesp_demux_trace_point
 Packet with trace point. More...
 
struct  log_frontend_stmesp_demux_hw_event
 Packet with HW event. More...
 
union  log_frontend_stmesp_demux_packet
 Union of all packet types. More...
 
struct  log_frontend_stmesp_demux_config
 Demultiplexer configuration. More...
 

Macros

#define LOG_FRONTEND_STMESP_DEMUX_MAJOR_BITS   3
 Bits used to store major index.
 
#define LOG_FRONTEND_STMESP_DEMUX_LEVEL_BITS   3
 Bits used to store severity level.
 
#define LOG_FRONTEND_STMESP_DEMUX_TLENGTH_BITS   16
 Bits used to store total length.
 
#define LOG_FRONTEND_STMESP_DEMUX_PLENGTH_BITS   10
 Bits used to store package length.
 
#define LOG_FRONTEND_STMESP_DEMUX_MAJOR_MAX   BIT(LOG_FRONTEND_STMESP_DEMUX_MAJOR_BITS)
 Maximum number of supported majors.
 
#define LOG_FRONTEND_STMESP_DEMUX_TYPE_LOG   0
 Log message type.
 
#define LOG_FRONTEND_STMESP_DEMUX_TYPE_TRACE_POINT   1
 Trace point message type.
 
#define LOG_FRONTEND_STMESP_DEMUX_TYPE_HW_EVENT   2
 HW event message type.
 

Functions

int log_frontend_stmesp_demux_init (const struct log_frontend_stmesp_demux_config *config)
 Initialize the demultiplexer.
 
void log_frontend_stmesp_demux_major (uint16_t id)
 Indicate major opcode in the STPv2 stream.
 
void log_frontend_stmesp_demux_channel (uint16_t id)
 Indicate channel opcode in the STPv2 stream.
 
int log_frontend_stmesp_demux_packet_start (uint32_t *data, uint64_t *ts)
 Indicate detected packet start (DMTS).
 
void log_frontend_stmesp_demux_timestamp (uint64_t ts)
 Indicate timestamp.
 
void log_frontend_stmesp_demux_data (uint8_t *data, size_t len)
 Indicate data.
 
void log_frontend_stmesp_demux_packet_end (void)
 Indicate packet end (Flag).
 
uint32_t log_frontend_stmesp_demux_get_dropped (void)
 Get number of dropped messages and reset the counter.
 
union log_frontend_stmesp_demux_packet log_frontend_stmesp_demux_claim (void)
 Claim packet.
 
void log_frontend_stmesp_demux_free (union log_frontend_stmesp_demux_packet packet)
 Free previously claimed packet.
 
bool log_frontend_stmesp_demux_is_idle (void)
 Check if there are any started but not completed log messages.
 
void log_frontend_stmesp_demux_reset (void)
 Close any opened messages and mark them as invalid.
 
int log_frontend_stmesp_demux_max_utilization (void)
 Get maximum buffer utilization.
 

Detailed Description

Macro Definition Documentation

◆ LOG_FRONTEND_STMESP_DEMUX_LEVEL_BITS

#define LOG_FRONTEND_STMESP_DEMUX_LEVEL_BITS   3

#include <include/zephyr/logging/log_frontend_stmesp_demux.h>

Bits used to store severity level.

◆ LOG_FRONTEND_STMESP_DEMUX_MAJOR_BITS

#define LOG_FRONTEND_STMESP_DEMUX_MAJOR_BITS   3

#include <include/zephyr/logging/log_frontend_stmesp_demux.h>

Bits used to store major index.

◆ LOG_FRONTEND_STMESP_DEMUX_MAJOR_MAX

#define LOG_FRONTEND_STMESP_DEMUX_MAJOR_MAX   BIT(LOG_FRONTEND_STMESP_DEMUX_MAJOR_BITS)

#include <include/zephyr/logging/log_frontend_stmesp_demux.h>

Maximum number of supported majors.

◆ LOG_FRONTEND_STMESP_DEMUX_PLENGTH_BITS

#define LOG_FRONTEND_STMESP_DEMUX_PLENGTH_BITS   10

#include <include/zephyr/logging/log_frontend_stmesp_demux.h>

Bits used to store package length.

◆ LOG_FRONTEND_STMESP_DEMUX_TLENGTH_BITS

#define LOG_FRONTEND_STMESP_DEMUX_TLENGTH_BITS   16

#include <include/zephyr/logging/log_frontend_stmesp_demux.h>

Bits used to store total length.

◆ LOG_FRONTEND_STMESP_DEMUX_TYPE_HW_EVENT

#define LOG_FRONTEND_STMESP_DEMUX_TYPE_HW_EVENT   2

#include <include/zephyr/logging/log_frontend_stmesp_demux.h>

HW event message type.

◆ LOG_FRONTEND_STMESP_DEMUX_TYPE_LOG

#define LOG_FRONTEND_STMESP_DEMUX_TYPE_LOG   0

◆ LOG_FRONTEND_STMESP_DEMUX_TYPE_TRACE_POINT

#define LOG_FRONTEND_STMESP_DEMUX_TYPE_TRACE_POINT   1

#include <include/zephyr/logging/log_frontend_stmesp_demux.h>

Trace point message type.

Function Documentation

◆ log_frontend_stmesp_demux_channel()

void log_frontend_stmesp_demux_channel ( uint16_t  id)

#include <include/zephyr/logging/log_frontend_stmesp_demux.h>

Indicate channel opcode in the STPv2 stream.

Parameters
idChannel ID.

◆ log_frontend_stmesp_demux_claim()

union log_frontend_stmesp_demux_packet log_frontend_stmesp_demux_claim ( void  )

#include <include/zephyr/logging/log_frontend_stmesp_demux.h>

Claim packet.

Get pointer to the pending packet with logging message. Packet must be freed using log_frontend_stmesp_demux_free.

Returns
Pointer to the packet or NULL.

◆ log_frontend_stmesp_demux_data()

void log_frontend_stmesp_demux_data ( uint8_t data,
size_t  len 
)

#include <include/zephyr/logging/log_frontend_stmesp_demux.h>

Indicate data.

Parameters
dataData buffer.
lenLength.

◆ log_frontend_stmesp_demux_free()

void log_frontend_stmesp_demux_free ( union log_frontend_stmesp_demux_packet  packet)

#include <include/zephyr/logging/log_frontend_stmesp_demux.h>

Free previously claimed packet.

See log_frontend_stmesp_demux_claim.

Parameters
packetPacket.

◆ log_frontend_stmesp_demux_get_dropped()

uint32_t log_frontend_stmesp_demux_get_dropped ( void  )

#include <include/zephyr/logging/log_frontend_stmesp_demux.h>

Get number of dropped messages and reset the counter.

Message can be dropped if there is no room in the packet buffer.

Returns
Number of dropped messages.

◆ log_frontend_stmesp_demux_init()

int log_frontend_stmesp_demux_init ( const struct log_frontend_stmesp_demux_config config)

#include <include/zephyr/logging/log_frontend_stmesp_demux.h>

Initialize the demultiplexer.

Parameters
configConfiguration.
Return values
0on success.
-EINVALon invalid configuration.

◆ log_frontend_stmesp_demux_is_idle()

bool log_frontend_stmesp_demux_is_idle ( void  )

#include <include/zephyr/logging/log_frontend_stmesp_demux.h>

Check if there are any started but not completed log messages.

Return values
TrueThere is no pending started log message.
FalseThere is pending message.

◆ log_frontend_stmesp_demux_major()

void log_frontend_stmesp_demux_major ( uint16_t  id)

#include <include/zephyr/logging/log_frontend_stmesp_demux.h>

Indicate major opcode in the STPv2 stream.

Parameters
idMaster ID.

◆ log_frontend_stmesp_demux_max_utilization()

int log_frontend_stmesp_demux_max_utilization ( void  )

#include <include/zephyr/logging/log_frontend_stmesp_demux.h>

Get maximum buffer utilization.

Return values
Non-negativeMaximum buffer utilization.
-ENOTSUPFeature not enabled.

◆ log_frontend_stmesp_demux_packet_end()

void log_frontend_stmesp_demux_packet_end ( void  )

#include <include/zephyr/logging/log_frontend_stmesp_demux.h>

Indicate packet end (Flag).

◆ log_frontend_stmesp_demux_packet_start()

int log_frontend_stmesp_demux_packet_start ( uint32_t data,
uint64_t ts 
)

#include <include/zephyr/logging/log_frontend_stmesp_demux.h>

Indicate detected packet start (DMTS).

Parameters
dataData. Can be NULL which indicates trace point without data.
tsTimestamp. Can be NULL.

◆ log_frontend_stmesp_demux_reset()

void log_frontend_stmesp_demux_reset ( void  )

#include <include/zephyr/logging/log_frontend_stmesp_demux.h>

Close any opened messages and mark them as invalid.

◆ log_frontend_stmesp_demux_timestamp()

void log_frontend_stmesp_demux_timestamp ( uint64_t  ts)

#include <include/zephyr/logging/log_frontend_stmesp_demux.h>

Indicate timestamp.

Timestamp is separated from packet start because according to STM spec (3.2.2) it is possible that timestamp is assigned to a later packet.

Parameters
tsTimestamp.