From 80eede24f4edf7bc36b3f6a0f6c62ffed2474ebe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E4=B8=96=E7=90=A6=5Fhw?= <670097973@qq.com> Date: Wed, 27 Mar 2024 18:35:37 +0800 Subject: [PATCH] fix code check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 杨世琦_hw <670097973@qq.com> --- ucollection/ucollection_process_cpu.c | 6 ++-- ucollection/unified_collection_data.h | 48 +++++++++++++-------------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/ucollection/ucollection_process_cpu.c b/ucollection/ucollection_process_cpu.c index 206a5dc..925c434 100644 --- a/ucollection/ucollection_process_cpu.c +++ b/ucollection/ucollection_process_cpu.c @@ -176,7 +176,7 @@ static long ioctrl_collect_thread_count(void __user *argp) } static long read_thread_info_locked(struct ucollection_thread_cpu_entry *kentry, - struct ucollection_thread_cpu_entry __user *entry) + struct ucollection_thread_cpu_entry __user *entry) { rcu_read_lock(); if (!is_pid_alive(kentry->filter.pid)) { @@ -218,7 +218,7 @@ static long ioctrl_collect_app_thread_cpu(void __user *argp) (void)copy_from_user(&kentry, entry, sizeof(struct ucollection_thread_cpu_entry)); if (current->pid != kentry.filter.pid || kentry.cur_count >= kentry.total_count) { pr_err("pid=%d is not self current:%d , or current count over total count" - , kentry.filter.pid, current->pid); + , kentry.filter.pid, current->pid); return -EINVAL; } return read_thread_info_locked(&kentry, entry); @@ -236,7 +236,7 @@ static long ioctrl_collect_the_thread_cpu(void __user *argp) (void)copy_from_user(&kentry, entry, sizeof(struct ucollection_thread_cpu_entry)); if (kentry.cur_count >= kentry.total_count) { pr_err("pid=%d is not self current:%d , or current count over total count" - , kentry.filter.pid, current->pid); + , kentry.filter.pid, current->pid); return -EINVAL; } return read_thread_info_locked(&kentry, entry); diff --git a/ucollection/unified_collection_data.h b/ucollection/unified_collection_data.h index faf9a69..cdeda88 100644 --- a/ucollection/unified_collection_data.h +++ b/ucollection/unified_collection_data.h @@ -32,49 +32,49 @@ struct ucollection_process_cpu_entry { }; struct ucollection_process_thread_count { - uint32_t pid; - uint32_t thread_count; + uint32_t pid; + uint32_t thread_count; }; struct ucollection_thread_cpu_item { - int tid; - unsigned long long cpu_usage_utime; - unsigned long long cpu_usage_stime; - unsigned long long cpu_load_time; + int tid; + unsigned long long cpu_usage_utime; + unsigned long long cpu_usage_stime; + unsigned long long cpu_load_time; }; struct ucollection_thread_filter { - int uid; - int pid; - int tid; + int uid; + int pid; + int tid; }; struct ucollection_thread_cpu_entry { - int magic; - unsigned int total_count; - unsigned int cur_count; - struct ucollection_thread_filter filter; - struct ucollection_thread_cpu_item datas[]; + int magic; + unsigned int total_count; + unsigned int cur_count; + struct ucollection_thread_filter filter; + struct ucollection_thread_cpu_item datas[]; }; enum collection_type { - COLLECT_ALL_PROC = 1, - COLLECT_THE_PROC, - COLLECT_APP_PROC, - COLLECT_PROC_COUNT, - COLLECT_THREAD_COUNT, - COLLECT_APP_THREAD, - COLLECT_THE_THREAD, + COLLECT_ALL_PROC = 1, + COLLECT_THE_PROC, + COLLECT_APP_PROC, + COLLECT_PROC_COUNT, + COLLECT_THREAD_COUNT, + COLLECT_APP_THREAD, + COLLECT_THE_THREAD, }; #define DMIPS_NUM 128 #define IOCTRL_COLLECT_CPU_BASE 0 #define IOCTRL_COLLECT_ALL_PROC_CPU _IOR(IOCTRL_COLLECT_CPU_BASE, COLLECT_ALL_PROC, \ - struct ucollection_process_cpu_entry) + struct ucollection_process_cpu_entry) #define IOCTRL_COLLECT_THE_PROC_CPU _IOR(IOCTRL_COLLECT_CPU_BASE, COLLECT_THE_PROC, \ - struct ucollection_process_cpu_entry) + struct ucollection_process_cpu_entry) #define IOCTRL_COLLECT_THREAD_COUNT _IOR(IOCTRL_COLLECT_CPU_BASE, COLLECT_THREAD_COUNT, \ - struct ucollection_process_thread_count) + struct ucollection_process_thread_count) #define IOCTRL_COLLECT_APP_THREAD _IOR(IOCTRL_COLLECT_CPU_BASE, COLLECT_APP_THREAD, struct ucollection_thread_cpu_entry) #define IOCTRL_COLLECT_THE_THREAD _IOR(IOCTRL_COLLECT_CPU_BASE, COLLECT_THE_THREAD, struct ucollection_thread_cpu_entry) #endif // __UNIFIED_COLLECTION_DATA__ \ No newline at end of file -- Gitee