Diagnose a CPU load on WinCE

Hi community,

We have an existing application running with a Colibri T20 under Windows CE 6 and developed in C #.
This application sometimes encounters 100% CPU load issues remaining indefinitely (until you close the application or shutdow the board).
This issue is not reproducible on demand.
We suspect a task with blocking loop problem consuming the entire processor time.

Do you have tools or other tips allowing us to more easily identify the cause of this CPU load?
For example libraries able to return the processor time used per thread (with name) that we can write in the periodic logs, …
Other tips to solve my problem are welcome.

Thanks in advance,
Arnaud.

Dear @Arnaud,

This kind of issue can be debugged using Kernel tracker. Please refer below documentation links for more information.

One such case study

You can download our standard releases binary BSP and Workspace from here : https://developer.toradex.com/software/windows-embedded-compact/t20-t30-wec-software#Binary_Image_BSP_and_Workspace_Downloads
We have Toradex task manager tool. Alteast you would find which process is consuming the CPU load there.

Please feel free to contact us if you need any help on this.

Dear @Arnaud

You can download and run the Toradex Task Manager in order to measure the CPU load of individual processes and threads.
However, the tool operates on native elements. I actually never analyzed whether there is a direct relation between managed and native processes and threads.

Regards, Andy

Dear Raja and Andy,

Thanks for those quick answers.
Yes, I already use Toradex Task Manager 2.0. This utility is very useful but I only use it during debug mode.
Can we use Toradex Task Manager as from an API (dll or other) to use it and log the same information in our application in a test environment?

Currently, we use the native functions (NvRmDfsGetClockUtilization) encapsulated in a dll to monitor the overall CPU load. It’s work fine.
Now, we would also like to monitor the load of certain processes / threads.
The thread informations of the process will be averaged over a time range to avoid too large logs.

Is it possible? which direction should I take?

Regards, Arnaud.

Dear @Arnaud

You can use the GetThreadTimes() function to query the CPU load per thread.

Regards, Andy