add thread name to ucollection

Signed-off-by: negegne <zhengshunxin@huawei.com>
This commit is contained in:
negegne
2024-08-05 18:02:50 +08:00
parent c3adf85085
commit 733fdac1dc
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -96,6 +96,7 @@ static void get_thread_load(struct task_struct *task, int cur_count,
do_div(utime, NS_TO_MS);
do_div(stime, NS_TO_MS);
thread_cpu_item.tid = task->pid;
strcpy(thread_cpu_item.name, task->comm);
thread_cpu_item.cpu_usage_utime = utime;
thread_cpu_item.cpu_usage_stime = stime;
thread_cpu_item.cpu_load_time = 0;
+1
View File
@@ -39,6 +39,7 @@ struct ucollection_process_thread_count {
struct ucollection_thread_cpu_item {
int tid;
char name[16]; // 16 : max length of thread name
unsigned long long cpu_usage_utime;
unsigned long long cpu_usage_stime;
unsigned long long cpu_load_time;