public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: roel <12o3l@tiscali.nl>
To: Guillaume Chazarain <guichaz@yahoo.fr>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 7/8] taskstats: fix stats->ac_exitcode to work on threads and	use group_exit_code
Date: Wed, 26 Sep 2007 22:47:54 +0200	[thread overview]
Message-ID: <46FAC57A.3090309@tiscali.nl> (raw)
In-Reply-To: <20070926162831.29434.29622.stgit@cheypa.inria.fr>

Guillaume Chazarain wrote:

[...]

> @@ -65,13 +65,15 @@ void bacct_add_tsk(struct taskstats *stats, struct task_struct *tsk)
>  void bacct_fill_threadgroup(struct taskstats *stats, struct task_struct *tsk,
>  			    bool tg_stats)
>  {
> +	int group_exit_code;
> +
>  	fill_wall_times(stats, tsk);
>  
> -	if (thread_group_leader(tsk)) {
> -		stats->ac_exitcode = tsk->exit_code;
> -		if (tsk->flags & PF_FORKNOEXEC)
> -			stats->ac_flag |= AFORK;
> -	}
> +	if (thread_group_leader(tsk) && ((tsk->flags & PF_FORKNOEXEC)))

	if (thread_group_leader(tsk) && (tsk->flags & PF_FORKNOEXEC))

> +		stats->ac_flag |= AFORK;
> +
> +	group_exit_code = tg_stats ? tsk->signal->group_exit_code : 0;
> +	stats->ac_exitcode = group_exit_code ? : tsk->exit_code;

Isn't this just confusing? why not

	if (tg_stats) {
		group_exit_code = tsk->signal->group_exit_code;
		stats->ac_exitcode = group_exit_code;
		
	} else {
		group_exit_code = 0;
		stats->ac_exitcode = tsk->exit_code;
	}

  reply	other threads:[~2007-09-26 20:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-26 16:28 [PATCH 1/8] taskstats: fix indentation of long argument lists Guillaume Chazarain
2007-09-26 16:28 ` [PATCH 2/8] taskstats: split the basic accounting fields Guillaume Chazarain
2007-09-26 16:28 ` [PATCH 3/8] taskstats: split the extended " Guillaume Chazarain
2007-09-26 16:28 ` [PATCH 4/8] taskstats: separate PID/TGID stats producers to complete the TGID ones Guillaume Chazarain
2007-09-26 16:28 ` [PATCH 5/8] taskstats: factor out version and context switch accounting Guillaume Chazarain
2007-09-26 16:28 ` [PATCH 6/8] taskstats: tell fill_threadgroup_stats() if it replies with PID or TGID stats Guillaume Chazarain
2007-09-26 16:28 ` [PATCH 7/8] taskstats: fix stats->ac_exitcode to work on threads and use group_exit_code Guillaume Chazarain
2007-09-26 20:47   ` roel [this message]
2007-09-26 20:55     ` Guillaume Chazarain
2007-09-26 16:28 ` [PATCH 8/8] taskstats: avoid breaking binary compatibility between taskstats v6 and before Guillaume Chazarain
  -- strict thread matches above, loose matches on Subject: below --
2007-09-26 17:08 [PATCH 1/8] taskstats: fix indentation of long argument lists Guillaume Chazarain
2007-09-26 17:08 ` [PATCH 7/8] taskstats: fix stats->ac_exitcode to work on threads and use group_exit_code Guillaume Chazarain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46FAC57A.3090309@tiscali.nl \
    --to=12o3l@tiscali.nl \
    --cc=akpm@linux-foundation.org \
    --cc=guichaz@yahoo.fr \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox