Re: Unknown HZ value! (1908) Assume 1024.
Tim Schmielau (firstname.lastname@example.org)
Tue, 19 Feb 2002 10:43:05 +0100 (CET)
> > > /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 email@example.com
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/