ARM Technical Support Knowledge Articles

PERFORMANCE ANALYZER DATA ISN'T CORRECT

Applies to: uVision Debugger

Answer


Information in this article applies to:


QUESTION

I'm using the Performance Analyzer in the uVision Debugger to measure the time spent in some of my program's functions.

I have a short routine that only reads and writes values. There is no condition code in this function, yet the timings recorded by the performance analyzer vary greatly. What would cause this?

ANSWER

For a function, the Performance Analyzer calculates the time spent in the function starting when the function is entered and ending when the function exits. This time MAY include time spent in interrupt service routines for interrupts that occur while that function executes. The following program demonstrates this effect:

#include <reg51.h>

static long counter = 0;

void ISR (void) interrupt 0
{
counter++;
}


void test_loop (char *buf)
{
buf [0] = P1;
buf [1] = P3;
}


void main (void)
{
char b [2];


EX0 = 1;  // Enable External Int 0
IT0 = 1;  // Edge-triggered
EA = 1;   // Enable Interrupts

while (1)
  {
  test_loop (b);
  }
}

RESOLUTION

To avoid this effect, add your interrupt service routines to the Performance Analyzer. Then, the time spent in the ISRs will not be included in the time measurements of other functions.

SEE ALSO

Article last edited on: 2004-06-29 11:28:39

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential