http://bugzilla.novell.com/show_bug.cgi?id=520112
User steiner-reg@bio.ifi.lmu.de added comment
http://bugzilla.novell.com/show_bug.cgi?id=520112#c9
--- Comment #9 from Frank Steiner 2009-09-23 05:11:13 MDT ---
Hmm, I changed the reading of /proc/stat so that the file is kept open and the
strace output of xosview became just
read(3, "cpu 52501 47423 92018 327105710"..., 8191) = 8191
lseek(3, 0, SEEK_SET) = 0
nanosleep({0, 100000000}, NULL) = 0
read(3, "cpu 52501 47423 92018 327105734"..., 8191) = 8191
..
but still increases the sys column and makes the CPU bar jump. The strange
thing is: This little program:
#include <fstream>
#include <iostream>
static const char STATFILENAME[] = "/proc/stat";
std::ifstream stats( STATFILENAME, std::ios::in );
void run( void ){
char buf[1024];
while(true){
stats.read(buf,sizeof(buf));
stats.clear();
stats.seekg(0,std::ios::beg);
usleep( (unsigned int) 100000);
}
}
int main( int argc, char *argv[] ) {
run();
return 0;
}
compiled with "g++ -c main.cc -o main.o ; g++ -o xosview main.o" does increase
the sys column on any SLES 11 server about once a second. The same program
compiled and run on any SLES 10 host leaves the sys column unchanged (up to a
minute until some other process does sth).
So there must have been a change in the kernel or a c++ library or sth.
I couldn't figure our how gkrellm avoids the increase. Doing the same little
program in C just like gkrellm does it,increases the sys column, too. But
gkrellm is using some timer/ticks stuff which seems to prevent this, even if it
updates every tenth of a second.
--
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.