Re: Historical cpu consumption information?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Wendell Nichols wrote:
> My fedora 10 laptop routinely "freezes".  That means the menu's and 
> applications don't respond to mouse clicks.  After a few seconds (or 
> sometimes many seconds) it frees up and works normally again.  If I look 
> at the cpu consumption graph I can see that something had the processer 
> pegged at 100% but what?  during the episode there is no way to switch 
> to top or the ksysguard process list because the system is 
> unresponsive.  So how do I find out what caused the lockup?
> wcn

Here's a possibility.

$ while true; do date>>time.log; ps g -f --sort=utime,stime | head -n 3 
 >> time.log; sleep 1; done

As root, use renice to set the process to run at high priority;
it might help. Perhaps you'll need to use nice in the loop to
force things to run.

That file will grow fairly rapidly, so you might want to set up another
one to delete the file once an hour or day or so. You may want or need
to tweak the number of lines you capture, and how often it runs.

When an "event" occurs, you could kill the process, and

$ tail -n 24 time.log

to see the last 6 entries. To look at other entries, you could use
something like

$ tail -n 40 time.log | head -n 24

if you've got a few at the end to omit. The example shows you
what happened 10 seconds ago. This might save time loading
it into a text editor or whatever.

$ tail -n 80 time.log | less

Might be good. Anyway, once you've got the data, you'll think
of ways to proceed.

Crude, but it may get you what you want.

You got the suggestion to run top, but running top in batch mode
results in a very rapidly growing log file, possibly too rapidly.
I don't know of a way to limit the output top produces.

Mike
-- 
p="p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
Oppose globalization and One World Governments like the UN.
This message made from 100% recycled bits.
You have found the bank of Larn.
I speak only for myself, and I am unanimous in that!
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux