pprof reports only libraries, not functions
Author: RodrigoDornellesCreated Mar 4, 2026Updated Sep 3, 2026
Labelsinactive-waiting-response
I'm trying to statically build gperftools with the project and analyze it with pperf, but it's only giving vague information, showing only the names of the libraries instead of the function names.
pprof -text ./core app.prof
File: core
Type: cpu
Showing nodes accounting for 6810ms, 99.71% of 6830ms total
Dropped 1 node (cum <= 34.15ms)
flat flat% sum% cum cum%
6310ms 92.39% 92.39% 6310ms 92.39% [core]
340ms 4.98% 97.36% 6640ms 97.22% [libc.so.6]
160ms 2.34% 99.71% 160ms 2.34% [libMali.so]I'm using -g -O1 -fno-omit-frame-pointer in all static libraries, and the program is being built with Zig CC (Clang) targeting ARMv7.
cmakelists.txt
# CMakeLists.txt
set(GPERFTOOLS_VERSION "gperftools-2.18")
set(GPERFTOOLS_REPO "https://github.com/gperftools/gperftools.git")
set(GPERFTOOLS_BUILD_CPU_PROFILER ON CACHE BOOL "" FORCE)
set(GPERFTOOLS_BUILD_HEAP_PROFILER OFF CACHE BOOL "" FORCE)
set(GPERFTOOLS_BUILD_DEBUGALLOC OFF CACHE BOOL "" FORCE)
set(gperftools_build_minimal OFF CACHE BOOL "" FORCE)
set(gperftools_build_benchmark OFF CACHE BOOL "" FORCE)
set(gperftools_enable_libunwind ON CACHE BOOL "" FORCE)
set(gperftools_enable_stacktrace_via_backtrace ON CACHE BOOL "" FORCE)
set(gperftools_enable_frame_pointers ON CACHE BOOL "" FORCE)
enable_language(CXX)
FetchContent_Declare(profiler GIT_REPOSITORY ${GPERFTOOLS_REPO} GIT_TAG ${GPERFTOOLS_VERSION})
FetchContent_MakeAvailable(profiler)
target_link_libraries(${PROJECT_NAME} PRIVATE profiler)Source: gperftools/gperftools