cherry-pick upstream ruby yjit related unmerged changes#53
cherry-pick upstream ruby yjit related unmerged changes#53korniltsev-grafanista merged 11 commits intopyroscope_alloyfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5c77c6b27d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
interpreter/ruby/ruby.go
Outdated
| fmt.Printf("YJIT DEBUG {Vaddr: %#x, Length: %#x, Flags: %#x, Path: libpf.Intern(%q)},\n", | ||
| m.Vaddr, m.Length, uint32(m.Flags), m.Path.String()) |
There was a problem hiding this comment.
Remove unconditional YJIT map dump from sync path
When YJIT detection fails, this fmt.Printf runs for every mapping on every SynchronizeMappings call, which can emit massive stdout volume for long-running Ruby processes that never enable YJIT (or before YJIT initializes). That adds avoidable CPU/I/O overhead in a hot path and leaks full mapping paths into logs by default; this should be guarded behind debug logging or removed.
Useful? React with 👍 / 👎.
| } | ||
| continue | ||
| } | ||
| withinFoundRange := m.Vaddr < end && m.Vaddr+m.Length <= end |
There was a problem hiding this comment.
Reject partially overlapping mappings in YJIT range check
The overlap test only treats mappings as "in range" when they end at or before end, so a file-backed mapping that starts before end but extends past it is ignored. In that case findYJITRegion can still return found=true even though the candidate interval contains non-anonymous code, leading to false YJIT region detection and incorrect interpreter mapping for that process.
Useful? React with 👍 / 👎.
Update go.opentelemetry.io/ebpf-profiler replacement to latest pyroscope_alloy branch commit from github.com/grafana/opentelemetry-ebpf-profiler. Old: v0.0.202602-0.20260216144214-241376220646 New: v0.0.202602-0.20260326091923-bd31a19190b9 This is to include this fix for customer escalation grafana/opentelemetry-ebpf-profiler#53
ReturnToNativeto not return to native once Ruby is foundThere will be conflicts once upstream changes land, well need to tackle them later