aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/binfmt_elf.c19
-rw-r--r--fs/proc/array.c8
2 files changed, 11 insertions, 16 deletions
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index 655ed8d30a86..a8635f637038 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -1333,20 +1333,15 @@ static void fill_prstatus(struct elf_prstatus *prstatus,
1333 prstatus->pr_pgrp = task_pgrp_vnr(p); 1333 prstatus->pr_pgrp = task_pgrp_vnr(p);
1334 prstatus->pr_sid = task_session_vnr(p); 1334 prstatus->pr_sid = task_session_vnr(p);
1335 if (thread_group_leader(p)) { 1335 if (thread_group_leader(p)) {
1336 struct task_cputime cputime;
1337
1336 /* 1338 /*
1337 * This is the record for the group leader. Add in the 1339 * This is the record for the group leader. It shows the
1338 * cumulative times of previous dead threads. This total 1340 * group-wide total, not its individual thread total.
1339 * won't include the time of each live thread whose state
1340 * is included in the core dump. The final total reported
1341 * to our parent process when it calls wait4 will include
1342 * those sums as well as the little bit more time it takes
1343 * this and each other thread to finish dying after the
1344 * core dump synchronization phase.
1345 */ 1341 */
1346 cputime_to_timeval(cputime_add(p->utime, p->signal->utime), 1342 thread_group_cputime(p, &cputime);
1347 &prstatus->pr_utime); 1343 cputime_to_timeval(cputime.utime, &prstatus->pr_utime);
1348 cputime_to_timeval(cputime_add(p->stime, p->signal->stime), 1344 cputime_to_timeval(cputime.stime, &prstatus->pr_stime);
1349 &prstatus->pr_stime);
1350 } else { 1345 } else {
1351 cputime_to_timeval(p->utime, &prstatus->pr_utime); 1346 cputime_to_timeval(p->utime, &prstatus->pr_utime);
1352 cputime_to_timeval(p->stime, &prstatus->pr_stime); 1347 cputime_to_timeval(p->stime, &prstatus->pr_stime);
diff --git a/fs/proc/array.c b/fs/proc/array.c
index 71c9be59c9c2..933953c4e407 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -395,20 +395,20 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns,
395 395
396 /* add up live thread stats at the group level */ 396 /* add up live thread stats at the group level */
397 if (whole) { 397 if (whole) {
398 struct task_cputime cputime;
398 struct task_struct *t = task; 399 struct task_struct *t = task;
399 do { 400 do {
400 min_flt += t->min_flt; 401 min_flt += t->min_flt;
401 maj_flt += t->maj_flt; 402 maj_flt += t->maj_flt;
402 utime = cputime_add(utime, task_utime(t));
403 stime = cputime_add(stime, task_stime(t));
404 gtime = cputime_add(gtime, task_gtime(t)); 403 gtime = cputime_add(gtime, task_gtime(t));
405 t = next_thread(t); 404 t = next_thread(t);
406 } while (t != task); 405 } while (t != task);
407 406
408 min_flt += sig->min_flt; 407 min_flt += sig->min_flt;
409 maj_flt += sig->maj_flt; 408 maj_flt += sig->maj_flt;
410 utime = cputime_add(utime, sig->utime); 409 thread_group_cputime(task, &cputime);
411 stime = cputime_add(stime, sig->stime); 410 utime = cputime.utime;
411 stime = cputime.stime;
412 gtime = cputime_add(gtime, sig->gtime); 412 gtime = cputime_add(gtime, sig->gtime);
413 } 413 }
414 414