Parse all slogger2 files
Synopsis:
#include <slog2_parse.h>
int slog2_parse_all( uint32_t flags,
char *directory_path,
char *match_list,
slog2_packet_info_t *packet_info,
slog2_packet_callback callback,
void *param );
Arguments:
- flags
- Flags that control the processing of the files; a bitwise OR of zero or more of the following:
- SLOG2_PARSE_FLAGS_DYNAMIC — do live streaming of all buffers merged.
The directory_path argument must be NULL.
- SLOG2_PARSE_FLAGS_CURRENT — start live parsing from the current moment.
This bit is useful only if you've also specified SLOG2_PARSE_FLAGS_DYNAMIC.
- directory_path
- The path of the directory that contains the files you want to parse, or NULL
if flags is set to SLOG2_PARSE_FLAGS_DYNAMIC.
- match_list
- A comma-separated list of buffer-set names that you want to match.
- packet_info
- A pointer to a
slog2_packet_info_t
structure, which gets populated and passed to the callback.
- callback
- A function of type slog2_packet_callback:
typedef int (*slog2_packet_callback)( slog2_packet_info_t *__info,
void *__payload,
void *__param );
that's called to process each packet in the buffer; see below.
- param
- A pointer to additional data that you want to pass to the callback function.
Library:
libslog2parse
Use the -l slog2parse option to
qcc
to link against this library.
Description:
The slog2_parse_all() function parses all files in a given directory path, or the
live directory path (/dev/shmem/slogger2) if the path supplied is NULL.
The output is in a merged format according to the time the files were made.
The given callback function is invoked for each packet in the files;
the prototype is:
int callback( slog2_packet_info_t *info,
void *payload,
void *param );
The arguments are:
- info
- A pointer to a
slog2_packet_info_t
structure that describes the current packet.
- payload
- A pointer to the packet payload.
- param
- A pointer to any additional data that you want to pass to the callback.
The callback should return 0 on success, or a nonzero value on failure.
Returns:
0 on success, or -1 on failure.
Classification:
QNX Neutrino
Safety: |
|
Cancellation point |
No |
Interrupt handler |
No |
Signal handler |
No |
Thread |
Yes |