1 /*
2  * Copyright (C) 2015-2018 Alibaba Group Holding Limited
3  */
4 
5 #ifndef DEBUG_CPUUSAGE_H
6 #define DEBUG_CPUUSAGE_H
7 
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11 
12 #define CPU_USAGE_MAX_TASKNAME_LEN 32
13 
14 struct cpuusage_data {
15     char taskname[CPU_USAGE_MAX_TASKNAME_LEN];
16     float *cpuusage;
17 };
18 
19 void     debug_task_cpu_usage_stats(void);
20 uint32_t debug_task_cpu_usage_get(ktask_t *task);
21 uint32_t debug_total_cpu_usage_get(uint32_t cpuid);
22 void     debug_total_cpu_usage_show(struct cpuusage_data *cpuusage_record, int32_t record_len, int32_t index);
23 kstat_t  debug_task_cpu_usage_init(void);
24 void     debug_cpuusage_cmds_register(void);
25 
26 #ifdef __cplusplus
27 }
28 #endif
29 
30 #endif /* DEBUG_CPUUSAGE_H */
31