Lines Matching defs:task

38 	struct task_struct *task, *next_task;
48 task = get_pid_task(pid, PIDTYPE_TGID);
49 if (!task)
55 return task;
60 * same for task_seq_start() to pick up the correct task.
64 task = get_pid_task(pid, PIDTYPE_PID);
66 return task;
73 task = get_pid_task(pid, PIDTYPE_PID);
74 if (!task)
78 if (!pid_alive(task)) {
79 put_task_struct(task);
83 next_task = next_thread(task);
84 put_task_struct(task);
101 if (skip_if_dup_files && task->files == task->group_leader->files) {
102 task = next_task;
113 struct task_struct *task = NULL;
122 task = get_pid_task(pid, PIDTYPE_TGID);
127 return task;
132 task = task_group_seq_get_next(common, tid, skip_if_dup_files);
135 return task;
143 task = get_pid_task(pid, PIDTYPE_PID);
144 if (!task) {
147 } else if (skip_if_dup_files && !thread_group_leader(task) &&
148 task->files == task->group_leader->files) {
149 put_task_struct(task);
150 task = NULL;
157 return task;
163 struct task_struct *task;
165 task = task_seq_get_next(&info->common, &info->tid, false);
166 if (!task)
171 return task;
177 struct task_struct *task;
182 task = task_seq_get_next(&info->common, &info->tid, false);
183 if (!task)
186 return task;
191 __bpf_md_ptr(struct task_struct *, task);
194 DEFINE_BPF_ITER_FUNC(task, struct bpf_iter_meta *meta, struct task_struct *task)
196 static int __task_seq_show(struct seq_file *seq, struct task_struct *task,
209 ctx.task = task;
234 if ((!!linfo->task.tid + !!linfo->task.pid + !!linfo->task.pid_fd) > 1)
237 aux->task.type = BPF_TASK_ITER_ALL;
238 if (linfo->task.tid != 0) {
239 aux->task.type = BPF_TASK_ITER_TID;
240 aux->task.pid = linfo->task.tid;
242 if (linfo->task.pid != 0) {
243 aux->task.type = BPF_TASK_ITER_TGID;
244 aux->task.pid = linfo->task.pid;
246 if (linfo->task.pid_fd != 0) {
247 aux->task.type = BPF_TASK_ITER_TGID;
249 pid = pidfd_get_pid(linfo->task.pid_fd, &flags);
254 aux->task.pid = tgid;
273 struct task_struct *task;
286 * it held a reference to the task/file.
290 if (info->task) {
291 curr_task = info->task;
296 info->task = NULL;
300 /* set info->task */
301 info->task = curr_task;
323 /* the current task is done, go to the next task */
328 info->task = NULL;
332 info->task = NULL;
343 info->task = NULL;
363 __bpf_md_ptr(struct task_struct *, task);
369 struct task_struct *task, u32 fd,
386 ctx.task = info->task;
405 put_task_struct(info->task);
406 info->task = NULL;
415 common->type = aux->task.type;
416 common->pid = aux->task.pid;
440 struct task_struct *task;
469 if (info->task) {
470 curr_task = info->task;
502 * Process the next task.
532 /* new task, process the first vma */
582 info->task = curr_task;
592 info->task = NULL;
600 info->task = NULL;
628 __bpf_md_ptr(struct task_struct *, task);
633 struct task_struct *task, struct vm_area_struct *vma)
648 ctx.task = info->task;
677 put_task_struct(info->task);
678 info->task = NULL;
698 switch (aux->task.type) {
700 info->iter.task.tid = aux->task.pid;
703 info->iter.task.pid = aux->task.pid;
713 seq_printf(seq, "task_type:\t%s\n", iter_task_type_names[aux->task.type]);
714 if (aux->task.type == BPF_TASK_ITER_TID)
715 seq_printf(seq, "tid:\t%u\n", aux->task.pid);
716 else if (aux->task.type == BPF_TASK_ITER_TGID)
717 seq_printf(seq, "pid:\t%u\n", aux->task.pid);
721 .target = "task",
726 { offsetof(struct bpf_iter__task, task),
747 { offsetof(struct bpf_iter__task_file, task),
770 { offsetof(struct bpf_iter__task_vma, task),
780 BPF_CALL_5(bpf_find_vma, struct task_struct *, task, u64, start,
792 if (!task)
795 mm = task->mm;
807 callback_fn((u64)(long)task, (u64)(long)vma,