]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - kernel/exit.c
[PATCH] per-task-delay-accounting: taskstats interface
[net-next-2.6.git] / kernel / exit.c
index 3c2cf91defa764842939405aac8e1cfae29c191b..9852ed8c29885f5b5c808accc92cb2a73e5c85e0 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/mount.h>
 #include <linux/proc_fs.h>
 #include <linux/mempolicy.h>
+#include <linux/taskstats_kern.h>
 #include <linux/delayacct.h>
 #include <linux/cpuset.h>
 #include <linux/syscalls.h>
@@ -844,6 +845,7 @@ static void exit_notify(struct task_struct *tsk)
 fastcall NORET_TYPE void do_exit(long code)
 {
        struct task_struct *tsk = current;
+       struct taskstats *tidstats, *tgidstats;
        int group_dead;
 
        profile_task_exit(tsk);
@@ -882,6 +884,8 @@ fastcall NORET_TYPE void do_exit(long code)
                                current->comm, current->pid,
                                preempt_count());
 
+       taskstats_exit_alloc(&tidstats, &tgidstats);
+
        acct_update_integrals(tsk);
        if (tsk->mm) {
                update_hiwater_rss(tsk->mm);
@@ -901,7 +905,10 @@ fastcall NORET_TYPE void do_exit(long code)
 #endif
        if (unlikely(tsk->audit_context))
                audit_free(tsk);
+       taskstats_exit_send(tsk, tidstats, tgidstats);
+       taskstats_exit_free(tidstats, tgidstats);
        delayacct_tsk_exit(tsk);
+
        exit_mm(tsk);
 
        if (group_dead)