Lines Matching refs:stats

171 		       struct task_struct *tsk, struct taskstats *stats)  in fill_stats()  argument
173 memset(stats, 0, sizeof(*stats)); in fill_stats()
181 delayacct_add_tsk(stats, tsk); in fill_stats()
184 stats->version = TASKSTATS_VERSION; in fill_stats()
185 stats->nvcsw = tsk->nvcsw; in fill_stats()
186 stats->nivcsw = tsk->nivcsw; in fill_stats()
187 bacct_add_tsk(user_ns, pid_ns, stats, tsk); in fill_stats()
190 xacct_add_tsk(stats, tsk); in fill_stats()
193 static int fill_stats_for_pid(pid_t pid, struct taskstats *stats) in fill_stats_for_pid() argument
204 fill_stats(current_user_ns(), task_active_pid_ns(current), tsk, stats); in fill_stats_for_pid()
209 static int fill_stats_for_tgid(pid_t tgid, struct taskstats *stats) in fill_stats_for_tgid() argument
225 if (first->signal->stats) in fill_stats_for_tgid()
226 memcpy(stats, first->signal->stats, sizeof(*stats)); in fill_stats_for_tgid()
228 memset(stats, 0, sizeof(*stats)); in fill_stats_for_tgid()
240 delayacct_add_tsk(stats, tsk); in fill_stats_for_tgid()
242 stats->nvcsw += tsk->nvcsw; in fill_stats_for_tgid()
243 stats->nivcsw += tsk->nivcsw; in fill_stats_for_tgid()
251 stats->version = TASKSTATS_VERSION; in fill_stats_for_tgid()
264 if (!tsk->signal->stats) in fill_tgid_exit()
273 delayacct_add_tsk(tsk->signal->stats, tsk); in fill_tgid_exit()
420 struct cgroupstats *stats; in cgroupstats_user_cmd() local
450 stats = nla_data(na); in cgroupstats_user_cmd()
451 memset(stats, 0, sizeof(*stats)); in cgroupstats_user_cmd()
453 rc = cgroupstats_build(stats, f.file->f_path.dentry); in cgroupstats_user_cmd()
512 struct taskstats *stats; in cmd_attr_pid() local
526 stats = mk_reply(rep_skb, TASKSTATS_TYPE_PID, pid); in cmd_attr_pid()
527 if (!stats) in cmd_attr_pid()
530 rc = fill_stats_for_pid(pid, stats); in cmd_attr_pid()
541 struct taskstats *stats; in cmd_attr_tgid() local
555 stats = mk_reply(rep_skb, TASKSTATS_TYPE_TGID, tgid); in cmd_attr_tgid()
556 if (!stats) in cmd_attr_tgid()
559 rc = fill_stats_for_tgid(tgid, stats); in cmd_attr_tgid()
585 struct taskstats *stats; in taskstats_tgid_alloc() local
587 if (sig->stats || thread_group_empty(tsk)) in taskstats_tgid_alloc()
591 stats = kmem_cache_zalloc(taskstats_cache, GFP_KERNEL); in taskstats_tgid_alloc()
594 if (!sig->stats) { in taskstats_tgid_alloc()
595 sig->stats = stats; in taskstats_tgid_alloc()
596 stats = NULL; in taskstats_tgid_alloc()
600 if (stats) in taskstats_tgid_alloc()
601 kmem_cache_free(taskstats_cache, stats); in taskstats_tgid_alloc()
603 return sig->stats; in taskstats_tgid_alloc()
611 struct taskstats *stats; in taskstats_exit() local
640 stats = mk_reply(rep_skb, TASKSTATS_TYPE_PID, in taskstats_exit()
642 if (!stats) in taskstats_exit()
645 fill_stats(&init_user_ns, &init_pid_ns, tsk, stats); in taskstats_exit()
653 stats = mk_reply(rep_skb, TASKSTATS_TYPE_TGID, in taskstats_exit()
655 if (!stats) in taskstats_exit()
658 memcpy(stats, tsk->signal->stats, sizeof(*stats)); in taskstats_exit()