DPDK 22.11.5
Enumerations | Functions
rte_trace.h File Reference
#include <stdbool.h>
#include <stdio.h>
#include <rte_common.h>
#include <rte_compat.h>

Go to the source code of this file.

Enumerations

enum  rte_trace_mode { RTE_TRACE_MODE_OVERWRITE , RTE_TRACE_MODE_DISCARD }
 

Functions

__rte_experimental bool rte_trace_is_enabled (void)
 
__rte_experimental void rte_trace_mode_set (enum rte_trace_mode mode)
 
__rte_experimental enum rte_trace_mode rte_trace_mode_get (void)
 
__rte_experimental int rte_trace_pattern (const char *pattern, bool enable)
 
__rte_experimental int rte_trace_regexp (const char *regex, bool enable)
 
__rte_experimental int rte_trace_save (void)
 
__rte_experimental int rte_trace_metadata_dump (FILE *f)
 
__rte_experimental void rte_trace_dump (FILE *f)
 

Detailed Description

RTE Trace API

This file provides the trace API to RTE applications.

Warning
EXPERIMENTAL: this API may change without prior notice

Definition in file rte_trace.h.

Enumeration Type Documentation

◆ rte_trace_mode

Enumerate trace mode operation.

Enumerator
RTE_TRACE_MODE_OVERWRITE 

In this mode, when no space is left in the trace buffer, the subsequent events overwrite the old events.

RTE_TRACE_MODE_DISCARD 

In this mode, when no space is left in the trace buffer, the subsequent events shall not be recorded.

Definition at line 41 of file rte_trace.h.

Function Documentation

◆ rte_trace_is_enabled()

__rte_experimental bool rte_trace_is_enabled ( void  )

Test if trace is enabled.

Returns
true if trace is enabled, false otherwise.

◆ rte_trace_mode_set()

__rte_experimental void rte_trace_mode_set ( enum rte_trace_mode  mode)

Set the trace mode.

Parameters
modeTrace mode.

◆ rte_trace_mode_get()

__rte_experimental enum rte_trace_mode rte_trace_mode_get ( void  )

Get the trace mode.

Returns
The current trace mode.

◆ rte_trace_pattern()

__rte_experimental int rte_trace_pattern ( const char *  pattern,
bool  enable 
)

Enable/Disable a set of tracepoints based on globbing pattern.

Parameters
patternThe globbing pattern identifying the tracepoint.
enabletrue to enable tracepoint, false to disable the tracepoint, upon match.
Returns
  • 0: Success and no pattern match.
  • 1: Success and found pattern match.
  • (-ERANGE): Tracepoint object is not registered.

◆ rte_trace_regexp()

__rte_experimental int rte_trace_regexp ( const char *  regex,
bool  enable 
)

Enable/Disable a set of tracepoints based on regular expression.

Parameters
regexA regular expression identifying the tracepoint.
enabletrue to enable tracepoint, false to disable the tracepoint, upon match.
Returns
  • 0: Success and no pattern match.
  • 1: Success and found pattern match.
  • (-ERANGE): Tracepoint object is not registered.
  • (-EINVAL): Invalid regular expression rule.

◆ rte_trace_save()

__rte_experimental int rte_trace_save ( void  )

Save the trace buffer to the trace directory.

By default, trace directory will be created at $HOME directory and this can be overridden by –trace-dir EAL parameter.

Returns
  • 0: Success.
  • <0 : Failure.

◆ rte_trace_metadata_dump()

__rte_experimental int rte_trace_metadata_dump ( FILE *  f)

Dump the trace metadata to a file.

Parameters
fA pointer to a file for output
Returns
  • 0: Success.
  • <0 : Failure.

◆ rte_trace_dump()

__rte_experimental void rte_trace_dump ( FILE *  f)

Dump the trace subsystem status to a file.

Parameters
fA pointer to a file for output