I don't know if there is an option in RDKB for analyzing high CPU usage. But you can use "top -H" to get the per-thread CPU usage of all the processes. Provided that the threads used in your application are named. You should be able to start your debugging with this.
6 Comments
Z-Vijayaragavalu Sundaresan
On one of the product that will have Cable Gateway with WiFi which runs with RDKB, sometimes the CPU usage reaches to 50% for CcspPandMSsp process.
can you please let me know if there is any option in RDK to know which thread or which area causing more CPU usage.
' top ' result during when CPU reaches to 45%
Please let me know if anymore information to be shared here other than version information.
Z-Harikrishnan P H
I don't know if there is an option in RDKB for analyzing high CPU usage. But you can use "top -H" to get the per-thread CPU usage of all the processes. Provided that the threads used in your application are named. You should be able to start your debugging with this.
Z-Vijayaragavalu Sundaresan
Hi Z-Harikrishnan P H,
Thanks for your suggestion.
The BusyBox which we are using , does not enable -H option for 'top' , hence unable to do this.
Z-Harikrishnan P H
Can you try "printf h | top -n 1" . Or executing top command and then entering the h/H key. Usually, busybox supports showing per-thread usage of CPU.
Z-Vijayaragavalu Sundaresan
I tired "printf h | top -n 1" and also "printf H | top -n 1" , it is not taking h/H options
and also top command is not taking H or h keyboard input . but it takes S,R,N,M key board inputs.
Z-Vijayaragavalu Sundaresan
Can you please help me how to enable backtrace on CcspPandMSsp and CcspWifiSsp
I did as below
1) Enabled Debug symbol on CcspPandMSsp/CcspWifiSsp in recipes-ccsp
+CFLAGS_append += "-DRDKLOGGER_SUPPORT_WIFI"
+DEBUG_BUILD = "1"
with this change , made sure that CcspPandMSsp and CcspWifiSsp agent executable enabled with debug sysmbol(confirmed with nm tool)
2) changed as below in WifiSsp/ssp_main.c (and also similar change inPandMSsp/ssp_main.c ) to print backtrace for signal USR1
3) NFS mount the root filesystem to avoid striping of symbols in CcspPandMSsp and CcspWifiSsp
4) During when CPU usage reached to 50% , sent the signal to CcspWifiSsp process using "kill"
Eg : kill -s USR1 7579
5) made sure from /rdklogs/logs/WiFilog.txt.0 log file , the USR1 signal has been received and _print_stack_backtrace() has been called.
6) but there were no backtrace log present.
what i understood is , backtrace is not returning valid count instead it returns 0
(PS : I also make sure that execinfo.h included to the build and "-D_NO_EXECINFO_H_" has not been included to my build )
Could you please let me know if i am missing anything here to enable backtrace.