DPDK 21.11.9
Macros | Typedefs | Functions
rte_trace_point.h File Reference
#include <stdbool.h>
#include <stdio.h>
#include <rte_branch_prediction.h>
#include <rte_common.h>
#include <rte_compat.h>
#include <rte_cycles.h>
#include <rte_per_lcore.h>
#include <rte_string_fns.h>
#include <rte_uuid.h>

Go to the source code of this file.

Macros

#define RTE_TRACE_POINT_ARGS
 
#define RTE_TRACE_POINT(tp, args, ...)    __RTE_TRACE_POINT(generic, tp, args, __VA_ARGS__)
 
#define RTE_TRACE_POINT_FP(tp, args, ...)    __RTE_TRACE_POINT(fp, tp, args, __VA_ARGS__)
 
#define RTE_TRACE_POINT_REGISTER(trace, name)
 
#define rte_trace_point_emit_u64(val)
 
#define rte_trace_point_emit_i64(val)
 
#define rte_trace_point_emit_u32(val)
 
#define rte_trace_point_emit_i32(val)
 
#define rte_trace_point_emit_u16(val)
 
#define rte_trace_point_emit_i16(val)
 
#define rte_trace_point_emit_u8(val)
 
#define rte_trace_point_emit_i8(val)
 
#define rte_trace_point_emit_int(val)
 
#define rte_trace_point_emit_long(val)
 
#define rte_trace_point_emit_size_t(val)
 
#define rte_trace_point_emit_float(val)
 
#define rte_trace_point_emit_double(val)
 
#define rte_trace_point_emit_ptr(val)
 
#define rte_trace_point_emit_string(val)
 

Typedefs

typedef uint64_t rte_trace_point_t
 

Functions

__rte_experimental int rte_trace_point_enable (rte_trace_point_t *tp)
 
__rte_experimental int rte_trace_point_disable (rte_trace_point_t *tp)
 
__rte_experimental bool rte_trace_point_is_enabled (rte_trace_point_t *tp)
 
__rte_experimental rte_trace_point_trte_trace_point_lookup (const char *name)
 

Detailed Description

RTE Tracepoint API

This file provides the tracepoint API to RTE applications.

Warning
EXPERIMENTAL: this API may change without prior notice

Definition in file rte_trace_point.h.

Macro Definition Documentation

◆ RTE_TRACE_POINT_ARGS

#define RTE_TRACE_POINT_ARGS

Macro to define the tracepoint arguments in RTE_TRACE_POINT macro.

See also
RTE_TRACE_POINT, RTE_TRACE_POINT_FP

Definition at line 42 of file rte_trace_point.h.

◆ RTE_TRACE_POINT

#define RTE_TRACE_POINT (   tp,
  args,
  ... 
)     __RTE_TRACE_POINT(generic, tp, args, __VA_ARGS__)

Create a tracepoint.

A tracepoint is defined by specifying:

  • its input arguments: they are the C function style parameters to define the arguments of tracepoint function. These input arguments are embedded using the RTE_TRACE_POINT_ARGS macro.
  • its output event fields: they are the sources of event fields that form the payload of any event that the execution of the tracepoint macro emits for this particular tracepoint. The application uses rte_trace_point_emit_* macros to emit the output event fields.
Parameters
tpTracepoint object. Before using the tracepoint, an application needs to define the tracepoint using RTE_TRACE_POINT_REGISTER macro.
argsC function style input arguments to define the arguments to tracepoint function.
...Define the payload of trace function. The payload will be formed using rte_trace_point_emit_* macros. Use ";" delimiter between two payloads.
See also
RTE_TRACE_POINT_ARGS, RTE_TRACE_POINT_REGISTER, rte_trace_point_emit_*

Definition at line 78 of file rte_trace_point.h.

◆ RTE_TRACE_POINT_FP

#define RTE_TRACE_POINT_FP (   tp,
  args,
  ... 
)     __RTE_TRACE_POINT(fp, tp, args, __VA_ARGS__)

Create a tracepoint for fast path.

Similar to RTE_TRACE_POINT, except that it is removed at compilation time unless the RTE_ENABLE_TRACE_FP configuration parameter is set.

Parameters
tpTracepoint object. Before using the tracepoint, an application needs to define the tracepoint using RTE_TRACE_POINT_REGISTER macro.
argsC function style input arguments to define the arguments to tracepoint. function.
...Define the payload of trace function. The payload will be formed using rte_trace_point_emit_* macros, Use ";" delimiter between two payloads.
See also
RTE_TRACE_POINT

Definition at line 99 of file rte_trace_point.h.

◆ RTE_TRACE_POINT_REGISTER

#define RTE_TRACE_POINT_REGISTER (   trace,
  name 
)

Register a tracepoint.

Parameters
traceThe tracepoint object created using RTE_TRACE_POINT_REGISTER.
nameThe name of the tracepoint object.
Returns
  • 0: Successfully registered the tracepoint.
  • <0: Failure to register the tracepoint.

Definition at line 115 of file rte_trace_point.h.

◆ rte_trace_point_emit_u64

#define rte_trace_point_emit_u64 (   val)

Tracepoint function payload for uint64_t datatype

Definition at line 118 of file rte_trace_point.h.

◆ rte_trace_point_emit_i64

#define rte_trace_point_emit_i64 (   val)

Tracepoint function payload for int64_t datatype

Definition at line 120 of file rte_trace_point.h.

◆ rte_trace_point_emit_u32

#define rte_trace_point_emit_u32 (   val)

Tracepoint function payload for uint32_t datatype

Definition at line 122 of file rte_trace_point.h.

◆ rte_trace_point_emit_i32

#define rte_trace_point_emit_i32 (   val)

Tracepoint function payload for int32_t datatype

Definition at line 124 of file rte_trace_point.h.

◆ rte_trace_point_emit_u16

#define rte_trace_point_emit_u16 (   val)

Tracepoint function payload for uint16_t datatype

Definition at line 126 of file rte_trace_point.h.

◆ rte_trace_point_emit_i16

#define rte_trace_point_emit_i16 (   val)

Tracepoint function payload for int16_t datatype

Definition at line 128 of file rte_trace_point.h.

◆ rte_trace_point_emit_u8

#define rte_trace_point_emit_u8 (   val)

Tracepoint function payload for uint8_t datatype

Definition at line 130 of file rte_trace_point.h.

◆ rte_trace_point_emit_i8

#define rte_trace_point_emit_i8 (   val)

Tracepoint function payload for int8_t datatype

Definition at line 132 of file rte_trace_point.h.

◆ rte_trace_point_emit_int

#define rte_trace_point_emit_int (   val)

Tracepoint function payload for int datatype

Definition at line 134 of file rte_trace_point.h.

◆ rte_trace_point_emit_long

#define rte_trace_point_emit_long (   val)

Tracepoint function payload for long datatype

Definition at line 136 of file rte_trace_point.h.

◆ rte_trace_point_emit_size_t

#define rte_trace_point_emit_size_t (   val)

Tracepoint function payload for size_t datatype

Definition at line 138 of file rte_trace_point.h.

◆ rte_trace_point_emit_float

#define rte_trace_point_emit_float (   val)

Tracepoint function payload for float datatype

Definition at line 140 of file rte_trace_point.h.

◆ rte_trace_point_emit_double

#define rte_trace_point_emit_double (   val)

Tracepoint function payload for double datatype

Definition at line 142 of file rte_trace_point.h.

◆ rte_trace_point_emit_ptr

#define rte_trace_point_emit_ptr (   val)

Tracepoint function payload for pointer datatype

Definition at line 144 of file rte_trace_point.h.

◆ rte_trace_point_emit_string

#define rte_trace_point_emit_string (   val)

Tracepoint function payload for string datatype

Definition at line 146 of file rte_trace_point.h.

Typedef Documentation

◆ rte_trace_point_t

typedef uint64_t rte_trace_point_t

The tracepoint object.

Definition at line 35 of file rte_trace_point.h.

Function Documentation

◆ rte_trace_point_enable()

__rte_experimental int rte_trace_point_enable ( rte_trace_point_t tp)

Enable recording events of the given tracepoint in the trace buffer.

Parameters
tpThe tracepoint object to enable.
Returns
  • 0: Success.
  • (-ERANGE): Trace object is not registered.

◆ rte_trace_point_disable()

__rte_experimental int rte_trace_point_disable ( rte_trace_point_t tp)

Disable recording events of the given tracepoint in the trace buffer.

Parameters
tpThe tracepoint object to disable.
Returns
  • 0: Success.
  • (-ERANGE): Trace object is not registered.

◆ rte_trace_point_is_enabled()

__rte_experimental bool rte_trace_point_is_enabled ( rte_trace_point_t tp)

Test if recording events from the given tracepoint is enabled.

Parameters
tpThe tracepoint object.
Returns
true if tracepoint is enabled, false otherwise.

◆ rte_trace_point_lookup()

__rte_experimental rte_trace_point_t * rte_trace_point_lookup ( const char *  name)

Lookup a tracepoint object from its name.

Parameters
nameThe name of the tracepoint.
Returns
The tracepoint object or NULL if not found.