Keil Logo

PerformanceAnalyze

The PerformanceAnalyze (PA) command collects execution statistics (execution time and number of calls) about the application or parts of the application, and can be used to tune the application for maximum performance. The result can be viewed in the windows Command and Performance Analyzer.

Note

  • Compile applications with full debug information to best support performance analysis. Enable Options for Target - Output - Debug Information.

The fastest, slowest, and average execution times are maintained for each analyzed program part.

The table lists the command options.

Syntax Description
PA Displays all ranges defined for performance analysis, including an index number (used to remove a specific range), the execution count, and the minimum, maximum, and total execution time (in clock cycles).
PA startAddr, endAddr Defines a new range to be analyzed. If startAddr is the name of a function, then the starting and ending address of the function is obtained automatically. Up to 256 ranges of code can be analyzed. A range is simply an address range. Normally, an analysis range starts at the first instruction of a function and ends at the last instruction of that function. However, a range cam be specified to include only a few instructions from any part of the target program. If startAddr is a number, endAddr must be specified. For 80x51 microcontrollers, the startAddr and endAddr can contain a Memory Type Specifier.
PA KILL * Removes all performance analysis ranges.
PA KILL index [, index] Removes one or more performance analysis ranges.
PA RESET Resets all statistics.

Note

  • Performance analysis address ranges must have unique entry and exit points and may not include an intermediate return (RET) instruction.
  • A new address range may not overlap an existing range.
Examples
>PA main                         /* Define a range for main()   */
>PA timer0                       /* Define a range for timer0() */
>PA clear_records                /* Define more ranges          */
>PA measure_display
>PA save_current_measurements
>PA read_index
>PA set_time
>PA set_interval
>
>PA                              /* display all PA ranges       */
  0: main: (FF01EF-FF03B6)       /* FF01EF = C:0x01EF           */
  1: timer0: (FF006A-FF0135)
  2: clear_records: (FF01C0-FF01EE)
  3: measure_display: (FF07E7-FF084A)
  4: save_current_measurements: (FF000E-FF0069)
  5: read_index: (FF0136-FF01BF)
  6: set_time: (FF084B-FF08CA)
  7: set_interval: (FF08CB-FF09A5)

/* After execution of the user program ... */

>PA                              /* Display ranges and stats   */
  0: main: (FF01EF-FF03B6)
     count=1, min=-1, max=0, total=167589
  1: timer0: (FF006A-FF0135)
     count=2828, min=33, max=254, total=226651
  2: clear_records: (FF01C0-FF01EE)
     count=1, min=27086, max=27086, total=27086
  3: measure_display: (FF07E7-FF084A)
     count=10, min=19495, max=19503, total=185027
  4: save_current_measurements: (FF000E-FF0069)
     count=491, min=205, max=209, total=100665
  5: read_index: (FF0136-FF01BF)
  6: set_time: (FF084B-FF08CA)
  7: set_interval: (FF08CB-FF09A5)
>
>PA KILL 7                       /* Remove set_interval        */
>PA KILL 6                       /* Remove set_time            */
>PA KILL 5                       /* Remove read_index          */
>PA
  0: main: (FF01EF-FF03B6)
     count=1, min=-1, max=0, total=167589
  1: timer0: (FF006A-FF0135)
     count=2828, min=33, max=254, total=226651
  2: clear_records: (FF01C0-FF01EE)
     count=1, min=27086, max=27086, total=27086
  3: measure_display: (FF07E7-FF084A)
     count=10, min=19495, max=19503, total=185027
  4: save_current_measurements: (FF000E-FF0069)
     count=491, min=205, max=209, total=100665
>
>PA RESET                        /* Clear all recorded information */
>PA
  0: main: (FF01EF-FF03B6)
  1: timer0: (FF006A-FF0135)
  2: clear_records: (FF01C0-FF01EE)
  3: measure_display: (FF07E7-FF084A)
  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.