Loading...
Searching...
No Matches
trace_parser.h File Reference

Trace parser library. More...

Data Structures

struct  spdk_trace_parser_opts
 Describes trace file and options to use when parsing it. More...
 
struct  spdk_trace_parser_entry
 Describes a parsed trace entry. More...
 

Enumerations

enum  spdk_trace_parser_mode { SPDK_TRACE_PARSER_MODE_FILE , SPDK_TRACE_PARSER_MODE_SHM }
 

Functions

struct spdk_trace_parser * spdk_trace_parser_init (const struct spdk_trace_parser_opts *opts)
 Initialize the parser using a specified trace file.
 
void spdk_trace_parser_cleanup (struct spdk_trace_parser *parser)
 Free any resources tied to a parser object.
 
const struct spdk_trace_filespdk_trace_parser_get_file (const struct spdk_trace_parser *parser)
 Return trace file describing the traces.
 
uint64_t spdk_trace_parser_get_tsc_offset (const struct spdk_trace_parser *parser)
 Return the highest tsc out of first entries across all specified cores.
 
bool spdk_trace_parser_next_entry (struct spdk_trace_parser *parser, struct spdk_trace_parser_entry *entry)
 Return next parsed trace entry.
 
uint64_t spdk_trace_parser_get_entry_count (const struct spdk_trace_parser *parser, uint16_t lcore)
 Return the number of entries recorded on a given core.
 

Detailed Description

Trace parser library.

Enumeration Type Documentation

◆ spdk_trace_parser_mode

Enumerator
SPDK_TRACE_PARSER_MODE_FILE 

Regular file.

SPDK_TRACE_PARSER_MODE_SHM 

Shared memory.

Function Documentation

◆ spdk_trace_parser_cleanup()

void spdk_trace_parser_cleanup ( struct spdk_trace_parser * parser)

Free any resources tied to a parser object.

Parameters
parserParser to clean up.

◆ spdk_trace_parser_get_entry_count()

uint64_t spdk_trace_parser_get_entry_count ( const struct spdk_trace_parser * parser,
uint16_t lcore )

Return the number of entries recorded on a given core.

Parameters
parserParser object to be used.
lcoreLogical core number.
Returns
Number of entries.

◆ spdk_trace_parser_get_file()

const struct spdk_trace_file * spdk_trace_parser_get_file ( const struct spdk_trace_parser * parser)

Return trace file describing the traces.

Parameters
parserParser object to be used.
Returns
Pointer to the trace file.

◆ spdk_trace_parser_get_tsc_offset()

uint64_t spdk_trace_parser_get_tsc_offset ( const struct spdk_trace_parser * parser)

Return the highest tsc out of first entries across all specified cores.

This value can be used to select entries from the subset of time we have the data from all reactors.

Parameters
parserParser object to be used.
Returns
Offset in tsc.

◆ spdk_trace_parser_init()

struct spdk_trace_parser * spdk_trace_parser_init ( const struct spdk_trace_parser_opts * opts)

Initialize the parser using a specified trace file.

This results in parsing the traces, merging entries from multiple cores together and sorting them by their tsc, so it can take a significant amount of time to complete.

Parameters
optsDescribes the trace file to parse.
Returns
Parser object or NULL in case of any failures.

◆ spdk_trace_parser_next_entry()

bool spdk_trace_parser_next_entry ( struct spdk_trace_parser * parser,
struct spdk_trace_parser_entry * entry )

Return next parsed trace entry.

Once no more traces are available, this will return false and entry won't be touched.

Parameters
parserParser object to be used.
entryTracepoint entry.
Returns
True if a trace entry was available, false otherwise.