DPDK 25.07.0
rte_pmu_pmc_x86_64.h
1/* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2025 Marvell.
3 */
4
5#ifndef RTE_PMU_PMC_X86_64_H
6#define RTE_PMU_PMC_X86_64_H
7
8#include <rte_common.h>
9
10static __rte_always_inline uint64_t
11rte_pmu_pmc_read(int index)
12{
13 uint64_t low, high;
14
15 asm volatile(
16 "rdpmc\n"
17 : "=a" (low), "=d" (high)
18 : "c" (index)
19 );
20
21 return low | (high << 32);
22}
23#define rte_pmu_pmc_read rte_pmu_pmc_read
24
25#endif /* RTE_PMU_PMC_X86_64_H */
#define __rte_always_inline
Definition: rte_common.h:490