原创 MICROBLAZE 之 EDK profile

2011-10-6 23:49 1678 7 7 分类: FPGA/CPLD

最近在用C语言写了几个算法

 

评估了下 函数的时间

出现了

 

XMD% profile -config sampling_freq_hz 10000 binsize 4 profile_mem 0x90000000
XMD% dow executable.elf
Downloading Program -- executable.elf
        section, .vectors.reset: 0x00000000-0x00000003
        section, .vectors.sw_exception: 0x00000008-0x0000000b
        section, .vectors.interrupt: 0x00000010-0x00000013
        section, .vectors.hw_exception: 0x00000020-0x00000023
        section, .text: 0x00000050-0x00000b83
        section, .init: 0x00000b84-0x00000ba7
        section, .fini: 0x00000ba8-0x00000bc3
        section, .rodata: 0x00000bc4-0x00000bf9
      &nb00000bfa-0x00000bff
        section, .data: 0x00000c00-0x00000d2f
        section, .ctors: 0x00000d30-0x00000d37
        section, .dtors: 0x00000d38-0x00000d3f
        section, .eh_frame: 0x00000d40-0x00000d43
        section, .jcr: 0x00000d44-0x00000d47
        section, .bss: 0x00000d48-0x00000d6f
        section, .heap: 0x00000d70-0x0000156f
        section, .stack: 0x00001570-0x0000256f
_gmonparam start addr: 0x90000000
Setting PC with Program Start Address 0x00000000
System Reset .... DONE
Program executable.elf being Profiled on Hardware
Initialized Profile Configurations for the Program :
---------------------------------------------------
Sampling Frequency...............10000 Hz
Histogram Bin Size...............4 Words
Memory for Profiling used from...0x90000000
Memory Used for Profiling Data...2008 Bytes

XMD% bps exir
 ERROR: Function "exir" not found in Elf file "executable.elf"

Symbol Not Found in Elf File
        Symbol exir in Elf executable.elf

XMD% bps exit
Setting breakpoint at 0x00000890

XMD% con
Processor started. Type "stop" to stop processor

RUNNING> XMD% Software Breakpoint 0 Hit, Processor Stopped at 0x00000890

XMD% profile
 ERROR:
        Invalid Profile data on Target
         Unable to generate gproff file

后来问题解决了

 

Flat profile:

Each sample counts as 0.0001 seconds.
  %   cumulative   self              self     total          
 time   seconds   seconds    calls  ms/call  ms/call  name   
 61.29      0.01     0.01       45     0.30     0.30  XUartLite_SendByte
 15.67      0.02     0.00                             __ieee754_sqrt
 11.18      0.02     0.00                             __floatsidf
  2.76      0.02     0.00      600     0.00     0.00  square
  2.07      0.02     0.00                             __unpack_d
  1.38      0.02     0.00                             sqrt
  1.27      0.02     0.00                             __gedf2
  0.92      0.02     0.00        1     0.20     0.80  calc_hypotenuse
  0.92      0.02     0.00        1     0.20     1.00  main
  0.92      0.02     0.00                             __fpcmp_parts_d
  0.46      0.02     0.00                             __fixdfsi
  0.35      0.02     0.00                             microblaze_disable_dcache
  0.35      0.02     0.00                             microblaze_enable_dcache
  0.23      0.02     0.00                             __pack_d
  0.12      0.02     0.00                             microblaze_disable_icache
  0.12      0.02     0.00                             microblaze_enable_icache

 %         the percentage of the total running time of the
time       program used by this function.

cumulative a running sum of the number of seconds accounted
 seconds   for by this function and those listed above it.

 self      the number of seconds accounted for by this
seconds    function alone.  This is the major sort for this
           listing.

calls      the number of times this function was invoked, if
           this function is profiled, else blank.
 
 self      the average number of milliseconds spent in this
ms/call    function per call, if this function is profiled,
    else blank.

 total     the average number of milliseconds spent in this
ms/call    function and its descendents per call, if this
    function is profiled, else blank.

name       the name of the function.  This is the minor sort
           for this listing. The index shows the location of
    the function in the gprof listing. If the index is
    in parenthesis it shows where it would appear in
    the gprof listing if it were to be printed.

       Call graph (explanation follows)


granularity: each sample hit covers 16 byte(s) for 0.46% of 0.02 seconds

index % time    self  children    called     name
                0.01    0.00      45/45          outbyte [2]
[1]     61.3    0.01    0.00      45         XUartLite_SendByte [1]
-----------------------------------------------
                                                 <spontaneous>
[2]     61.3    0.00    0.01                 outbyte [2]
                0.01    0.00      45/45          XUartLite_SendByte [1]
-----------------------------------------------
                                                 <spontaneous>
[3]     15.7    0.00    0.00                 __ieee754_sqrt [3]
-----------------------------------------------
                                                 <spontaneous>
[4]     11.2    0.00    0.00                 __floatsidf [4]
-----------------------------------------------
                0.00    0.00       1/1           _crtinit [6]
[5]      4.6    0.00    0.00       1         main [5]
                0.00    0.00       1/1           calc_hypotenuse [7]
-----------------------------------------------
                                                 <spontaneous>
[6]      4.6    0.00    0.00                 _crtinit [6]
                0.00    0.00       1/1           main [5]
-----------------------------------------------
                0.00    0.00       1/1           main [5]
[7]      3.7    0.00    0.00       1         calc_hypotenuse [7]
                0.00    0.00     600/600         square [8]
-----------------------------------------------
                0.00    0.00     600/600         calc_hypotenuse [7]
[8]      2.8    0.00    0.00     600         square [8]
-----------------------------------------------
                                                 <spontaneous>
[9]      2.1    0.00    0.00                 __unpack_d [9]
-----------------------------------------------
                                                 <spontaneous>
[10]     1.4    0.00    0.00                 sqrt [10]
-----------------------------------------------
                                                 <spontaneous>
[11]     1.3    0.00    0.00                 __gedf2 [11]
-----------------------------------------------
                                                 <spontaneous>
[12]     0.9    0.00    0.00                 __fpcmp_parts_d [12]
-----------------------------------------------
                                                 <spontaneous>
[13]     0.5    0.00    0.00                 __fixdfsi [13]
-----------------------------------------------
                                                 <spontaneous>
[14]     0.3    0.00    0.00                 microblaze_disable_dcache [14]
-----------------------------------------------
                                                 <spontaneous>
[15]     0.3    0.00    0.00                 microblaze_enable_dcache [15]
-----------------------------------------------
                                                 <spontaneous>
[16]     0.2    0.00    0.00                 __pack_d [16]
-----------------------------------------------
                                                 <spontaneous>
[17]     0.1    0.00    0.00                 microblaze_disable_icache [17]
-----------------------------------------------
                                                 <spontaneous>
[18]     0.1    0.00    0.00                 microblaze_enable_icache [18]
-----------------------------------------------

 This table describes the call tree of the program, and was sorted by
 the total amount of time spent in each function and its children.

 Each entry in this table consists of several lines.  The line with the
 index number at the left hand margin lists the current function.
 The lines above it list the functions that called this function,
 and the lines below it list the functions this one called.
 This line lists:
     index A unique number given to each element of the table.
  Index numbers are sorted numerically.
  The index number is printed next to every function name so
  it is easier to look up where the function in the table.

     % time This is the percentage of the `total' time that was spent
  in this function and its children.  Note that due to
  different viewpoints, functions excluded by options, etc,
  these numbers will NOT add up to 100%.

     self This is the total amount of time spent in this function.

     children This is the total amount of time propagated into this
  function by its children.

     called This is the number of times the function was called.
  If the function called itself recursively, the number
  only includes non-recursive calls, and is followed by
  a `+' and the number of recursive calls.

     name The name of the current function.  The index number is
  printed after it.  If the function is a member of a
  cycle, the cycle number is printed between the
  function's name and the index number.


 For the function's parents, the fields have the following meanings:

     self This is the amount of time that was propagated directly
  from the function into this parent.

     children This is the amount of time that was propagated from
  the function's children into this parent.

     called This is the number of times this parent called the
  function `/' the total number of times the function
  was called.  Recursive calls to the function are not
  included in the number after the `/'.

     name This is the name of the parent.  The parent's index
  number is printed after it.  If the parent is a
  member of a cycle, the cycle number is printed between
  the name and the index number.

 If the parents of the function cannot be determined, the word
 `<spontaneous>' is printed in the `name' field, and all the other
 fields are blank.

 For the function's children, the fields have the following meanings:

     self This is the amount of time that was propagated directly
  from the child into the function.

     children This is the amount of time that was propagated from the
  child's children to the function.

     called This is the number of times the function called
  this child `/' the total number of times the child
  was called.  Recursive calls by the child are not
  listed in the number after the `/'.

     name This is the name of the child.  The child's index
  number is printed after it.  If the child is a
  member of a cycle, the cycle number is printed
  between the name and the index number.

 If there are any cycles (circles) in the call graph, there is an
 entry for the cycle-as-a-whole.  This entry shows who called the
 cycle (as parents) and the members of the cycle (as children.)
 The `+' recursive calls entry shows the number of function calls that
 were internal to the cycle, and the calls entry for each member shows,
 for that member, how many times it was called from other members of
 the cycle.


Index by function name

   [1] XUartLite_SendByte     [16] __pack_d               [15] microblaze_enable_dcache
  [13] __fixdfsi               [9] __unpack_d             [18] microblaze_enable_icache
   [4] __floatsidf             [7] calc_hypotenuse        [10] sqrt
  [12] __fpcmp_parts_d         [5] main                    [8] square
  [11] __gedf2                [14] microblaze_disable_dcache
   [3] __ieee754_sqrt         [17] microblaze_disable_icache

 

 

生成的报告如上

 

O(∩_∩)O~

PARTNER CONTENT

文章评论0条评论)

登录后参与讨论
EE直播间
更多
我要评论
0
7
关闭 站长推荐上一条 /1 下一条