[opensuse-kernel] proc/<pid>/stat timestamp will not be altered
Hi, I'm trying to readout some load values out of the /proc/<pid>/stat file. As I want to do this only when there were some values changed I do a fstat beforehand on this file to check the modification time. Unfortunatelly, this value never changed even I this file was altered (it is working systems with kernel 2.4). I've tested it on several 2.6 kernels. So, is it possible to enable the "timestamping" for procfs (again) or do you now some workaround how I can check if some values has been changed without parsing the stat-file it every time. Thanks, Stefan -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-kernel+help@opensuse.org
I'm trying to readout some load values out of the /proc/<pid>/stat file. As I want to do this only when there were some values changed I do a fstat beforehand on this file to check the modification time. Unfortunatelly, this value never changed even I this file was altered (it is working systems with kernel 2.4). I've tested it on several 2.6 kernels.
So, is it possible to enable the "timestamping" for procfs (again) or do you now some workaround how I can check if some values has been changed without parsing the stat-file it every time. Since /proc/<pid>/stat is generated on the fly as you read it from
Hi, On Thu 10-09-09 14:53:18, Stefan Haas wrote: process internal structures, kernel really doesn't know when the structures last changed. So timestamping for procfs isn't really possible now. But since /proc/<pid>/stat is quite small, I suppose you could just read it every time and first binary compare the strings. If they match, you don't have to parse again... That should be pretty quick. Honza -- Jan Kara <jack@suse.cz> SUSE Labs, CR -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-kernel+help@opensuse.org
participants (2)
-
Jan Kara
-
Stefan Haas