Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758444AbZC3Jzy (ORCPT ); Mon, 30 Mar 2009 05:55:54 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756913AbZC3Jzd (ORCPT ); Mon, 30 Mar 2009 05:55:33 -0400 Received: from yx-out-2324.google.com ([74.125.44.28]:10081 "EHLO yx-out-2324.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756747AbZC3Jzb (ORCPT ); Mon, 30 Mar 2009 05:55:31 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=PToiSPfQd39MMG2v0rU5iL4ZWZkaXnctA2NSELvuSQBTNsOwjh0UIcIpT7TBZ8DeId iZLq5Wn/p7L7YdnMy8pe/qAkJpzEs6WfyMNIKOMyiliPlfb3bmGC7qGaE6/bHlkxWPCH wUbluS/hr4ltz6v07t4tK9DcIXEoRMIFkYejo= Date: Mon, 30 Mar 2009 11:55:23 +0200 From: Frederic Weisbecker To: Lai Jiangshan Cc: Ingo Molnar , Steven Rostedt , Li Zefan , LKML Subject: Re: [PATCH] tracing: fix incorrect return type of ns2usecs() Message-ID: <20090330095522.GA6058@nowhere> References: <49D041ED.1060007@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <49D041ED.1060007@cn.fujitsu.com> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1458 Lines: 38 On Mon, Mar 30, 2009 at 11:52:13AM +0800, Lai Jiangshan wrote: > > Impact: fix time output bug in 32bits system > > ns2usecs() returns 'long', it's incorrect. > > (In i386) > # cat trace > ... > -0 [000] 521.442100: _spin_lock <-tick_do_update_jiffies64 > -0 [000] 521.442101: do_timer <-tick_do_update_jiffies64 > -0 [000] 521.442102: update_wall_time <-do_timer > -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 > ... > -0 [001] 4154502640.134759: rcu_bh_qsctr_inc <-__do_softirq > -0 [001] 4154502640.134760: _local_bh_enable <-__do_softirq > -0 [001] 4154502640.134761: idle_cpu <-irq_exit > ... > (very large value) > Because 'long' is a signed type and is 32bits in i386. > > Signed-off-by: Lai Jiangshan > Reported-by: Li Zefan > Tested-by: Lai Jiangshan Acked-by: Frederic Weisbecker -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/