slog2_packet_info_t

QNX SDP8.0C Library ReferenceAPIDeveloper

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;
    uint32_t                    register_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 process-local, monotonically increasing sequence number.
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 <sys/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.
register_flags
The flags that were passed to slog2_register(); a bitwise OR of zero or more of the following bits:
  • SLOG2_ALLOC_TYPE_SHMEM — use an OS-managed shared memory object for the buffer set.
  • SLOG2_DISCARD_NEWLINE — discard newline (\n) characters.
    Note:
    The newline characters are stripped on the post-processing side (i.e., by slog2_dump_logs_to_file() and slog2info). Newline characters in a string are replaced by a space; consecutive newline characters are replaced by a single space.
  • SLOG2_TRY_REUSE_BUFFER_SET — before registering a new buffer set, try to find and reuse an existing buffer set in this process having an identical buffer set configuration.

Examples:

See slog2_parse_static_buffer().

Classification:

QNX OS

Safety:
Cancellation pointNo
Signal handlerNo
ThreadYes
Page updated: