Re: Unknown HZ value! (1908) Assume 1024.

From: Tim Schmielau (tim@physik3.uni-rostock.de)
Date: Tue Feb 19 2002 - 04:43:05 EST


> > > /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/



This archive was generated by hypermail 2b29 : Sat Feb 23 2002 - 21:00:18 EST