12#ifndef ZEPHYR_INCLUDE_ZEPHYR_ARCH_PERF_COUNTER_H_
13#define ZEPHYR_INCLUDE_ZEPHYR_ARCH_PERF_COUNTER_H_
15#include <zephyr/autoconf.h>
19#if defined(CONFIG_ARM64)
20#include <zephyr/arch/arm64/pmuv3.h>
void perf_counter_stop(void)
Stop counting: disable the PMU globally (implementation-defined).
uint32_t perf_counter_num_counters(void)
void perf_counter_enable(uint32_t counter)
Enable counting on hardware event counter counter.
void perf_counter_reset_all(void)
Reset all hardware event counters to zero (implementation-defined; may include cycle counter policies...
int perf_counter_init(void)
Initialize the PMU for the current logical CPU.
int perf_counter_config(uint32_t counter, perf_counter_evt_t event)
Map hardware event counter counter to architectural event event.
void perf_counter_cycle_reset(void)
Reset the cycle count register to zero (implementation-defined).
uint64_t perf_counter_read(uint32_t counter)
Read the current value of hardware event counter counter.
void perf_counter_get_info(perf_counter_info_t *info)
Fill info with PMU identification for the current logical CPU.
uint64_t perf_counter_cycle_count(void)
Read the architectural cycle count register (if implemented).
bool perf_counter_overflow(uint32_t counter)
Return whether hardware event counter counter has overflowed since the flag was cleared.
void perf_counter_clear_overflow(uint32_t counter)
Clear the overflow flag for hardware event counter counter.
void perf_counter_disable_all(void)
Disable all event counters (and the cycle counter where applicable).
void perf_counter_disable(uint32_t counter)
Disable counting on hardware event counter counter.
void perf_counter_start(void)
Start counting: enable the PMU globally (implementation-defined).
void perf_counter_reset(uint32_t counter)
Reset hardware event counter counter to zero.
void perf_counter_enable_all(void)
Enable all implemented event counters (and the cycle counter where applicable).
uint32_t perf_counter_evt_t
Architectural / backend event selector when no arch supplement defines perf_counter_evt_t.
Definition perf_counter.h:26
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT64_TYPE__ uint64_t
Definition stdint.h:91
Performance counter configuration entry.
Definition perf_counter.h:48
bool enabled
Enable this counter when configured.
Definition perf_counter.h:52
perf_counter_evt_t event
Event (e.g.
Definition perf_counter.h:50
Placeholder perf_counter_info_t when no arch supplement is present.
Definition perf_counter.h:29
uint32_t implementer
PMU implementer identification value when reported by the backend.
Definition perf_counter.h:31
uint32_t idcode
PMU part number / ID code when reported by the backend.
Definition perf_counter.h:33