Lines Matching refs:stats
180 struct task_struct *tsk, struct taskstats *stats) in fill_stats() argument
182 memset(stats, 0, sizeof(*stats)); in fill_stats()
190 delayacct_add_tsk(stats, tsk); in fill_stats()
193 stats->version = TASKSTATS_VERSION; in fill_stats()
194 stats->nvcsw = tsk->nvcsw; in fill_stats()
195 stats->nivcsw = tsk->nivcsw; in fill_stats()
196 bacct_add_tsk(user_ns, pid_ns, stats, tsk); in fill_stats()
199 xacct_add_tsk(stats, tsk); in fill_stats()
202 static int fill_stats_for_pid(pid_t pid, struct taskstats *stats) in fill_stats_for_pid() argument
213 fill_stats(current_user_ns(), task_active_pid_ns(current), tsk, stats); in fill_stats_for_pid()
218 static int fill_stats_for_tgid(pid_t tgid, struct taskstats *stats) in fill_stats_for_tgid() argument
234 if (first->signal->stats) in fill_stats_for_tgid()
235 memcpy(stats, first->signal->stats, sizeof(*stats)); in fill_stats_for_tgid()
237 memset(stats, 0, sizeof(*stats)); in fill_stats_for_tgid()
249 delayacct_add_tsk(stats, tsk); in fill_stats_for_tgid()
251 stats->nvcsw += tsk->nvcsw; in fill_stats_for_tgid()
252 stats->nivcsw += tsk->nivcsw; in fill_stats_for_tgid()
260 stats->version = TASKSTATS_VERSION; in fill_stats_for_tgid()
273 if (!tsk->signal->stats) in fill_tgid_exit()
282 delayacct_add_tsk(tsk->signal->stats, tsk); in fill_tgid_exit()
423 struct cgroupstats *stats; in cgroupstats_user_cmd() local
453 stats = nla_data(na); in cgroupstats_user_cmd()
454 memset(stats, 0, sizeof(*stats)); in cgroupstats_user_cmd()
456 rc = cgroupstats_build(stats, f.file->f_dentry); in cgroupstats_user_cmd()
515 struct taskstats *stats; in cmd_attr_pid() local
529 stats = mk_reply(rep_skb, TASKSTATS_TYPE_PID, pid); in cmd_attr_pid()
530 if (!stats) in cmd_attr_pid()
533 rc = fill_stats_for_pid(pid, stats); in cmd_attr_pid()
544 struct taskstats *stats; in cmd_attr_tgid() local
558 stats = mk_reply(rep_skb, TASKSTATS_TYPE_TGID, tgid); in cmd_attr_tgid()
559 if (!stats) in cmd_attr_tgid()
562 rc = fill_stats_for_tgid(tgid, stats); in cmd_attr_tgid()
588 struct taskstats *stats; in taskstats_tgid_alloc() local
590 if (sig->stats || thread_group_empty(tsk)) in taskstats_tgid_alloc()
594 stats = kmem_cache_zalloc(taskstats_cache, GFP_KERNEL); in taskstats_tgid_alloc()
597 if (!sig->stats) { in taskstats_tgid_alloc()
598 sig->stats = stats; in taskstats_tgid_alloc()
599 stats = NULL; in taskstats_tgid_alloc()
603 if (stats) in taskstats_tgid_alloc()
604 kmem_cache_free(taskstats_cache, stats); in taskstats_tgid_alloc()
606 return sig->stats; in taskstats_tgid_alloc()
614 struct taskstats *stats; in taskstats_exit() local
643 stats = mk_reply(rep_skb, TASKSTATS_TYPE_PID, in taskstats_exit()
645 if (!stats) in taskstats_exit()
648 fill_stats(&init_user_ns, &init_pid_ns, tsk, stats); in taskstats_exit()
656 stats = mk_reply(rep_skb, TASKSTATS_TYPE_TGID, in taskstats_exit()
658 if (!stats) in taskstats_exit()
661 memcpy(stats, tsk->signal->stats, sizeof(*stats)); in taskstats_exit()