Forum Discussion
Altera_Forum
Honored Contributor
21 years agohello Scott,
thank you for answer, I investigated more your idea and found following: - /proc/vmstat does not contain info about cpu utilization, I think it highly depends on target system (NIOS, PC,..), even more there exist no application "vmstat" as in normal linux (I tried it in cygwin, and there it works) - but I went through all /proc system report files and found, that /proc/stat produces required info abt CPU utilization on the first line identified by "cpu" keyword - ok I told to me - try to make app, which will extract this line and compute CPU usage - this was succesfully done, but the results are not so good, because: - I think the time consumed by idle and user(system) apps. which is indicated in /proc/stat increases (and also decreases) very very slowly, when another strong process starts (or stops) to have heavy load on CPU. In my example I had CPU usage at about 2 or 3 % in idle state, when I ran heavy IP communication, then NIOS2 CPU usage raised to 95 % but after abt. 5 minutes!! http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gif which is of course impossible delay time for any testing.. maybe there is some settings for kernel to force him to measure more precisely, but I do not believe this.. ?? - I also tried my small application under cygwin in normal PC and it also seems to have a great lag (the current CPU usage value looks like to be averaged in long time - for ex. in one minute) - ok, now I have decided to follow my first idea with my own special application for measuring CPU usage, I will see, but I believe in succes http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gif or another ideas?