From 219fb1a71728038ff07ceff5abec8f50a797d9df Mon Sep 17 00:00:00 2001 From: ouyangxiangzhen Date: Fri, 28 Feb 2025 14:04:35 +0800 Subject: [PATCH] arch/arm64: Add up_perf_init for qemu. This commit added up_perf_init for qemu. Signed-off-by: ouyangxiangzhen --- arch/arm64/src/qemu/qemu_boot.c | 4 ++++ arch/arm64/src/qemu/qemu_boot.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/arch/arm64/src/qemu/qemu_boot.c b/arch/arm64/src/qemu/qemu_boot.c index 4686c60b24c..4eb75f16e2e 100644 --- a/arch/arm64/src/qemu/qemu_boot.c +++ b/arch/arm64/src/qemu/qemu_boot.c @@ -190,4 +190,8 @@ void arm64_chip_boot(void) #ifdef CONFIG_SYSLOG_RPMSG syslog_rpmsg_init_early(g_syslog_rpmsg_buf, sizeof(g_syslog_rpmsg_buf)); #endif + +#ifdef CONFIG_ARCH_PERF_EVENTS + up_perf_init((void *)CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC); +#endif } diff --git a/arch/arm64/src/qemu/qemu_boot.h b/arch/arm64/src/qemu/qemu_boot.h index 3eba3ce84c8..c9942684e88 100644 --- a/arch/arm64/src/qemu/qemu_boot.h +++ b/arch/arm64/src/qemu/qemu_boot.h @@ -38,6 +38,8 @@ * Pre-processor Definitions ****************************************************************************/ +#define CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC 62500000 + /**************************************************************************** * Public Function Prototypes ****************************************************************************/