astral-sh / astral-sh/python-build-standalone

eBPF tracing support

Open
#239 7 comments 5 reactions 0 assignees View on GitHub
enhancement wish
Dominant language
Python
Stars
4.4k
Forks
314
Avg merge
1d 9h
Merged PRs (30d)
27

Description

Linking the original issue here (we use `rules_python`, where I raised it first): https://github.com/bazelbuild/rules_python/issues/1737

I want to use eBPF to do arbitrary performance profiling of our code, but its not very useful if the python interpreter is not compiled with dtrace and frame pointer support. Without these two, all the information about function names are lost in the stack trace.
The important flags:
1. [--with-dtrace](https://github.com/bazelbuild/rules_python/issues/1737): This flag enables static markers inside python which we can hook into using eBPF (details: https://docs.python.org/3/howto/instrumentation.html)
2. Enable Frame pointer: `-fno-omit-frame-pointer` in gcc. This makes sure the information of function names in stack trace is not lost. References: https://www.brendangregg.com/blog/2024-03-17/the-return-of-the-frame-pointers.html

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.