grafana / grafana/pyroscope

chore(ebpf): reuse symbol table from dead processes if possible

Open
#2,037 0 comments 0 reactions 0 assignees View on GitHub
eBPF
Dominant language
Go
Stars
11.7k
Forks
802
Avg merge
1d 19h
Merged PRs (30d)
80

Description

#### Describe the bug
Elf with same `.note.gnu.build-id` or `.note.go.build-id` share share symbol tables to save memory.
The symbol table references file as `/proc/{pid}/root/foo/bar.so`.
When a process dies, an alive process can no longer use it and in current implementation it creates a new symbol table from an alive process root fs. https://github.com/grafana/phlare/pull/784/commits/57fce5bd0f1dd5c129d6e62126c687dd61014f6a

We could just swap file path to a new root fs and old table should keep working

#### To Reproduce
Steps to reproduce the behavior:

1. start two processes with same modules , they will share symbol table
2. kill first process
3. the symbol table for modules in second process is parsed from scratch

#### Expected behavior

at step 3, the symbol table is not parsed from scratch and the previous one is reused by pointing to an alive rootfs

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the linked commit 57fce5bd0f1dd5c129d6e62126c687dd61014f6a and trace the symbol-table handling for /proc/{pid}/root paths. Reproduce the two-process scenario, then verify that after the first process dies the second process reuses the existing table with an alive rootfs instead of parsing it again.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, linux
Domain
observability-sre, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.