lkml.org 
[lkml]   [2002]   [Apr]   [22]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
FromDenis Vlasenko <>
SubjectRe: /proc/stat weirdness
DateMon, 22 Apr 2002 09:41:26 -0200
On 21 April 2002 16:27, Mark Hahn wrote:
> > * top with continuous update
> > * output of "while true; do cat /proc/stat; done | grep -F 'cpu  '"
>
> I told you, I don't ever see any of this phenomenon.

I'd like to add that it is easily seen only on slower boxes.
It was really hard to catch on PIII 800 (1458 BogoMIPS):
top was too slow refreshing, cat script however was fast enough when 
redirected to file to show backstepping. See below.

Hey lkml folks, please run:
# while true; do cat /proc/stat; done | grep -F 'cpu  ' >/tmp/log
do you see something like this?
cpu  1170 0 3066 28631
cpu  1170 0 3066 28632
cpu  1170 0 3066 28634
cpu  1170 0 3067 28634
cpu  1171 0 3067 28634
cpu  1171 0 3067 28635 <<<
cpu  1171 0 3069 28634 <<<
cpu  1171 0 3070 28634 <<<
cpu  1171 0 3070 28635
cpu  1171 0 3070 28636
cpu  1172 0 3070 28637
cpu  1172 0 3071 28637

Or better yet, this hunter script:
#!/bin/sh
prev=0
while true; do cat /proc/stat; done | \
grep -F 'cpu  ' | \
cut -d ' ' -f 6 | \
while read next; do
    diff=$(($next-$prev))
    if test $diff -lt 0; then
        echo "$prev -> $next"
    fi
    prev=$next
done
It will print only 'bad' idle counter pairs
--
vda
-
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/

\
 
 \ /
  Last update: 2005-03-22 12:25    [from the cache]
©2003-2008