On Solaris 10, and in C, I'd like to regularly query numbers like
- The CPU usage for specific LWPs within that OS process.
- The memory usage for that OS process.
I already know how to do the latter by opening /proc/pid/psinfo and reading from that (pr_rssize), but is there a way to implement the former?
In the past I have forked off a copy of prstat, parsed the output from that and read it back into my C code. As I'm looking to query more and more of this type of information, this is getting increasingly tedious, and just feels plain wrong. Surely there is a way to do this with some simple C code.
Thanks for any help. NickB