Search code examples
profilingperf

perf report function names and extra characters


I have profiled an application using perf, and I am confused why the names of the functions are so mangled in the report. For example, here is the output of perf report:

# Overhead      Command      Shared Object                                                                                                 
# ........  ...........  .................  .................................................................................................................................................................................................
#
    38.98%  hello_sp_tp  libc-2.19.so       [.] __memcpy_sse2_unaligned                                                                                                                                                                      
            |
            --- __memcpy_sse2_unaligned
               |          
               |--21.70%-- _ZN5nupic10algorithms6Cells46CStateaSERKS2_.local.1629
               |          
                --17.28%-- _ZN5nupic10algorithms6Cells46Cells420updateInferenceStateERKSt6vectorIjSaIjEE
                          _ZN5nupic10algorithms6Cells46Cells47computeEPfS3_bb

For example, I recognize the name nupic.algorithms.Cells4.updateInferenceState(), but I'm not sure what all the other characters that pad the names mean.

What is _ZN5? What is IjSaIjEE at the end of this function name? What do these mean? Where do they come from?


Solution

  • These (C++ functions) names are mangled. Look at name mangling for the syntax details. That allows to encode complex C++ namings.

    About your perf report, there are options to ask for demangling: --demangle that is theoretically set by default but real implementation may depend on the perf version or your CPU architecture.