[RFC][PATCH v2 3/7] taskstats: Add thread group ID to taskstats structure

From: Michael Holzheu
Date: Thu Nov 11 2010 - 12:08:24 EST


From: Michael Holzheu <holzheu@xxxxxxxxxxxxxxxxxx>

The tgid is important for aggregating threads in user space. Therefore we
add the tgid to the taskstats structure.

Signed-off-by: Michael Holzheu <holzheu@xxxxxxxxxxxxxxxxxx>
---
include/linux/taskstats.h | 1 +
kernel/tsacct.c | 1 +
2 files changed, 2 insertions(+)

--- a/include/linux/taskstats.h
+++ b/include/linux/taskstats.h
@@ -167,6 +167,7 @@ struct taskstats {

/* Timestamp where data has been collected in ns since boot time */
__u64 time_ns;
+ __u32 ac_tgid; /* Thread group ID */
};


--- a/kernel/tsacct.c
+++ b/kernel/tsacct.c
@@ -56,6 +56,7 @@ void bacct_add_tsk(struct taskstats *sta
stats->ac_nice = task_nice(tsk);
stats->ac_sched = tsk->policy;
stats->ac_pid = tsk->pid;
+ stats->ac_tgid = tsk->tgid;
rcu_read_lock();
tcred = __task_cred(tsk);
stats->ac_uid = tcred->uid;

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/