mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-21 22:21:21 +00:00
[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>
This commit is contained in:
parent
fb0ba6bd02
commit
c757249af1
8 changed files with 646 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue