Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Tue, 19 Feb 2002 04:43:34 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Tue, 19 Feb 2002 04:43:24 -0500 Received: from gans.physik3.uni-rostock.de ([139.30.44.2]:39684 "EHLO gans.physik3.uni-rostock.de") by vger.kernel.org with ESMTP id ; Tue, 19 Feb 2002 04:43:08 -0500 Date: Tue, 19 Feb 2002 10:43:05 +0100 (CET) From: Tim Schmielau To: Tom Holroyd cc: kernel mailing list Subject: Re: Unknown HZ value! (1908) Assume 1024. In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org > > > /proc/stat: > > > cpu 2427984276 2540057284 67737892 4296620451 > > > cpu0 2427984276 2540057284 67737892 4296620451 > > > ... > > > > > I'd suggest changing the declarations in kstat_read_proc to > > > > unsigned long jif = jiffies, user = 0, nice = 0, system = 0; > > unsigned int sum = 0; > > > > so that ticks that are lost due to overflow count as "other". > > Isn't it also necessary to change the sprintf() format strings to %lu? > That is, > len = sprintf(page, "cpu %lu %lu %lu %lu\n", user, nice, system, > jif * smp_num_cpus - (user + nice + system)); > Sorry, I got it wrong. What I actually wanted to suggest is: leave the declarations as they are now, but do the "other" calculation with longs, i.e.: len = sprintf(page, "cpu %u %u %u %lu\n", user, nice, system, jif * smp_num_cpus - ((unsigned long) user + nice + system)); - 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/