Lines Matching refs:tsk
157 static void exe_add_tsk(struct taskstats *stats, struct task_struct *tsk) in exe_add_tsk() argument
160 struct file *exe_file = get_task_exe_file(tsk); in exe_add_tsk()
176 struct task_struct *tsk, struct taskstats *stats) in fill_stats() argument
186 delayacct_add_tsk(stats, tsk); in fill_stats()
190 stats->nvcsw = tsk->nvcsw; in fill_stats()
191 stats->nivcsw = tsk->nivcsw; in fill_stats()
192 bacct_add_tsk(user_ns, pid_ns, stats, tsk); in fill_stats()
195 xacct_add_tsk(stats, tsk); in fill_stats()
198 exe_add_tsk(stats, tsk); in fill_stats()
203 struct task_struct *tsk; in fill_stats_for_pid() local
205 tsk = find_get_task_by_vpid(pid); in fill_stats_for_pid()
206 if (!tsk) in fill_stats_for_pid()
208 fill_stats(current_user_ns(), task_active_pid_ns(current), tsk, stats); in fill_stats_for_pid()
209 put_task_struct(tsk); in fill_stats_for_pid()
215 struct task_struct *tsk, *first; in fill_stats_for_tgid() local
236 tsk = first; in fill_stats_for_tgid()
239 if (tsk->exit_state) in fill_stats_for_tgid()
247 delayacct_add_tsk(stats, tsk); in fill_stats_for_tgid()
250 delta = start_time - tsk->start_time; in fill_stats_for_tgid()
255 task_cputime(tsk, &utime, &stime); in fill_stats_for_tgid()
259 stats->nvcsw += tsk->nvcsw; in fill_stats_for_tgid()
260 stats->nivcsw += tsk->nivcsw; in fill_stats_for_tgid()
261 } while_each_thread(first, tsk); in fill_stats_for_tgid()
276 static void fill_tgid_exit(struct task_struct *tsk) in fill_tgid_exit() argument
280 spin_lock_irqsave(&tsk->sighand->siglock, flags); in fill_tgid_exit()
281 if (!tsk->signal->stats) in fill_tgid_exit()
290 delayacct_add_tsk(tsk->signal->stats, tsk); in fill_tgid_exit()
292 spin_unlock_irqrestore(&tsk->sighand->siglock, flags); in fill_tgid_exit()
572 static struct taskstats *taskstats_tgid_alloc(struct task_struct *tsk) in taskstats_tgid_alloc() argument
574 struct signal_struct *sig = tsk->signal; in taskstats_tgid_alloc()
579 if (stats || thread_group_empty(tsk)) in taskstats_tgid_alloc()
585 spin_lock_irq(&tsk->sighand->siglock); in taskstats_tgid_alloc()
596 spin_unlock_irq(&tsk->sighand->siglock); in taskstats_tgid_alloc()
605 void taskstats_exit(struct task_struct *tsk, int group_dead) in taskstats_exit() argument
622 is_thread_group = !!taskstats_tgid_alloc(tsk); in taskstats_exit()
627 fill_tgid_exit(tsk); in taskstats_exit()
639 task_pid_nr_ns(tsk, &init_pid_ns)); in taskstats_exit()
643 fill_stats(&init_user_ns, &init_pid_ns, tsk, stats); in taskstats_exit()
654 task_tgid_nr_ns(tsk, &init_pid_ns)); in taskstats_exit()
658 memcpy(stats, tsk->signal->stats, sizeof(*stats)); in taskstats_exit()