nuttx-apps/system/gprof/Kconfig
yinshengkai 1b27b73a99 system/gprof: Support gprof tool
It can perform statistics on running hot spots or record function calls

arm-none-eabi-gprof nuttx/nuttx gmon.out -b
Flat profile:

Each sample counts as 0.001 seconds.
  %   cumulative   self              self     total
 time   seconds   seconds    calls   s/call   s/call  name
 66.41      3.55     3.55       43     0.08     0.08  sdelay
 33.44      5.34     1.79       44     0.04     0.04  delay
  0.07      5.34     0.00                             up_idle
  0.04      5.34     0.00                             nx_start
  0.02      5.34     0.00                             fdtdump_main
  0.02      5.34     0.00                             nxsem_wait
  0.00      5.34     0.00        1     0.00     5.34  hello_main
  0.00      5.34     0.00        1     0.00     0.00  singal_handler

granularity: each sample hit covers 4 byte(s) for 0.02% of 5.34 seconds

index % time    self  children    called     name
                0.00    5.34       1/1           nxtask_startup [2]
[1]     99.9    0.00    5.34       1         hello_main [1]
                3.55    0.00      43/43          sdelay [3]
                1.79    0.00      44/44          delay [4]
-----------------------------------------------
                                                 <spontaneous>
[2]     99.9    0.00    5.34                 nxtask_startup [2]
                0.00    5.34       1/1           hello_main [1]
-----------------------------------------------
                3.55    0.00      43/43          hello_main [1]
[3]     66.4    3.55    0.00      43         sdelay [3]
-----------------------------------------------
                1.79    0.00      44/44          hello_main [1]
[4]     33.4    1.79    0.00      44         delay [4]
-----------------------------------------------
                                                 <spontaneous>
[5]      0.1    0.00    0.00                 up_idle [5]
-----------------------------------------------
                                                 <spontaneous>
[6]      0.0    0.00    0.00                 nx_start [6]
-----------------------------------------------
                                                 <spontaneous>
[7]      0.0    0.00    0.00                 fdtdump_main [7]
-----------------------------------------------
                                                 <spontaneous>
[8]      0.0    0.00    0.00                 nxsem_wait [8]
-----------------------------------------------
                0.00    0.00       1/1           nxsig_deliver [3553]
[9]      0.0    0.00    0.00       1         singal_handler [9]
-----------------------------------------------

Index by function name

   [4] delay                   [6] nx_start                [9] singal_handler
   [7] fdtdump_main            [8] nxsem_wait              [5] up_idle
   [1] hello_main              [3] sdelay

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-09 23:16:13 +08:00

23 lines
460 B
Text

#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
config SYSTEM_GPROF
tristate "gprof tool"
default n
depends on SCHED_GPROF || SIM_GPROF
---help---
Enable support for the 'gprof' command.
if SYSTEM_GPROF
config SYSTEM_GPROF_PRIORITY
int "gprof task priority"
default 100
config SYSTEM_GPROF_STACKSIZE
int "gprof stack size"
default DEFAULT_TASK_STACKSIZE
endif