aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/exit.c
diff options
context:
space:
mode:
authorShailabh Nagar <nagar@watson.ibm.com>2006-07-14 03:24:40 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-07-15 00:53:56 -0400
commitc757249af152c59fd74b85e52e8c090acb33d9c0 (patch)
tree78495f661fe537bf5087b24e6577659de8725b5a /kernel/exit.c
parentfb0ba6bd021248b6bdc58a7b1213a55a6776a38a (diff)
[PATCH] per-task-delay-accounting: taskstats interface
Create a "taskstats" interface based on generic netlink (NETLINK_GENERIC family), for getting statistics of tasks and thread groups during their lifetime and when they exit. The interface is intended for use by multiple accounting packages though it is being created in the context of delay accounting. This patch creates the interface without populating the fields of the data that is sent to the user in response to a command or upon the exit of a task. Each accounting package interested in using taskstats has to provide an additional patch to add its stats to the common structure. [akpm@osdl.org: cleanups, Kconfig fix] Signed-off-by: Shailabh Nagar <nagar@us.ibm.com> Signed-off-by: Balbir Singh <balbir@in.ibm.com> Cc: Jes Sorensen <jes@sgi.com> Cc: Peter Chubb <peterc@gelato.unsw.edu.au> Cc: Erich Focht <efocht@ess.nec.de> Cc: Levent Serinol <lserinol@gmail.com> Cc: Jay Lan <jlan@engr.sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/exit.c')
-rw-r--r--kernel/exit.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/kernel/exit.c b/kernel/exit.c
index 3c2cf91defa7..9852ed8c2988 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -25,6 +25,7 @@
25#include <linux/mount.h> 25#include <linux/mount.h>
26#include <linux/proc_fs.h> 26#include <linux/proc_fs.h>
27#include <linux/mempolicy.h> 27#include <linux/mempolicy.h>
28#include <linux/taskstats_kern.h>
28#include <linux/delayacct.h> 29#include <linux/delayacct.h>
29#include <linux/cpuset.h> 30#include <linux/cpuset.h>
30#include <linux/syscalls.h> 31#include <linux/syscalls.h>
@@ -844,6 +845,7 @@ static void exit_notify(struct task_struct *tsk)
844fastcall NORET_TYPE void do_exit(long code) 845fastcall NORET_TYPE void do_exit(long code)
845{ 846{
846 struct task_struct *tsk = current; 847 struct task_struct *tsk = current;
848 struct taskstats *tidstats, *tgidstats;
847 int group_dead; 849 int group_dead;
848 850
849 profile_task_exit(tsk); 851 profile_task_exit(tsk);
@@ -882,6 +884,8 @@ fastcall NORET_TYPE void do_exit(long code)
882 current->comm, current->pid, 884 current->comm, current->pid,
883 preempt_count()); 885 preempt_count());
884 886
887 taskstats_exit_alloc(&tidstats, &tgidstats);
888
885 acct_update_integrals(tsk); 889 acct_update_integrals(tsk);
886 if (tsk->mm) { 890 if (tsk->mm) {
887 update_hiwater_rss(tsk->mm); 891 update_hiwater_rss(tsk->mm);
@@ -901,7 +905,10 @@ fastcall NORET_TYPE void do_exit(long code)
901#endif 905#endif
902 if (unlikely(tsk->audit_context)) 906 if (unlikely(tsk->audit_context))
903 audit_free(tsk); 907 audit_free(tsk);
908 taskstats_exit_send(tsk, tidstats, tgidstats);
909 taskstats_exit_free(tidstats, tgidstats);
904 delayacct_tsk_exit(tsk); 910 delayacct_tsk_exit(tsk);
911
905 exit_mm(tsk); 912 exit_mm(tsk);
906 913
907 if (group_dead) 914 if (group_dead)