From 6325460df0966643028027c797c519f91e2ab85b Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Sat, 24 Sep 2022 17:27:27 -0400 Subject: [PATCH] =?UTF-8?q?=E5=8F=96=E6=B6=88PKG=5FPERF=5FCOUNTER=5FUSING?= =?UTF-8?q?=5FTHREAD=5FSTATISTIC=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SConscript | 5 +---- os/perf_os_patch_rt_thread.c | 6 +----- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/SConscript b/SConscript index 4f8b061..1abf81b 100644 --- a/SConscript +++ b/SConscript @@ -5,10 +5,7 @@ import shutil src = ['perf_counter.c', 'os/perf_os_patch_rt_thread.c'] cwd = GetCurrentDir() path = [cwd] -CPPDEFINES = ['__PERF_COUNT_PLATFORM_SPECIFIC_HEADER__=', '__perf_counter_printf__=rt_kprintf'] - -if GetDepend('PKG_PERF_COUNTER_USING_THREAD_STATISTIC'): - CPPDEFINES += ['__PERF_CNT_USE_RTOS__'] +CPPDEFINES = ['__PERF_COUNT_PLATFORM_SPECIFIC_HEADER__=', '__perf_counter_printf__=rt_kprintf', '__PERF_CNT_USE_RTOS__'] #delate unused files try: diff --git a/os/perf_os_patch_rt_thread.c b/os/perf_os_patch_rt_thread.c index 67d7098..dce2134 100644 --- a/os/perf_os_patch_rt_thread.c +++ b/os/perf_os_patch_rt_thread.c @@ -80,12 +80,10 @@ task_cycle_info_t * get_rtos_task_cycle_info(void) void __perf_os_patch_init(void) { -#ifdef PKG_PERF_COUNTER_USING_THREAD_STATISTIC +#ifdef PKG_USING_PERF_COUNTER rt_tick_sethook(user_code_insert_to_systick_handler); #endif -#if !defined(PKG_USING_PERF_COUNTER) || (defined(PKG_PERF_COUNTER_USING_THREAD_STATISTIC)) rt_scheduler_sethook(__rt_thread_scheduler_hook); -#endif } #ifdef PKG_USING_PERF_COUNTER @@ -93,7 +91,6 @@ void __ensure_systick_wrapper(void) { } -#ifdef PKG_PERF_COUNTER_USING_THREAD_STATISTIC #define DBG_TAG "perf_counter" #define DBG_LVL DBG_INFO #include @@ -106,5 +103,4 @@ static int _perf_counter_init(void) return 0; } INIT_PREV_EXPORT(_perf_counter_init); -#endif /* PKG_PERF_COUNTER_USING_THREAD_STATISTIC */ #endif /* PKG_USING_PERF_COUNTER */