From 92b916ab47e83ffa6ce4925ee6552ce9574ed912 Mon Sep 17 00:00:00 2001 From: dulibo1 Date: Mon, 6 Nov 2023 18:14:57 +0800 Subject: [PATCH] cpuload:testing program compile error when use CONFIG_SCHED_CPULOAD_SYSCLK MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit log: CC: setjmp.c cpuload_main.c: In function ‘cpuload_main’: cpuload_main.c:38:45: error: ‘CONFIG_SCHED_CPULOAD_TICKSPERSEC’ undeclared (first use in this function); did you mean ‘CONFIG_SCHED_CPULOAD_TIMECONSTANT’? 38 | #define CPULOAD_US (USEC_PER_SEC / CONFIG_SCHED_CPULOAD_TICKSPERSEC) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cpuload_main.c:42:35: note: in expansion of macro ‘CPULOAD_US’ 42 | #define CPULOAD_DELAY (10 * CPULOAD_US) Signed-off-by: dulibo1 Signed-off-by: buxiasen --- testing/cpuload/cpuload_main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/testing/cpuload/cpuload_main.c b/testing/cpuload/cpuload_main.c index 70f4335e5..c4f49206f 100644 --- a/testing/cpuload/cpuload_main.c +++ b/testing/cpuload/cpuload_main.c @@ -34,7 +34,12 @@ * Pre-processor Definitions ****************************************************************************/ -#define CPULOAD_US (USEC_PER_SEC / CONFIG_SCHED_CPULOAD_TICKSPERSEC) +#ifdef CONFIG_SCHED_CPULOAD_EXTCLK +# define CPULOAD_US (USEC_PER_SEC / CONFIG_SCHED_CPULOAD_TICKSPERSEC) +#else +# define CPULOAD_US (USEC_PER_SEC / CLOCKS_PER_SEC) +#endif + #define CPULOAD_DELAY (10 * CPULOAD_US) /****************************************************************************