Skip to content

Perf doesn't show the Python functions when using the -O0 compilation flag without frame pointers #130861

@stratakis

Description

@stratakis

Bug report

Bug description:

When compiling without frame pointers and the -O0 optimization flag, Perf cannot see the Python functions.

This is not the case when using -O3, -O2, -O1, -Og or when enabling frame pointers.

Tested on both x86_64 and aarch64.

Perf 6.13.4, GDB 16.2, GCC 14.2.1 on x86_64/aarch64, Fedora 41.

To reproduce:

./configure --enable-shared --without-static-libpython && CFLAGS="-O0" make

LD_LIBRARY_PATH=$PWD perf record -F 9999 -g -k 1 --call-graph dwarf -o perf.data ./python -Xperf_jit script_from_python_perf_docs.py

perf inject -i perf.data --jit --output perf.jit.data

perf report -g -i perf.jit.data

CPython versions tested on:

CPython main branch, 3.14, 3.13

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildThe build process and cross-buildtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions