diff options
| author | Shell <[email protected]> | 2024-06-04 00:06:41 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-06-04 00:06:41 +0800 |
| commit | 6ca327d8ce1d9c98204ab7c6d62123cfd5e12dcf (patch) | |
| tree | ed2cd81b10d249c22c07271d8f94085dbffd1c30 /components | |
| parent | e03342ff6b237d3ac6c38e133cb23b9770281f4a (diff) | |
[smart] add CPU/thread usage tracing config (#8947)
* [smart] add CPU usage tracing config
This patch introduces following features:
- Added CPU usage tracing functionality, enabled by default, for
applications like 'top'
- update time as smart independent
Signed-off-by: Shell <[email protected]>
* fixup: add ump idle thread
---------
Signed-off-by: Shell <[email protected]>
Diffstat (limited to 'components')
| -rw-r--r-- | components/lwp/Kconfig | 6 | ||||
| -rw-r--r-- | components/lwp/lwp.c | 34 |
2 files changed, 3 insertions, 37 deletions
diff --git a/components/lwp/Kconfig b/components/lwp/Kconfig index 16b23c4dd7..b42dfa585d 100644 --- a/components/lwp/Kconfig +++ b/components/lwp/Kconfig @@ -12,9 +12,9 @@ if RT_USING_LWP if LWP_DEBUG config LWP_DEBUG_INIT - select RT_USING_HOOKLIST - bool "Enable debug mode of init process" - default n + select RT_USING_HOOKLIST + bool "Enable debug mode of init process" + default n endif config RT_LWP_MAX_NR diff --git a/components/lwp/lwp.c b/components/lwp/lwp.c index de2c3b5133..e8092226ca 100644 --- a/components/lwp/lwp.c +++ b/components/lwp/lwp.c @@ -686,37 +686,3 @@ rt_err_t lwp_backtrace_frame(rt_thread_t uthread, struct rt_hw_backtrace_frame * } return rc; } - -void rt_update_process_times(void) -{ - struct rt_thread *thread; -#ifdef RT_USING_SMP - struct rt_cpu* pcpu; - - pcpu = rt_cpu_self(); -#endif - - thread = rt_thread_self(); - - if (!IS_USER_MODE(thread)) - { - thread->user_time += 1; -#ifdef RT_USING_SMP - pcpu->cpu_stat.user += 1; -#endif - } - else - { - thread->system_time += 1; -#ifdef RT_USING_SMP - if (thread == pcpu->idle_thread) - { - pcpu->cpu_stat.idle += 1; - } - else - { - pcpu->cpu_stat.system += 1; - } -#endif - } -} |
