I have a program running that creates five threads. I want to determine (1) how much CPU time each thread is using, and (2) how much memory each thread is using. I tried the hogs utility, but it does not indicate CPU usage per thread, it only shows that for the ‘main’ program.
Is there some other way I can determine how much CPU time each thread is using? (Two of the threads are running at a higher priority than the other three, so I can’t divide 100% by 5…) Doesn’t look like getrusage() will help either, since the child threads run forever.
I can look at the build map to identify the amount of code-space each thread uses. Is there an easy way I can determine how much data-space each thread uses?
Someone told me about the QNX System Profiler that is a part of the QNX Momentics IDE. Using that with the instrumented kernel (or instrumented microkernel, depending on the documentation) looks like it will give me what I’m looking for - at least for the CPU usage. Also found out that since memory is allocated to processes rather than threads, memory usage can’t be broken down by thread usage; so total process usage it will be!