Share via


PerfLog Output File Contents

Other versions of this page are also available for the following:

Windows Mobile Not SupportedWindows Embedded CE Supported

8/27/2008

The log file typically contains a header with the system information, a set of calibration tests, followed by timing data from one or more tests, as well as CPU or Memory usage information. The calibration information is only generated for internal purposes and can be safely ignored when writing a parser.

The header has the following structure:

        ## PERF ## OSVERSION=[6.0] BUILD=[1234]
## PERF ## PLATFORM=[CEPC] CPU=[x86]
## PERF ## DEVNAME=[CEPC]
## PERF ## REGISTERED APP [myperfapp] PROCCESSID [0x03d3002e]
## PERF ## RESOLUTION [1193180] TICKS PER SECOND

The following table shows the description for each header element shown above.

Header element Description

OSVERSION

The Major.Minor version of the operating system (OS)

BUILD

The build number of the OS

PLATFORM

The platform abbreviation; for example, CEPC, DeviceEmulator

CPU

The CPU abbreviation; for example, x86, ARMV41

DEVNAME

Name of the device; if unavailable, same as PLATFORM

REGISTERED APP

Optional string passed by the registering application to the performance library. This value may not be set.

PROCESSID

The PID of the application using the performance library.

RESOLUTION

The number of clock ticks per second. All timer values logged by the performance library are represented as ticks, not seconds.

Registered Markers

When an application needs to initialize a new timer, CPU, or Memory monitoring thread, it will register a marker with a specific numerical ID. The marker registration action is output by the performance library into the log. The marker ID passed by the application is then used in all strings generated by the performance logger to associate the output with a particular marker. The marker IDs can be re-used by the application. When parsing the log file, it is important to keep track if a particular ID value has been re-registered, so that any log data that follows is associated with the most recent instance of the marker.

The following table describes the format of the marker registration strings in the log file.

Marker type Registration string format

Test timer marker

## PERF ## REGISTERED MARKER [app_string] AS [marker_id] by APP [app_name]

app_string: an optional, application defined string that can be used to described the test case that is registering the timer

Example: ## PERF ## REGISTERED MARKER [Test=MyTest] AS [1] BY APP [myperfapp]

CPU Monitor

## PERF ## REGISTERED MARKER [CPU: app_name] AS [marker_id] BY APP [app_name]

app_name: the application name (this is the same string as REGISTERED APP value in the header)

Example: ## PERF ## REGISTERED MARKER [CPU: myperfapp] AS [103] BY APP [myperfapp]

MEM Monitor

## PERF ## REGISTERED MARKER [MEM: app_name] AS [marker_id] BY APP app_name]

app_name: the application name (this is the same string as REGISTERED APP value in the header)

Example: ## PERF ## REGISTERED MARKER [MEM: myperfapp] AS [102] BY APP [myperfapp]

Events

After a registering a test timer marker, the application can start and stop the timer associated with that marker. The timer can be started and stopped for an arbitrary number of iterations. Whenever a timer is stopped, the performance logger library will log the duration the timer was active for since the last activation.

Additionally, the application can request that any registered CPU or Memory monitoring threads in the performance library output their current statistics into the log.

The following table describes the format of the performance logging event strings in the log file.

Event type Registration string format

Test timer duration

## PERF ## APP [app_name] EVT [marker_id] DUR [ticks]

app_string: the application name (this is the same string as REGISTERED APP value in the header)

Example: ## PERF ## APP [myperfapp] EVT [1] DUR [122519]

CPU usage

## PERF ## APP [app_name] EVT [marker_id] CPU [usage]

app_name: the application name (this is the same string as REGISTERED APP value in the header)

Example: ## PERF ## APP [myperfapp] EVT [103] CPU [57.843834]

MEM usage

## PERF ## APP [app_name] EVT [marker_id] MEM [usage]

app_name: the application name (this is the same string as REGISTERED APP value in the header)

Example: ## PERF ## APP [myperfapp] EVT [102] MEM [10059776]

See Also

Other Resources

Managing Performance Results Using PerfLog