Re: Add all thread stats for TASKSTATS_CMD_ATTR_TGID (v5)

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Guillaume Chazarain <guichaz@...>
Cc: <balbir@...>, Jonathan Lim <jlim@...>, Linux Kernel Mailing List <linux-kernel@...>, Jay Lan <jlan@...>, Oleg Nesterov <oleg@...>, Michael Neuling <mikey@...>
Date: Thursday, September 20, 2007 - 2:20 am

On Tue, 18 Sep 2007 00:23:39 +0200 Guillaume Chazarain <guichaz@yahoo.fr> wrote:


This patch conflicts somewhat with
add-scaled-time-to-taskstats-based-process-accounting.patch

I fixed it up like this:

void bacct_add_tsk(struct taskstats *stats, struct task_struct *task)
{
	if (task->flags & PF_SUPERPRIV)
		stats->ac_flag |= ASU;
	if (task->flags & PF_DUMPCORE)
		stats->ac_flag |= ACORE;
	if (task->flags & PF_SIGNALED)
		stats->ac_flag |= AXSIG;
	if (thread_group_leader(task) && (task->flags & PF_FORKNOEXEC))
		/*
		 * Threads are created by do_fork() and don't exec but not in
		 * the AFORK sense, as the latter involves fork(2).
		 */
		stats->ac_flag |= AFORK;

	stats->ac_utimescaled +=
		cputime_to_msecs(task->utimescaled) * USEC_PER_MSEC;
	stats->ac_stimescaled +=
		cputime_to_msecs(task->stimescaled) * USEC_PER_MSEC;
	stats->ac_utime	 += cputime_to_msecs(task->utime) * USEC_PER_MSEC;
	stats->ac_stime	 += cputime_to_msecs(task->stime) * USEC_PER_MSEC;
	stats->ac_minflt += task->min_flt;
	stats->ac_majflt += task->maj_flt;
}

(note the s/=/+=/ in there) but it all needs reviewing and checking and
testing please.
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Add all thread stats for TASKSTATS_CMD_ATTR_TGID, Guillaume Chazarain, (Thu Aug 2, 9:53 am)
Re: [PATCH] Add all thread stats for TASKSTATS_CMD_ATTR_TGID, Guillaume Chazarain, (Sun Aug 19, 3:34 pm)
Re: [PATCH] Add all thread stats for TASKSTATS_CMD_ATTR_TGID, Guillaume Chazarain, (Sat Aug 25, 11:10 am)
Re: [PATCH] Add all thread stats for TASKSTATS_CMD_ATTR_TGID, Guillaume Chazarain, (Mon Sep 10, 9:03 am)
Add all thread stats for TASKSTATS_CMD_ATTR_TGID (v3), Guillaume Chazarain, (Fri Aug 31, 8:35 am)
Re: Add all thread stats for TASKSTATS_CMD_ATTR_TGID (v3), Andrew Morton, (Wed Sep 12, 8:18 pm)
Add all thread stats for TASKSTATS_CMD_ATTR_TGID (v4), Guillaume Chazarain, (Sat Sep 15, 2:42 pm)
Add all thread stats for TASKSTATS_CMD_ATTR_TGID (v5), Guillaume Chazarain, (Mon Sep 17, 6:23 pm)
Re: Add all thread stats for TASKSTATS_CMD_ATTR_TGID (v5), Andrew Morton, (Thu Sep 20, 2:20 am)
Re: Add all thread stats for TASKSTATS_CMD_ATTR_TGID (v5), Oleg Nesterov, (Thu Sep 20, 8:16 am)
Re: Add all thread stats for TASKSTATS_CMD_ATTR_TGID (v5), Oleg Nesterov, (Tue Sep 18, 11:29 am)
Re: [PATCH] Add all thread stats for TASKSTATS_CMD_ATTR_TGID, Guillaume Chazarain, (Sun Aug 26, 5:44 am)