mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Petr Tesarik <ptesarik@suse.cz>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Oleg Nesterov <oleg@redhat.com>,
	Roland McGrath <roland@redhat.com>
Subject: Re: Fix clock_gettime with CLOCK_PROCESS_CPUTIME_ID
Date: Mon, 24 Nov 2008 16:32:31 +0100 (CET)	[thread overview]
Message-ID: <alpine.LFD.2.00.0811241625050.3301@localhost.localdomain> (raw)
In-Reply-To: <1227537991.20064.6.camel@nathan.suse.cz>

On Mon, 24 Nov 2008, Petr Tesarik wrote:

> Since CLOCK_PROCESS_CPUTIME_ID is in fact translated to -6, the switch
> statement in cpu_clock_sample_group() must first mask off the irrelevant
> bits, similar to cpu_clock_sample().
> 
> Signed-off-by: Petr Tesarik <ptesarik@suse.cz>

Good catch. Applied.

Thanks,

	tglx

> --
>  posix-cpu-timers.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/posix-cpu-timers.c b/kernel/posix-cpu-timers.c
> --- a/kernel/posix-cpu-timers.c
> +++ b/kernel/posix-cpu-timers.c
> @@ -311,7 +311,7 @@ static int cpu_clock_sample_group(const clockid_t which_clock,
>  	struct task_cputime cputime;
>  
>  	thread_group_cputime(p, &cputime);
> -	switch (which_clock) {
> +	switch (CPUCLOCK_WHICH(which_clock)) {
>  	default:
>  		return -EINVAL;
>  	case CPUCLOCK_PROF:
> 
> 

      reply	other threads:[~2008-11-24 15:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-24 14:46 Petr Tesarik
2008-11-24 15:32 ` Thomas Gleixner [this message]

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=alpine.LFD.2.00.0811241625050.3301@localhost.localdomain \
    --to=tglx@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@redhat.com \
    --cc=ptesarik@suse.cz \
    --cc=roland@redhat.com \
    /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

all inboxes | Powered by JetHome®