DPDK 25.07.0
|
#include <linux/perf_event.h>
#include <rte_atomic.h>
#include <rte_branch_prediction.h>
#include <rte_common.h>
#include <rte_compat.h>
#include <rte_lcore.h>
Go to the source code of this file.
Data Structures | |
struct | rte_pmu_event_group |
struct | rte_pmu |
Macros | |
#define | RTE_MAX_NUM_GROUP_EVENTS 8 |
Functions | |
static __rte_experimental __rte_always_inline uint64_t | __rte_pmu_read_userpage (struct perf_event_mmap_page *pc) |
__rte_experimental int | __rte_pmu_enable_group (struct rte_pmu_event_group *group) |
__rte_experimental int | rte_pmu_init (void) |
__rte_experimental void | rte_pmu_fini (void) |
__rte_experimental int | rte_pmu_add_event (const char *name) |
static __rte_experimental __rte_always_inline uint64_t | rte_pmu_read (unsigned int index) |
Variables | |
struct rte_pmu | rte_pmu |
Performance Monitoring Unit (PMU) event tracing operations
This file defines generic API and types necessary to setup PMU and read selected counters in runtime. Exported functions are generally not MT-safe. One exception is rte_pmu_read() which can be called concurrently once everything has been setup.
In order to initialize the library, following sequence of calls performed by the same EAL thread is required:
rte_pmu_init() rte_pmu_add_event()
Afterwards all threads can read events by calling rte_pmu_read().
Definition in file rte_pmu.h.
#define RTE_MAX_NUM_GROUP_EVENTS 8 |
|
static |
__rte_experimental int __rte_pmu_enable_group | ( | struct rte_pmu_event_group * | group | ) |
Enable group of events on the calling lcore.
group | Pointer to the group which will be enabled. |
__rte_experimental int rte_pmu_init | ( | void | ) |
Initialize PMU library.
__rte_experimental void rte_pmu_fini | ( | void | ) |
Finalize PMU library.
__rte_experimental int rte_pmu_add_event | ( | const char * | name | ) |
Add event to the group of enabled events.
name | Name of an event listed under /sys/bus/event_source/devices/pmu/events, where PMU is a placeholder for an event source. |
|
static |
Read hardware counter configured to count occurrences of an event.
This is called by an lcore (EAL thread) bound exclusively to particular CPU and may not work as expected if gets migrated elsewhere. Reason being event group is pinned hence not supposed to be multiplexed with any other events. This is the only API which can be called concurrently by different lcores.
index | Index of an event to be read. |