CPU Hogging

Hello,

I have an application running on QNX RTOS and ARM-Le Cortex.
Some thread in the application hoggs the CPU and the CPU consumption reaches upto 90%. After the CPU load reaches 90% every thing stops responding.
My questions are: -
How to resolve this issue?? Through kernel trace, I was able to find the Thread which is hogging the CPU but how to find which function in
the thread is hogging the CPU?? :unamused:

Do you have the source code? There is a profiling feature in Momentics (which I’ve never used). Do you know what the thread is doing? I would think that some careful reflection on your part would make the answer obvious.

Yes right QNX has the Application Profiler which you can use to find out the function that is hogging your CPU. Let us know if you succeed.

Hello All,

Thank you for responding.

Actually, I explored the option of QNX application profiler but that
seems to be more complex because I do not have even “qconn” running
on the target.

Is there any other way to find which function in the thread
is actully hogging the CPU using core dump or something??

Is dumper running, is there a core dump generated?

You say that everything stops responding but you manage to get a kernel trace, how is that possible?

If you can run sloginfo, if the program did a SIGSEGV it will show up in the sloginfo output. It will show the address where it crashed, then if you have a map file for the executable you might be able to figure out in which fonction it happened.

You might want to ask yourself, how can I watch my TV without plugging it in?

There are ways to find out what you want, but they involve doing something.
If you can’t put “qconn” on the target, then you don’t have enough control to fix the problem.

Here is a more programatic way that I assume you also can’t do.

At the beginning of every routine, set a global variable with a unique number. In a separate thread, loop with a sleep. Increment counts in a table with the global variable as your index. After a while, check the table and see who’s hogging.