!118 采集cpu负载pid 校验修改为current->tgid

Merge pull request !118 from 杨世琦_hw/master
This commit is contained in:
openharmony_ci
2024-04-19 01:41:02 +00:00
committed by Gitee
+3 -3
View File
@@ -224,9 +224,9 @@ static long ioctrl_collect_app_thread_cpu(void __user *argp)
}
memset(&kentry, 0, sizeof(struct ucollection_thread_cpu_entry));
(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);
if (current->tgid != kentry.filter.pid || kentry.cur_count >= kentry.total_count) {
pr_err("pid=%d is not self current tgid:%d , or current count over total count"
, kentry.filter.pid, current->tgid);
return -EINVAL;
}
return read_thread_info_locked(&kentry, entry);