-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add initial Ruby support #1933
Add initial Ruby support #1933
Conversation
a1d49bd
to
e5a1dc8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome 🏆 🥇 💯
I liked the additions to the rbperf way of sending data for adapting to the parca agent way.
BPF code looks pretty solid to me.
I have left some comments for user space and as you mentioned in your comments there is a lot of room for optimizations.
I think it's sure close to be merged.
147cc10
to
7a63e3b
Compare
7a63e3b
to
a1babf1
Compare
This commit adds initial Ruby support by integrating rbperf's unwinder and adapting it to this Agent. There is more work to do, but in the spirit of keeping this commit a bit more contained, right now: - only Ruby 3.0.4 is supported; - no focus on efficiency; - missing clean-ups (such as clearing the interpreter stack maps); - the Ruby stack is fetched even if the Ruby thread is sleeping as long as the native stack is on-CPU. This shows up confusingly as the Ruby stack in many native stacks that aren't actually running the Ruby code; - there are no integration tests, this will change soon; All the shortcomings above, and then some, will be addressed in forthcoming commits. Architecture ============ The current BPF unwinding architecture as well as the changes that this commit makes can be seen here: https://excalidraw.com/#json=E-W6lSLZ8rTOcri7HZdAl,4AjIUmb-olsQkdbwCqyxqg Test Plan ========= All current tests pass + Signed-off-by: Francisco Javier Honduvilla Coto <javierhonduco@gmail.com>
a1babf1
to
a366b3f
Compare
I'll retrigger the CI soon. |
Fix for container step #1964 |
|
||
p.RawSamples = append(p.RawSamples, profile.RawSample{ | ||
TID: profile.PID(pKey.tid), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oppsie @javierhonduco 🙈
This PR adds initial Python support (CPython) using a dedicated unwinder to the Agent. There are still many things to do (like testing against various versions even though it technically should work). - Only Python `3.11` is thoroughly tested - No focus on performance - The targeted Python interpreter needs symbols to capture required addresses to initialize unwinding. That being said, this shortcoming will be addressed in upcoming versions. It has the same architecture as #1933, and it has similar shortcomings. All the shortcomings above, and then some, will be taken care of in the future. Additionally, it removes individual ruby and python metadata providers and introduces an interpreter metadata provider. You can find interpreterswith `intepreter="Python|Ruby"` ## TODO - [x] Fix the issue that causing failing Kernel tests ### Test Plan - [x] Local tests - [x] Test against Ruby - [x] Test against .pex files - [x] Test against [multiprocessing](https://docs.python.org/3/library/multiprocessing.html) - [ ] Local Kubernetes test --- ### Single-threaded ![https://cdn.discordapp.com/attachments/963045444332695562/1148621510827835433/CleanShot_2023-09-05_at_16.11.28.png](https://cdn.discordapp.com/attachments/963045444332695562/1148621510827835433/CleanShot_2023-09-05_at_16.11.28.png) ### With Threadpool ![https://cdn.discordapp.com/attachments/963045444332695562/1149044705158496256/CleanShot_2023-09-06_at_20.12.42.png](https://cdn.discordapp.com/attachments/963045444332695562/1149044705158496256/CleanShot_2023-09-06_at_20.12.42.png) ### Using .pex (probably need further investigation. I don't have enough knowledge on details yet) ![CleanShot 2023-09-08 at 16 30 58](https://github.com/parca-dev/parca-agent/assets/536449/0f9b2a87-f0b6-4435-a323-59cff814e9ef) ![CleanShot 2023-09-08 at 16 31 16](https://github.com/parca-dev/parca-agent/assets/536449/eba6dae1-bfb8-427a-ae78-4c710f60e4d3) ### With [multiprocessing](https://docs.python.org/3/library/multiprocessing.html) ![CleanShot 2023-09-08 at 17 07 07](https://github.com/parca-dev/parca-agent/assets/536449/c3bf7032-25b9-4f11-9109-03f34472cab4)
This commit adds initial Ruby support by integrating rbperf's unwinder
and adapting it to this Agent.
There is more work to do, but in the spirit of keeping this commit a bit
more contained, right now:
as the native stack is on-CPU. This shows up confusingly as the Ruby stack in
many native stacks that aren't actually running the Ruby code;
All the shortcomings above, and then some, will be addressed in
forthcoming commits.
Architecture
The current BPF unwinding architecture as well as the changes that this
commit makes can be seen here: https://excalidraw.com/#json=E-W6lSLZ8rTOcri7HZdAl,4AjIUmb-olsQkdbwCqyxqg
Test Plan
All current tests pass + running https://github.com/javierhonduco/rbperf/blob/main/tests/programs/simple_two_stacks.rb
Signed-off-by: Francisco Javier Honduvilla Coto javierhonduco@gmail.com