https://github.com/gukoff/gil_tracer
GIL tracer - monitor and analyze GIL usage with eBPF
https://github.com/gukoff/gil_tracer
cpython gil globalinterpreterlock linux tracer
Last synced: 2 months ago
JSON representation
GIL tracer - monitor and analyze GIL usage with eBPF
- Host: GitHub
- URL: https://github.com/gukoff/gil_tracer
- Owner: gukoff
- License: mit
- Created: 2024-06-22T08:12:16.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-08-27T15:15:12.000Z (9 months ago)
- Last Synced: 2025-01-20T05:41:28.334Z (4 months ago)
- Topics: cpython, gil, globalinterpreterlock, linux, tracer
- Language: Python
- Homepage:
- Size: 185 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GIL tracer
🚧 **Work in progress** 🚧 [[task board]](https://github.com/users/gukoff/projects/1)
GIL tracer for CPython. Built on eBPF, works only on Linux.

## Install dependencies
### To trace with BCC
See the [official `bcc` instructions](https://github.com/iovisor/bcc/blob/master/INSTALL.md).
### To trace with bpftrace
See the [official `bpftrace` instructions](https://github.com/bpftrace/bpftrace/blob/master/INSTALL.md).
A particularly convenient option is to download an [AppImage](https://github.com/bpftrace/bpftrace/blob/master/INSTALL.md#appimage-install). This way you get the latest `bpftrace`.
## Run tracer
### Trace GIL with BCC event collector
```shell
sudo main.py -p 7031
```### Trace GIL with bpftrace (no GUI yet)
```shell
sudo bpftrace -p $pid tracing_programs/trace_without_lines.d
```or
```shell
sudo bpftrace -p $pid tracing_programs/trace_with_lines.d
```