slog2_packet_info_t

Structure containing information about a packet

Synopsis:

#include <slog2_parse.h>

#define SLOG2_PARSE_MAX_NAME_SIZE 64

typedef struct {
    uint32_t                    size;
    uint16_t                    sequence_number;
    uint16_t                    data_size;
    uint64_t                    timestamp;
    slog2_packet_data_type_t    data_type;
    uint16_t                    thread_id;
    uint16_t                    code;
    uint8_t                     severity;
    char                        file_name[ 2 * SLOG2_PARSE_MAX_NAME_SIZE ];
    char                        buffer_name[ SLOG2_PARSE_MAX_NAME_SIZE ];
    uint32_t                    owner_pid;
    uint32_t                    flags;
} slog2_packet_info_t;

Library:

libslog2parse

Use the -l slog2parse option to qcc to link against this library.

Description:

The slog2_packet_info_t structure is used for information about a packet.

Note: Use the SLOG2_PACKET_INFO_INIT macro to initialize this structure before passing it to a parsing function. For example:
slog2_packet_info_t packet_info = SLOG2_PACKET_INFO_INIT;

The members include:

size
The size of the structure, which is used to determine the version of the software.
sequence_number
The sequence number for the packet; slogger2 uses a system-wide, monotonically increasing sequence number to guarantee strict ordering of log messages.
data_size
The size of the object being returned, in bytes.
timestamp
The timestamp for the packet.
data_type
The data type of the payload; one of the following:
  • SLOG2_TYPE_ASCII_STRING
  • SLOG2_TYPE_BINARY — not currently implemented.
  • SLOG2_TYPE_UNSYNC — the buffer was overwritten faster than it could be consumed; the logging rate is too high for the size of the buffer.
  • SLOG2_TYPE_ONLINE — the buffer is new and just came online.
thread_id
The thread ID of the logging thread.
code
A user-specified code that's associated with the message. The meaning of this depends on the program that logged the message.
severity
The severity level of the packet; one of the following (defined in <slog2.h>):
  • SLOG2_SHUTDOWN
  • SLOG2_CRITICAL
  • SLOG2_ERROR
  • SLOG2_WARNING
  • SLOG2_NOTICE
  • SLOG2_INFO
  • SLOG2_DEBUG1
  • SLOG2_DEBUG2

For more information, see the entry for slog2_register().

file_name
The name of the file that this packet belongs to. Don't modify the string that this member points to.
buffer_name
The name of the buffer that this packet belongs to. Don't modify the string that this member points to.
owner_pid
The process ID of the creator of the log.
flags
Flags related to this packet:
  • SLOG2_PACKET_FLAGS_FIRSTPACKET — this is the first packet in the buffer.

Examples:

See slog2_parse_static_buffer().

Classification:

QNX Neutrino

Safety:  
Cancellation point No
Interrupt handler No
Signal handler No
Thread Yes