Keil Logo

Technical Support

On-Line Manuals

µVision User's Guide

About µVision User Interface Creating Applications Debugging Start Debugging Start Energy Measurement without Debug Application Program Execution Debug Windows and Dialogs Breakpoints Window Call Stack and Locals Window Code Coverage Command Window Component Viewer Disassembly Window Event Recorder Setup Event Recorder Event Recorder Window Events Filtering Event Statistics Window Event Viewer Execution Profiler Instruction Trace Window System Analyzer Usage tips Restrictions Logic Analyzer Setup Setup in Detail Restrictions Cortex-M Trace Configuration Memory Map Memory Window Performance Analyzer Registers Window Serial Window Debug (printf) Viewer Symbols Window System Viewer Adding System Viewer Windows System and Thread Viewer Thread States Toolbox Trace Data Window Trace Navigation Trace Exceptions Event Counters ULINKplus Window Watch Window Core Peripherals Cortex-M0 and Cortex-M0+ Nested Vector Interrupt Controller System Control and Configuration System Tick Timer Fault Reports (Cortex-M0+ only) Cortex-M3, Cortex-M4, and Cortex-M7 Nested Vector Interrupt Controller System Control and Configuration System Tick Timer Fault Reports Memory Protection Unit Cortex-M23 and Cortex-M33 Nested Vector Interrupt Controller System Control and Configuration System Tick Timer Fault Reports Memory Protection Unit Security Attribution Unit Debug Scripting Expressions Constants System Variables Peripheral Variables I/O Ports Serial Ports Program Variables (Symbols) Fully Qualified Symbols Non-Qualified Symbols Literal Symbols Using Symbols Line Numbers Bit Addresses Type Specifications Operators Differences between µVision and C Expression Examples Code and Data Trace (Cortex-M) Trace Features Tracepoint Expressions Tracepoint Intrinsics Tracepoint Limitations Configuring the Trace Hardware Tracepoint Marks Tips and Tricks Review Peripherals and CPU Configuration Simulate I/O Ports Simulate Interrupts and Clock Inputs Simulate external I/O Devices Assign Serial I/O to a PC COM Port Check Illegal Memory Access Command Input from File Preset I/O Ports or Memory Contents Write Debug Output to a File Keyboard Shortcuts TPIU Initialization after RESET (Cortex-M) Prevent Opening Files Show Japanese Messages Debug Commands Debug Functions Simulation Flash Programming Dialogs Utilities Command Line Example Programs Appendix

Event Statistics Window

The Event Statistics Window displays execution time and current consumption (when using ULINKplus) between corresponding start and stop event annotations in the application code. It provides statistics for average values across a number of executions and captures minimum and maximum time/current events.

For details about the annotations refer to Using Event Statistics in the Event Recorder component documentation.

The Event Recorder Filter has a category to control recording of start/stop event groups.

Code Example:

#include "EventRecorder.h"                      // include for the Event Recorder API access
 :
 EventRecorderInitialize(EventRecordAll, 1U);   // initialize and start Event Recorder
 : 
 EventStartC(0);                                // start measurement event group C, slot 0  
  for (j = 0; j < 1000; j++){ 
    CalcSinTable ();                            // calculate table with sinus values 
    EventStartB(0);                             // start group B, slot 0  
    MaxSqrtSum = rand () / 65536;               // limit for sqrt calculation
    num = FindSqrtSum ((float))MaxSqrtSum);     // return number of sqrt operations
    EventStopBv(0, MaxSqrtSum, num);            // stop group B, slot 0, log MaxSqrtSum,num  
 }
 EventStopC(0);                                 // stop measurement event group C, slot 0  
 :
  • EventStartG (slot) or EventStartGv (slot, v1, v2) functions define the start point of an execution slot.
  • EventStopG (slot) or EventStopGv (slot, v1, v2) functions define the stop point of an execution slot.

Each execution slot is identified by the function name group letter G = {A, B, C, D} and a slot number (0 to 15). A call to EventStopG or EventStopGv with slot=15 stops measurement for all slots in a group and may be used at global exits of an execution block.

Display Event Statistics

Open from the menu View - Analysis Windows - Event Statistics. The figure below explains the displayed information:

Event Statistic Menu

For the minimum and maximum time or current consumption it also shows for start and stop events the: 

  • Source file name and line number of event calls via EventStartG (slot) or EventStopG (slot)
  • Integer values v1 and v2 of event calls via EventStartGv (slot, v1, v2) or EventStopGv (slot, v1, v2).

Aggregated statistical data

The aggregated statistical data for an execution slot is displayed in the corresponding row.

Event Statistic Menu

The following information is shown:

Source Event group and slot number of recorded start/stop events. (Error=value) indicates that number of unbalanced start/stop events (start without closing stop).
Count Amount of recorded execution counts. (+1) indicates that the slot is currently started but not yet stopped.
T(tot) Total execution time spent in this slot.
Q(tot) Total charge consumed across all recorded executions in this slot (when using a power measurement with ULINKplus).
T(Avg) Average execution time spent in this slot.
T(min) / T(max)   Minimum / maximum recorded execution time for this slot.
T(first) / T(last)   Timestamp of the first event start function call and the last event stop function call for this slot.

Captured minimum and maximum events

For each execution slot, the events with maximum and minimum execution times and current consumption (when using ULINKplus with power measurement) are captured.

Event Statistic Menu

The following information is shown:

Start:   Source file/line or values of the related EventStart call.
Stop:   Source file/line or values of the related EventStop call.
t Execution time spent in this slot.
Q Electrical charge consumed during execution in this slot. (1)
I Average current measured during execution in this slot. (1)
U Average voltage measured during execution in this slot. (1)

(1) Q, I and U values are only shown when using ULINKplus with power measurement.

Reset Statistic Information or Create Log Files

The debug command EventRecorder creates a log file or resets the statistic information.

Start/Stop events in Event Recorder window

As all other events, the start/stop events are listed in the Event Recorder Window as shown below.

Start/Stop events in the Event Recorder Window
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.