Applications for Symbian

[ 9110 page ]

This page is meant to serve as a repository for my freeware applications for Symbian devices - as usual, they come with no warranty and no promise of support. ;-)


Proof-of-concept CPU monitoring

I wrote this program as I am not currently aware of any other attempts at providing CPU usage monitoring for Symbian. Even though this may not seem quite as important on a system that is typically not used for heavy multi-tasking, I still found it useful in development to be able to check for any time consuming background processes that may be accidently triggered by careless use of timers and drain the battery.

This application is very bare-bones (built on the foundations of the HelloWorld sample from the SDK). As most CPU monitors, it is self-calibrating, i.e. it assumes that the lowest ever CPU usage it has seen is considered as "0%", even though this may already include some background activity by the system itself. This explains why CPU usage with CPUMon in the foreground will go up to about 1% after you have switched back to another application at least once - it has then experienced the system's performance without the load of updating its own graphics and made that its new baseline for performance.

One possibilty to make it more useful is to set it as the Preferred Application in the Extras menu, so you can always switch back to it by hitting Ctrl-Extras after profiling another application in the foreground.


Series 60 screenshotJust a few words on the principle, in the hope that somebody else picks up on the idea and turns it into something more configurable (for example, it would be nice to have the current CPU load in a corner of the screen to see in real-time what impact an application has):

The application esentially uses two timers at different priorities, one that fires up to 100 times a second at "Idle" priority, and one at "High" that checks once per second how many times the Idle timer was called (only the most important bits shown, of course):
    iIdle = CPeriodic::NewL(CActive::EPriorityIdle);
    iPeriodic = CPeriodic::NewL(CActive::EPriorityHigh);
    iIdle->Start(10000, 10000, TCallBack(Idle, this));
    iPeriodic->Start(1000000, 1000000, TCallBack(Update, this));

CExampleAppUi::DoIdle()
{
iCount++;
}

CExampleAppUi::DoUpdate()
{
if(iCount>iMaxValue) iMaxValue = iCount;
cpu_usage = (iMaxValue - iCount)*100/iMaxValue;
iCount = 0;
}
A possible enhancement would be to use a CHeartbeat instead of a CPeriodic, to deal with cases where the timer does not get called for more than a second because of very high levels of activity.


Development links

Applications for the Win32 emulator

While Geos allows using the same binary for both the phone and the PC-based emulator, the fact that EPOC devices typically do not use x86 CPUs makes it necessary to compile seperate versions for emulator and final device. As the phones are not available yet, I tried to collect a few links to applications that can be used on the Win32 emulator for the Nokia 9210 "Crystal" SDK. The SDK is available from Nokia through an order form at Forum Nokia.

General EPOC/9210 links