This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compiler/LAUNCHXL-CC1352P: CPU load analysis without using TI SYSBIOS.utils.load

Part Number: LAUNCHXL-CC1352P
Other Parts Discussed in Thread: SYSBIOS

Tool/software: TI C/C++ Compiler

Hello,

I am running a project which is build using makefiles generated using CMake and the TI compiler armcl. I've got it to build successfully and was able to run code on it successfully. 

I would like to profile the code for CPU load. I have a number of threads and would like to find out the CPU utilization of each thread. I am not explicitly calling out any tasks such as the idle tasks in my code - just a main function that calls other threads which form the application.

I am not able to use the .cfg file as I do not know how to include it in my build, and I get errors if I do try. I would like to know if there is a way to profile the CPU utilization without using the sysbios.utils.load module, and using functions such as Load_calculateLoad, Load_getTaskLoad etc. Would it involve manually counting the time in each thread versus total time taken by the program? If so, If I have to have a global timer that updates the time spent in the relevant thread using Clock_getTicks(), how would I compute the total time spent in the program?

Warm regards,

Samyukta

  • Samyukta,

    Using the modules provided by SYS/BIOS requires the use of a .cfg file. Only then will the content referenced and required by SYS/BIOS source files be present when the application is built. You'll have to figure out how to include a .cfg file and the processing of it in your CMake project. We currently have no examples built using CMake to help you with this effort.

    Alan

  • Hi Alan,

    I understand that I will need a .cfg file in order to use the modules provided by SYS/BIOS, but I was asking if it is possible to find out the CPU utilization another way, using only software and such that I will not have to include a .cfg file or use the SYS/BIOS modules - if it is possible to use clock ticks or another way to find a per-thread CPU utilization.

    Warm regards,

    Samyukta

  • Hi Alan,

    Thanks for your response. I'm not asking how to use SYS/BIOS modules without a .cfg file or how to include the .cfg file in the project using CMake, but how I would do a per-thread CPU utilization in software only, and if there are any functions or modules such as Clock_getTicks() to do so. 

  • I think I'm still not understanding your question.

    When you ask if there are any functions or modules such as (the SYS/BIOS function) Clock_getTicks(), I assume you're using SYS/BIOS source files.

    Or are you asking if a function like Clock_getTicks() exists somewhere outside of SYS/BIOS, (as in some third-party library)? If that is your question, then I'd suggest you google the topic of CPU load calculation on cortexM devices. I suspect there are generic approaches using the SysTick timer as a timebase.

    Alan

  • Hi Alan,

    Thanks for your response!

    Sorry, I didn't realize that Clock_getTicks() was a part of the SYS/BIOS module - I was able to make it work without the .cfg files.

    But I was asking about using some sort of timer to calculate CPU load as opposed to some of the built-in modules.

    Warm regards,

    Samyukta

  • Almost all Cortex-M devices have an internal 24 bit SysTick Timer that runs at the CPU clock speed.

    You can use this timer to calculate CPU load.