1

In Linux, I could discover the number of running and blocked processes running

grep "procs_running" /proc/stat

and

grep "procs_blocked" /proc/stat

Is there a way to do it in Mac OS X? Preferably, a way which I could use in a shell script?

1 Answer 1

0

Have you thought about parsing something like:

ps -AO wqb,wqr,flags,state

this via script for your proc info? Between the workqueue threadcount, proc.h flags, and state that should be enough to grep up any snapshot statistics... Or perhaps not. Let me know!

2
  • Actually, I thought about counting the number of lines of ps aux output but I was not sure if ps aux would list all processes. Also, I do not know if it is possible to know whether a processes is blocked or running using ps...
    – brandizzi
    Dec 13, 2010 at 18:35
  • Well, the only solution I've found was something like this... It is better explained in unix.stackexchange.com/questions/4794/… Thank you anyway!
    – brandizzi
    Dec 14, 2010 at 14:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .