Performance Logging

Symbian platform provides macros that you can use in device driver and kernel extension programs to write a trace log.

You can use the trace log to test the performance of the programs.

Perfomance macros

There are three macros that you can insert into your code. They only differ with respect to the optional data that you can add to the trace record. All are defined in kernperfloger.h

You must specify an the 8-bit integer subcategory value in the aSubCategory argument. You can also supply one or two (or zero) 32-bit values; you are free to decide on the meaning of such values.

The macros wrap around the standard BTrace*** macros. All trace records generated by these macros are given a category of BTrace::EKernPerfLog.

The generation and capture of trace information is implemented as a kernel extension. This means that it is loaded and activated at an early stage in the startup process of the device.

Performance macro output format

The following table shows which fields of a trace record are generated by each of the macros PERF_LOG0, PERF_LOG1, and PERF_LOG2:

Field

PERF_LOG0

PERF_LOG1

PERF_LOG2

Fast Counter Timestamp

Yes

Yes

Yes

Context Id

Yes

Yes

Yes

PC value

Yes

Yes

Yes

the 32-bit integer value passed as aUserData

NO

Yes

Yes

the 32-bit integer value passed as aUserData2

NO

NO

Yes

Tick Count as returned from a call to NKern::TickCount()

Yes

Yes

Yes

How to use the macros

To use the macros:

  • Include the header file kernperfloger.h in your source code.

  • Link to btrace.lib in your project

  • Call the PERF_LOG*** macros at appropriate points in your code.

    For examples, see the test code for the macros in ...\e32test\group\d_perflogger_test_ldd.mmp and ...\e32test\group\t_perflogger.mmp

  • Rebuild your project