diff -r 578be2adaf3e -r 307f4279f433 Adaptation/GUID-9D26E38F-5C7B-5330-A54B-8F97D0F204D0-GENID-1-2-1-9-1-8-1-19-1.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Adaptation/GUID-9D26E38F-5C7B-5330-A54B-8F97D0F204D0-GENID-1-2-1-9-1-8-1-19-1.dita Fri Oct 15 14:32:18 2010 +0100 @@ -0,0 +1,90 @@ + + + + + +Performance +LoggingSymbian 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

    +
  • PERF_LOG0 (aSubCategory)

  • +
  • PERF_LOG1 (aSubCategory,aUserData)

  • +
  • PERF_LOG2 (aSubCategory,aUserData,aUserData2)

    Note: +the PERF_LOG macro is identical to PERF_LOG2.

  • +

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

  • +
+
\ No newline at end of file