Lines Matching defs:task
28 unsigned long long __attribute__((weak)) get_proc_cpu_load(struct task_struct *task, char dmips[],
34 static void get_process_flt(struct task_struct *task, struct ucollection_process_cpu_item* proc_cpu_entry)
39 struct task_struct *t = task;
45 } while_each_thread(task, t);
47 struct signal_struct *sig = task->signal;
58 static unsigned long long get_process_load_cputime(struct task_struct *task)
61 proc_load_cputime = get_proc_cpu_load(task, dmips_values, DMIPS_NUM);
65 static void get_process_usage_cputime(struct task_struct *task, unsigned long long *ut, unsigned long long *st)
69 thread_group_cputime_adjusted(task, &utime, &stime);
76 static void get_process_load(struct task_struct *task, int cur_count,
81 proc_cpu_entry.pid = task->pid;
82 get_process_flt(task, &proc_cpu_entry);
83 proc_cpu_entry.cpu_load_time = get_process_load_cputime(task);
84 get_process_usage_cputime(task, &proc_cpu_entry.cpu_usage_utime, &proc_cpu_entry.cpu_usage_stime);
88 static void get_thread_load(struct task_struct *task, int cur_count,
94 utime = task->utime;
95 stime = task->stime;
98 thread_cpu_item.tid = task->pid;
99 strcpy(thread_cpu_item.name, task->comm);
108 struct task_struct *task = NULL;
120 task = &init_task;
121 for_each_process(task) {
122 if (task->pid != task->tgid)
130 get_process_load(task, kentry.cur_count, entry);
140 struct task_struct *task = NULL;
141 task = find_task_by_pid_ns(pid, &init_pid_ns);
142 if (task == NULL || !pid_alive(task)) {
145 return task;
150 struct task_struct *task = NULL;
154 task = &init_task;
155 for_each_process(task) {
156 if (task->pid != task->tgid) {
170 struct task_struct *task = get_alive_task_by_pid(kcount->pid);
171 if (task == NULL) {
172 pr_info("pid=%d is task NULL or not alive", kcount->pid);
177 struct task_struct *t = task;
180 } while_each_thread(task, t);
220 struct task_struct *task = get_alive_task_by_pid(kentry->filter.pid);
221 if (task == NULL) {
222 pr_info("pid=%d is task NULL not alive", kentry->filter.pid);
227 struct task_struct *t = task;
235 } while_each_thread(task, t);
295 struct task_struct *task = get_alive_task_by_pid(kentry.filter.pid);
296 if (task == NULL) {
297 pr_info("pid=%d is task null or not alive", kentry.filter.pid);
302 get_process_load(task, kentry.cur_count, entry);