public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <srostedt@redhat.com>
To: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Ingo Molnar <mingo@elte.hu>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Li Zefan <lizf@cn.fujitsu.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] tracing: fix incorrect return type of ns2usecs() V2
Date: Fri, 03 Apr 2009 12:13:52 -0400	[thread overview]
Message-ID: <1238775232.3250.20.camel@localhost.localdomain> (raw)
In-Reply-To: <49D05D10.4030009@cn.fujitsu.com>


On Mon, 2009-03-30 at 13:48 +0800, Lai Jiangshan wrote:
> Impact: fix time output bug in 32bits system
> 
> ns2usecs() returns 'long', it's incorrect.
> 
> (In i386)
> # cat trace
> ...
>           <idle>-0     [000]   521.442100: _spin_lock <-tick_do_update_jiffies64
>           <idle>-0     [000]   521.442101: do_timer <-tick_do_update_jiffies64
>           <idle>-0     [000]   521.442102: update_wall_time <-do_timer
>           <idle>-0     [000]   521.442102: update_xtime_cache <-update_wall_time
> ....
> (It always print the time less than 2200 seconds besides ...)
> Because 'long' is 32bits in i386. ( (1<<31) useconds is about 2200 seconds)
> 
> # cat trace
> ...
>           <idle>-0     [001] 4154502640.134759: rcu_bh_qsctr_inc <-__do_softirq
>           <idle>-0     [001] 4154502640.134760: _local_bh_enable <-__do_softirq
>           <idle>-0     [001] 4154502640.134761: idle_cpu <-irq_exit
> ...
> (very large value)
> Because 'long' is a signed type and it is 32bits in i386.
> 
> Changed from V1:
> return 'unsigned long long' instead of 'cycle_t'
> 
> Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
> Reported-by: Li Zefan <lizf@cn.fujitsu.com>


Thanks, applied.

-- Steve



  reply	other threads:[~2009-04-03 16:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-30  3:52 [PATCH] tracing: fix incorrect return type of ns2usecs() Lai Jiangshan
2009-03-30  5:48 ` [PATCH] tracing: fix incorrect return type of ns2usecs() V2 Lai Jiangshan
2009-04-03 16:13   ` Steven Rostedt [this message]
2009-04-07 13:12   ` [tip:tracing/urgent] tracing: fix incorrect return type of ns2usecs() Lai Jiangshan
2009-03-30  9:55 ` [PATCH] " Frederic Weisbecker

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=1238775232.3250.20.camel@localhost.localdomain \
    --to=srostedt@redhat.com \
    --cc=fweisbec@gmail.com \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizf@cn.fujitsu.com \
    --cc=mingo@elte.hu \
    /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