linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: Problem with the /proc filesystem
@ 2004-03-17 19:16 Llfrg
  0 siblings, 0 replies; 3+ messages in thread
From: Llfrg @ 2004-03-17 19:16 UTC (permalink / raw)
  To: florian.zimmermann; +Cc: linux-c-programming

Yes, I see the same behavior using watch. Does anyone else confirms that bug? It seems to happen when idle time is zero, or close to zero, try running a "cpu consuming" process and 'watch'. I'll have my program to consider cpu idle time equals to 0 on that case.

I am using:
Linux version 2.4.18-24.7.x (bhcompile@sylvester.devel.redhat.com) (gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-112)) #1 Fri Jan 31 07:06:03 EST 2003

Thanks.
Leonardo

Em um e-mail de Qua, 17 Mar 2004 1:57:21 PM Hora Padrão da Costa Leste, Florian Zimmermann <florian.zimmermann@gmx.net> escreveu:

>you can test the same by using 'watch', e.g.
># watch -n1 cat /proc/stat
>
>if the errors occurs as well with 'watch' it is likely
>that the proc kernel interface is buggy.
>otherwise you should post your own code here to analyse 
>whats wrong.
>
>Florian
>
>On Wed, 2004-03-17 at 19:02, Llfrg@aol.com wrote:
>> Hello,
>> 
>> I am reading the first line of /proc/stat once per second. Sometimes a bug seems to occur, which is the value of the cpu idle time become lower than the cpu idle time collected one second earlier. Does anyone know what may be happening? Below is the output of my program. Idle means the last cpu idle time read from /proc/stat and old_id is the previous cpu idle time read.
>> 
>> Thanks
>> 
>> ###Program output:
>> 
>> Idle: 210097666 old_id: 210097666
>> user: 100 nice: 0 system: 3 idle: 0 total: 103
>>  
>> Idle: 210097666 old_id: 210097666
>> user: 101 nice: 0 system: 2 idle: 0 total: 103
>>  
>> Idle: 210097666 old_id: 210097666
>> user: 78 nice: 0 system: 25 idle: 0 total: 103
>>  
>> Idle: 210097667 old_id: 210097666
>> user: 97 nice: 0 system: 6 idle: 1 total: 104
>>  
>> Idle: 210097666 old_id: 210097667
>> user: 102 nice: 0 system: 2 idle: 4294967295 total: 103
>> BUUUUG
>>  
>> Idle: 210097666 old_id: 210097666
>> user: 101 nice: 0 system: 2 idle: 0 total: 103
>>  
>> Idle: 210097667 old_id: 210097666
>> user: 101 nice: 0 system: 2 idle: 1 total: 104
>>  
>> Idle: 210097666 old_id: 210097667
>> user: 101 nice: 0 system: 3 idle: 4294967295 total: 103
>> BUUUUG
>> -
>> To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>
>
-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread
* Problem with the /proc filesystem
@ 2004-03-17 18:02 Llfrg
  2004-03-17 18:57 ` Florian Zimmermann
  0 siblings, 1 reply; 3+ messages in thread
From: Llfrg @ 2004-03-17 18:02 UTC (permalink / raw)
  To: linux-c-programming

Hello,

I am reading the first line of /proc/stat once per second. Sometimes a bug seems to occur, which is the value of the cpu idle time become lower than the cpu idle time collected one second earlier. Does anyone know what may be happening? Below is the output of my program. Idle means the last cpu idle time read from /proc/stat and old_id is the previous cpu idle time read.

Thanks

###Program output:

Idle: 210097666 old_id: 210097666
user: 100 nice: 0 system: 3 idle: 0 total: 103
 
Idle: 210097666 old_id: 210097666
user: 101 nice: 0 system: 2 idle: 0 total: 103
 
Idle: 210097666 old_id: 210097666
user: 78 nice: 0 system: 25 idle: 0 total: 103
 
Idle: 210097667 old_id: 210097666
user: 97 nice: 0 system: 6 idle: 1 total: 104
 
Idle: 210097666 old_id: 210097667
user: 102 nice: 0 system: 2 idle: 4294967295 total: 103
BUUUUG
 
Idle: 210097666 old_id: 210097666
user: 101 nice: 0 system: 2 idle: 0 total: 103
 
Idle: 210097667 old_id: 210097666
user: 101 nice: 0 system: 2 idle: 1 total: 104
 
Idle: 210097666 old_id: 210097667
user: 101 nice: 0 system: 3 idle: 4294967295 total: 103
BUUUUG

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-03-17 19:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-17 19:16 Problem with the /proc filesystem Llfrg
  -- strict thread matches above, loose matches on Subject: below --
2004-03-17 18:02 Llfrg
2004-03-17 18:57 ` Florian Zimmermann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).