Stephen Hemminger a �crit :
It seems rtstat has a problem, at least on my dual cpu (x86) machine :

The 'entries' column seems ok, not the following ones (rt_cache in_hit, rt_cache in_slow_tot)

It seems only the last line from /proc/net/stat/rt_cache is taken into account, instead of summing all the lines (one line per cpu)

(only the first column 'entries' is not to be summed)


Thanks, try this patch. (it's going in next version).


Sorry but the first column should not be summed (entries)

So it should be something like :
                for (j = 0; j < lf->num_fields; j++)
                        if (j) lf->fields[j].values[i] += strtoul(ptr, &ptr, 
16);
                        else lf->fields[j].values[i] = strtoul(ptr, &ptr, 16);
        }

Well... I dont know if all the proc files parsed by this function has the same 
property (1st column duplicated for all cpus)

diff -Nru a/misc/lnstat_util.c b/misc/lnstat_util.c
--- a/misc/lnstat_util.c 2005-03-16 15:29:26 -08:00
+++ b/misc/lnstat_util.c 2005-03-16 15:29:26 -08:00
@@ -53,7 +53,7 @@
gettimeofday(&lf->last_read, NULL);
for (j = 0; j < lf->num_fields; j++)
- lf->fields[j].values[i] = strtoul(ptr, &ptr, 16);
+ lf->fields[j].values[i] += strtoul(ptr, &ptr, 16);
}
return num_lines;
}




- To unsubscribe from this list: send the line "unsubscribe linux-net" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html

Reply via email to