SourceFiles.org - Use the Source, Luke
Home | Register | News | Forums | Guide | MyLinks | Bookmark

Related Sites

Latest News
  General News
  Reviews
  Press Releases
  Software
  Hardware
  Security
  Tutorials
  Off Topic


Back to files

pscpug will graph the CPU percent of a process. The process ID of the process to watch must be given on the command line. Optionally, the time to wait between each graph redraw can be specified.

The program requires curses or ncurses.

USAGE
pscpug [-gs] [-w wait time for refresh] pid

...for example, after compiling:
./pscpug -w1 5054
...will graph the specified PID from 0% to 100% cpu usage every second.

When the specified process ID exits, pscpug will quit and print statistics about the %CPU used by the process (average, maximum, and minimum).

You can also quit pscpug by pressing any key on the keyboard.

ARGUMENTS

-w     the delay between samples
-s     silences the statistics printed when pscpug stops running
-g     forces pscpug to gather process statistics in the most 
       generic way posible   

BUILD & INSTALL
./configure
make
make install (optional, as root, to install pscpug)

MINUTIAE
pscpug has some optimizations to allow it to perform faster (and, ideally, more cleanly) on BSD derivitives. If you seem to be getting bizarre values from pscpug, you can run it with the -g flag to tell the program to use its generic form of process information gathering. If you seem to have any strange issues on any platform, please send a bug report to mercadal@diablonet.net

If you are on a BSD or Mac OS X machine, pscpug prefers to run at elevated privileges so it can read process information via kernel internals. If you run pscpug without the necessary privileges, it will suggest you run the program with -g to force generic mode.

KNOWN ISSUES:

  • At this point, pscpug is only expected to run on (correctly) BSD and Linux flavors. Feel free to try to build and run it on other unix-like OSes, however, the program may simply not work at all.
  • If you make a command line argument such as -w 0, you'll notice that pscpug will run really fast. It will also eat lots of CPU time. This is probably a feature.
  • If you run pscpug on a dumb terminal, or if your terminal doesn't have a corresponding termcap entry on your system, there will be upsettingly little graphed about the process. Namely, nothing.

TO-DO
* Support for Sun, other bizarre unix flavors. * Dumb terminal support (and support for users without curses). * Test on other BSDs and Linux distros. This most recent version has been tested on Mac OS X, NetBSD, and Slackware. Previous versions also worked on OpenBSD (this version is expected to work, too). * Perhaps take multiple process IDs off the command line, and display them possibly in different colors or something.

THE NAME
pscpug was meant to be some sort of abbreviation of the words process, cpu, and graph. Maybe this is self evident?

If you notice any issues, please e-mail me at mercadal@diablonet.net and tell me what's up. Thanks!


Other Sites

Discussion Groups
  Beginners
  Distributions
  Networking / Security
  Software
  PDAs

About | FAQ | Privacy | Awards | Contact
Comments to the webmaster are welcome.
Copyright 2006 Sourcefiles.org All rights reserved.