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
200 fill_stats(current_user_ns(), task_active_pid_ns(current), tsk, stats); in fill_stats_for_pid()
205 static int fill_stats_for_tgid(pid_t tgid, struct taskstats *stats) in fill_stats_for_tgid() argument
223 if (first->signal->stats) in fill_stats_for_tgid()
224 memcpy(stats, first->signal->stats, sizeof(*stats)); in fill_stats_for_tgid()
226 memset(stats, 0, sizeof(*stats)); in fill_stats_for_tgid()
239 delayacct_add_tsk(stats, tsk); in fill_stats_for_tgid()
245 stats->ac_etime += delta; in fill_stats_for_tgid()
248 stats->ac_utime += div_u64(utime, NSEC_PER_USEC); in fill_stats_for_tgid()
249 stats->ac_stime += div_u64(stime, NSEC_PER_USEC); 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()
403 struct cgroupstats *stats; in cgroupstats_user_cmd() local
433 stats = nla_data(na); in cgroupstats_user_cmd()
434 memset(stats, 0, sizeof(*stats)); in cgroupstats_user_cmd()
436 rc = cgroupstats_build(stats, f.file->f_path.dentry); in cgroupstats_user_cmd()
494 struct taskstats *stats; in cmd_attr_pid() local
508 stats = mk_reply(rep_skb, TASKSTATS_TYPE_PID, pid); in cmd_attr_pid()
509 if (!stats) in cmd_attr_pid()
512 rc = fill_stats_for_pid(pid, stats); in cmd_attr_pid()
523 struct taskstats *stats; in cmd_attr_tgid() local
537 stats = mk_reply(rep_skb, TASKSTATS_TYPE_TGID, tgid); in cmd_attr_tgid()
538 if (!stats) in cmd_attr_tgid()
541 rc = fill_stats_for_tgid(tgid, stats); in cmd_attr_tgid()
567 struct taskstats *stats; in taskstats_tgid_alloc() local
569 if (sig->stats || thread_group_empty(tsk)) in taskstats_tgid_alloc()
573 stats = kmem_cache_zalloc(taskstats_cache, GFP_KERNEL); in taskstats_tgid_alloc()
576 if (!sig->stats) { in taskstats_tgid_alloc()
577 sig->stats = stats; in taskstats_tgid_alloc()
578 stats = NULL; in taskstats_tgid_alloc()
582 if (stats) in taskstats_tgid_alloc()
583 kmem_cache_free(taskstats_cache, stats); in taskstats_tgid_alloc()
585 return sig->stats; in taskstats_tgid_alloc()
593 struct taskstats *stats; in taskstats_exit() local
622 stats = mk_reply(rep_skb, TASKSTATS_TYPE_PID, in taskstats_exit()
624 if (!stats) in taskstats_exit()
627 fill_stats(&init_user_ns, &init_pid_ns, tsk, stats); in taskstats_exit()
635 stats = mk_reply(rep_skb, TASKSTATS_TYPE_TGID, in taskstats_exit()
637 if (!stats) in taskstats_exit()
640 memcpy(stats, tsk->signal->stats, sizeof(*stats)); in taskstats_exit()