Old blogs

Tracing in Carbide C++

General - March 31st, 2008 - Written by Vasili Prikhodko

This is one of the subjects that we like to talk the least. Historically s60 and Symbian programmers had a lot of Printf statements in their code for code coverage and we tried to steer them away from doing it toward debugging with TRK or stop-mode JTAG debugging. But frankly, there are timing problems that can’t be solved with debugging; this is where Tracing comes to plate, since it can provide precise info with the timestamps on code execution. Not to mention programmer’s desire to reap rewards from the investment in previously instrumented code.
Nokia has hardware-assisted tools that help in getting the tracing info from an s60 target and internal developers are quite familiar with it. Unfortunately these tools are not available for third party s60 and Symbian (UIQ, MOAP) developers.
So what can Carbide provide to these developers and not require them to buy expensive tracing hardware/software solutions? Right now the only solution is run-time gathering of tracing info (printfs) while debugging with TRK. For this users have to enable “View unframed messages from communication port” option in the ‘Debugger’ tab of their TRK launch configuration and start a new debug session. This solution is rather limited since TRK simply listens on the output port and redirects the messages to the console within Carbide. It is up to the developers to insert timing and other application info into the output data. The info inside trace output console of Carbide can’t be sorted, grouped or manipulated in any other way. Also it assumes that TRK is running on target and will not be suitable for tracing that precedes TRK launch. I would like to improve this functionality and was looking into what else is already available for other third party Symbian developers.

One tracing solution that I discovered is utrace/btrace provided by Symbian:

http://www.symbian.com/developer/techlib/v9.2docs/doc_source/ToolsAndUtilities/GeneralPurposeLogging/generalpurposelogging.html

To summarize it Symbian provides APIs and a plug-in tool that helps developers to instrument code, then users build their apps and run it on device. The output file is generated in Symbian file system, which users have to transfer to PC and view in an editor of their choice. Now, we could make some Carbide plugins that would simplify the transfer of the file for viewing into Carbide and add the sorting/graphing/analysis to the imported data or even create a direct link to the target and display run-time updates, based on the updated tracing into.
There are other less featured facilities in Symbian framework that provide tracing support, like flogger library. But since they don’t provide nothing more then we already have with TRK tracing capabilities I will not discuss it here.
If you use tracing extensively in your work and can provide any other ideas we would really appreciate it.

About the author Vasili Prikhodko

  • Number of posts: 15

Comments are closed.