grafana / pyroscope-rs

Pyroscope Profiler for Rust. Profile your Rust applications.
Apache License 2.0
139 stars 28 forks source link

Ruby 3.3 support? #173

Open dpsi opened 2 months ago

dpsi commented 2 months ago

Hi there, Is Ruby 3.3 supported? I got the gem working on Ruby 2.7.5 on my system but not on 3.3.2

OS: Ubuntu 22.04.4 5.15.0-112-generic ruby 3.3.2 (2024-05-30 revision e5a195edf6) +YJIT [x86_64-linux] pyroscope 0.5.12 x86_64-linux

 2024-07-18T17:53:05.760Z TRACE Pyroscope::FFIKit > Set PARENT_PID: 2083997
 2024-07-18T17:53:05.760Z TRACE ffikit            > Spawned FFI listener thread.
 2024-07-18T17:53:05.760Z TRACE Pyroscope::FFIKit > FFI Socket Listening on /tmp/PYROSCOPE-2083997
 2024-07-18T17:53:05.765Z TRACE Pyroscope::Agent  > Backend initialized
 2024-07-18T17:53:05.765Z INFO  Pyroscope::Timer  > Initializing Timer
 2024-07-18T17:53:05.765Z TRACE Pyroscope::Agent  > Timer initialized
 2024-07-18T17:53:05.765Z INFO  Pyroscope::Session > Creating SessionManager
 2024-07-18T17:53:05.765Z TRACE Pyroscope::Agent   > SessionManager initialized
 2024-07-18T17:53:05.765Z DEBUG Pyroscope::Agent   > Starting
 2024-07-18T17:53:05.765Z TRACE Pyroscope::Session > Started
 2024-07-18T17:53:05.765Z TRACE Pyroscope::Agent   > Main Thread started
 2024-07-18T17:53:05.766Z INFO  spytools::process::process_info > Got virtual memory maps from pid 2083997:
 2024-07-18T17:53:05.767Z DEBUG spytools::process::process_info > map: 000055e484a68000-000055e484a69000 r-- /usr/local/rvm/rubies/ruby-3.3.2/bin/ruby
-- list of all loaded so files -- 

Then this retry keeps going until the script ends

 2024-07-18T17:53:06.801Z INFO  spytools::process::process_info             > Found library @ /usr/local/rvm/rubies/ruby-3.3.2/lib/libruby.so.3.3.2
 2024-07-18T17:53:06.806Z INFO  spytools::process::process_info             > got symbol ruby_version (0x00007fe7288af909) from library
 2024-07-18T17:53:06.806Z INFO  pyroscope_rbspy_oncpu::core::address_finder > Found ruby version 3.3.2
 2024-07-18T17:53:06.807Z INFO  pyroscope_rbspy_oncpu::core::ruby_spy       > Failed to connect to process; will retry. Last error: get ruby VM state
 2024-07-18T17:53:06.828Z INFO  spytools::process::process_info             > Got virtual memory maps from pid 2083997:
-- list of all loaded so files -- 
-- ruby script ends --
 2024-07-18T17:53:10.000Z TRACE Pyroscope::Timer                            > Timer fired @ NextSnapshot(1721325190)
 2024-07-18T17:53:10.000Z TRACE Pyroscope::Timer                            > Sent event to listener @ Sender { .. }
 2024-07-18T17:53:10.000Z TRACE Pyroscope::Agent                            > Sending session 1721325190
 2024-07-18T17:53:10.000Z INFO  Pyroscope::Session                          > Creating Session
 2024-07-18T17:53:10.000Z TRACE pyroscope::session                          > SessionManager - Session sent
 2024-07-18T17:53:20.000Z TRACE Pyroscope::Timer                            > Timer fired @ NextSnapshot(1721325200)
 2024-07-18T17:53:20.000Z TRACE Pyroscope::Timer                            > Sent event to listener @ Sender { .. }
 2024-07-18T17:53:20.000Z TRACE Pyroscope::Agent                            > Sending session 1721325200
 2024-07-18T17:53:20.000Z INFO  Pyroscope::Session                          > Creating Session
 2024-07-18T17:53:20.000Z TRACE pyroscope::session                          > SessionManager - Session sent
 2024-07-18T17:53:30.000Z TRACE Pyroscope::Timer                            > Timer fired @ NextSnapshot(1721325210)
 2024-07-18T17:53:30.000Z TRACE Pyroscope::Timer                            > Sent event to listener @ Sender { .. }
 2024-07-18T17:53:30.000Z TRACE Pyroscope::Agent                            > Sending session 1721325210
 2024-07-18T17:53:30.000Z INFO  Pyroscope::Session                          > Creating Session
 2024-07-18T17:53:30.000Z TRACE pyroscope::session                          > SessionManager - Session sent
 2024-07-18T17:53:40.000Z TRACE Pyroscope::Timer                            > Timer fired @ NextSnapshot(1721325220)
 2024-07-18T17:53:40.000Z TRACE Pyroscope::Timer                            > Sent event to listener @ Sender { .. }
 2024-07-18T17:53:40.000Z TRACE Pyroscope::Agent                            > Sending session 1721325220
 2024-07-18T17:53:40.000Z INFO  Pyroscope::Session                          > Creating Session
 2024-07-18T17:53:40.000Z TRACE pyroscope::session                          > SessionManager - Session sent
dpsi commented 2 months ago

I tried 0.5.11 and it had the same issue. On 0.5.10 it says the ruby is not supported: 2024-07-24T17:26:35.957Z INFO Pyroscope::Timer > Initializing Timer 2024-07-24T17:26:35.957Z INFO Pyroscope::Session > Creating SessionManager 2024-07-24T17:26:35.968Z INFO spytools::process::process_info > Got virtual memory maps from pid 2933040: 2024-07-24T17:26:36.060Z INFO spytools::process::process_info > Found library @ /usr/local/rvm/rubies/ruby-3.3.4/lib/libruby.so.3.3.4 2024-07-24T17:26:36.072Z INFO spytools::process::process_info > got symbol ruby_version (0x00007fa600d7c929) from library 2024-07-24T17:26:36.072Z INFO pyroscope_rbspy_oncpu::core::address_finder > Found ruby version 3.3.4 2024-07-24T17:26:36.072Z INFO spytools::process::process_info > got symbol ruby_current_vm_ptr (0x00007fa600ef4968) from library thread '' panicked at 'Ruby version not supported yet: 3.3.4. In the meantime, we suggest trying --force-version <prior version>.', /root/.cargo/registry/src/github.com-1ecc62 99db9ec823/pyroscope-rbspy-oncpu-0.17.0/src/core/ruby_version.rs:1818:14 stack backtrace: 0: rust_begin_unwind at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:584:5 1: core::panicking::panic_fmt at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/panicking.rs:142:14 2: pyroscope_rbspy_oncpu::core::ruby_spy::RubySpy::retry_new 3: pyroscope_rbspy_oncpu::sampler::sample note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace. 2024-07-24T17:26:40.000Z INFO Pyroscope::Session > Creating Session

korniltsev commented 2 months ago

We need to update our rbspy fork, for this. Idk when this will happen.