From 9ec7b9693a6a0229296b9cc7a15931a498a5988d Mon Sep 17 00:00:00 2001 From: Abid Omar Date: Mon, 13 Jun 2022 01:01:45 +0000 Subject: [PATCH 01/31] wip(gem): various adjustments to Rubygem --- pyroscope_ffi/ruby/Gemfile.lock | 135 -------------------- pyroscope_ffi/ruby/ext/rbspy/Cargo.lock | 61 ++++----- pyroscope_ffi/ruby/ext/rbspy/Cargo.toml | 3 + pyroscope_ffi/ruby/lib/pyroscope/version.rb | 2 +- pyroscope_ffi/ruby/lib/pyroscope_beta.rb | 2 +- pyroscope_ffi/ruby/pyroscope.gemspec | 16 +-- 6 files changed, 32 insertions(+), 187 deletions(-) delete mode 100644 pyroscope_ffi/ruby/Gemfile.lock diff --git a/pyroscope_ffi/ruby/Gemfile.lock b/pyroscope_ffi/ruby/Gemfile.lock deleted file mode 100644 index 1dd8d396..00000000 --- a/pyroscope_ffi/ruby/Gemfile.lock +++ /dev/null @@ -1,135 +0,0 @@ -PATH - remote: . - specs: - pyroscope_beta (0.1.7) - ffi (~> 1.9) - fiddle (~> 1.1) - -GEM - remote: https://rubygems.org/ - specs: - addressable (2.8.0) - public_suffix (>= 2.0.2, < 5.0) - coderay (1.1.3) - diff-lcs (1.5.0) - docile (1.4.0) - faraday (1.10.0) - faraday-em_http (~> 1.0) - faraday-em_synchrony (~> 1.0) - faraday-excon (~> 1.1) - faraday-httpclient (~> 1.0) - faraday-multipart (~> 1.0) - faraday-net_http (~> 1.0) - faraday-net_http_persistent (~> 1.0) - faraday-patron (~> 1.0) - faraday-rack (~> 1.0) - faraday-retry (~> 1.0) - ruby2_keywords (>= 0.0.4) - faraday-em_http (1.0.0) - faraday-em_synchrony (1.0.0) - faraday-excon (1.1.0) - faraday-httpclient (1.0.1) - faraday-multipart (1.0.3) - multipart-post (>= 1.2, < 3) - faraday-net_http (1.0.1) - faraday-net_http_persistent (1.2.0) - faraday-patron (1.0.0) - faraday-rack (1.0.0) - faraday-retry (1.0.3) - ffi (1.15.5) - fiddle (1.1.0) - formatador (1.1.0) - git-version-bump (0.17.2) - github-release (0.2.0) - git-version-bump - octokit (>= 3.0, < 5) - guard (2.18.0) - formatador (>= 0.2.4) - listen (>= 2.7, < 4.0) - lumberjack (>= 1.0.12, < 2.0) - nenv (~> 0.1) - notiffany (~> 0.0) - pry (>= 0.13.0) - shellany (~> 0.0) - thor (>= 0.18.1) - guard-compat (1.2.1) - guard-rspec (4.7.3) - guard (~> 2.1) - guard-compat (~> 1.1) - rspec (>= 2.99.0, < 4.0) - listen (3.7.1) - rb-fsevent (~> 0.10, >= 0.10.3) - rb-inotify (~> 0.9, >= 0.9.10) - lumberjack (1.2.8) - method_source (1.0.0) - multipart-post (2.1.1) - nenv (0.3.0) - notiffany (0.1.3) - nenv (~> 0.1) - shellany (~> 0.0) - octokit (4.22.0) - faraday (>= 0.9) - sawyer (~> 0.8.0, >= 0.5.3) - pry (0.14.1) - coderay (~> 1.1) - method_source (~> 1.0) - public_suffix (4.0.7) - rake (13.0.6) - rake-compiler (1.2.0) - rake - rake-compiler-dock (1.2.1) - rb-fsevent (0.11.1) - rb-inotify (0.10.1) - ffi (~> 1.0) - rb_sys (0.1.3) - redcarpet (3.5.1) - rspec (3.11.0) - rspec-core (~> 3.11.0) - rspec-expectations (~> 3.11.0) - rspec-mocks (~> 3.11.0) - rspec-core (3.11.0) - rspec-support (~> 3.11.0) - rspec-expectations (3.11.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.11.0) - rspec-mocks (3.11.1) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.11.0) - rspec-support (3.11.0) - ruby2_keywords (0.0.5) - sawyer (0.8.2) - addressable (>= 2.3.5) - faraday (> 0.8, < 2.0) - shellany (0.0.1) - simplecov (0.21.2) - docile (~> 1.1) - simplecov-html (~> 0.11) - simplecov_json_formatter (~> 0.1) - simplecov-html (0.12.3) - simplecov_json_formatter (0.1.4) - thor (1.2.1) - webrick (1.7.0) - yard (0.9.27) - webrick (~> 1.7.0) - -PLATFORMS - x86_64-darwin-21 - x86_64-linux - -DEPENDENCIES - bundler - github-release - guard-rspec - pyroscope_beta! - rake (~> 13.0) - rake-compiler (~> 1.2) - rake-compiler-dock (~> 1.2) - rb-inotify (~> 0.9) - rb_sys (~> 0.1) - redcarpet - rspec - simplecov - yard - -BUNDLED WITH - 2.3.12 diff --git a/pyroscope_ffi/ruby/ext/rbspy/Cargo.lock b/pyroscope_ffi/ruby/ext/rbspy/Cargo.lock index a144c759..dbb0b4e1 100644 --- a/pyroscope_ffi/ruby/ext/rbspy/Cargo.lock +++ b/pyroscope_ffi/ruby/ext/rbspy/Cargo.lock @@ -120,9 +120,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bumpalo" -version = "3.9.1" +version = "3.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" +checksum = "37ccbd214614c6783386c1af30caf03192f17891059cecc394b4fb119e363de3" [[package]] name = "bytemuck" @@ -534,9 +534,9 @@ checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" [[package]] name = "goblin" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c955ab4e0ad8c843ea653a3d143048b87490d9be56bd7132a435c2407846ac8f" +checksum = "cfeb764aa29a0774d290c2df134a37ab2e3c1ba59009162626658aabefda321a" dependencies = [ "log", "plain", @@ -591,9 +591,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff8670570af52249509a86f5e3e18a08c60b177071826898fde8997cf5f6bfbb" +checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" dependencies = [ "bytes", "fnv", @@ -848,9 +848,9 @@ dependencies = [ [[package]] name = "mach2" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c29a677a8db77a45ddd1370ac4fbd5187f827780000202079e28949f1a75cb1" +checksum = "6d0d1830bcd151a6fc4aea1369af235b36c1528fe976b8ff678683c9995eade8" dependencies = [ "libc", ] @@ -1083,9 +1083,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.73" +version = "0.9.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d5fd19fb3e0a8191c1e34935718976a3e70c112ab9a24af6d7cadccd9d90bc0" +checksum = "835363342df5fba8354c5b453325b110ffd54044e588c539cf2f20a8014e4cb1" dependencies = [ "autocfg", "cc", @@ -1240,9 +1240,9 @@ dependencies = [ [[package]] name = "pyroscope_rbspy" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b038acb1c386903c37c27b19584d2de04b9fc3e160fd628d351f2666a86ac993" +checksum = "3359aa2a37be1fd6fa096cb1b73380c3f8b975346d5b3423f7a4f559acb9ba0a" dependencies = [ "anyhow", "log", @@ -1386,8 +1386,7 @@ dependencies = [ [[package]] name = "read-process-memory" version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a103589f0c267c68328595f1ff45647e9d4b3ee6b9c1c51dcdc9b4b55ca504c5" +source = "git+https://github.com/omarabid/read-process-memory.git?branch=0.1.4-fix#51a5122d0d084478cc7563414255392e8f026971" dependencies = [ "libc", "log", @@ -1758,9 +1757,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "syn" -version = "1.0.95" +version = "1.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbaf6116ab8924f39d52792136fb74fd60a80194cf1b1c6ffa6453eef1c3f942" +checksum = "0748dd251e24453cb8717f0354206b91557e4ec8703673a4b30208f2abaf1ebf" dependencies = [ "proc-macro2", "quote", @@ -1873,9 +1872,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.18.2" +version = "1.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4903bf0427cf68dddd5aa6a93220756f8be0c34fcfa9f5e6191e103e15a31395" +checksum = "c51a52ed6686dd62c320f9b89299e9dfb46f730c7a48e635c19f21d116cb1439" dependencies = [ "bytes", "libc", @@ -1911,9 +1910,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f988a1a1adc2fb21f9c12aa96441da33a1728193ae0b95d2be22dbd17fcb4e5c" +checksum = "cc463cd8deddc3770d20f9852143d50bf6094e640b485cb2e189a2099085ff45" dependencies = [ "bytes", "futures-core", @@ -1931,34 +1930,22 @@ checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" [[package]] name = "tracing" -version = "0.1.34" +version = "0.1.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d0ecdcb44a79f0fe9844f0c4f33a342cbcbb5117de8001e6ba0dc2351327d09" +checksum = "a400e31aa60b9d44a52a8ee0343b5b18566b03a8321e0d321f695cf56e940160" dependencies = [ "cfg-if", "pin-project-lite", - "tracing-attributes", "tracing-core", ] -[[package]] -name = "tracing-attributes" -version = "0.1.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc6b8ad3567499f98a1db7a752b07a7c8c7c7c34c332ec00effb2b0027974b7c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "tracing-core" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f54c8ca710e81886d498c2fd3331b56c93aa248d49de2222ad2742247c60072f" +checksum = "7709595b8878a4965ce5e87ebf880a7d39c9afc6837721b21a5a816a8117d921" dependencies = [ - "lazy_static", + "once_cell", ] [[package]] diff --git a/pyroscope_ffi/ruby/ext/rbspy/Cargo.toml b/pyroscope_ffi/ruby/ext/rbspy/Cargo.toml index b8754fef..1b776029 100644 --- a/pyroscope_ffi/ruby/ext/rbspy/Cargo.toml +++ b/pyroscope_ffi/ruby/ext/rbspy/Cargo.toml @@ -10,3 +10,6 @@ crate-type = ["cdylib"] [dependencies] pyroscope = {version = "0.5.2" } pyroscope_rbspy = { version = "0.2" } + +[patch.crates-io] +read-process-memory = {git = "https://github.com/omarabid/read-process-memory.git", branch = "0.1.4-fix"} diff --git a/pyroscope_ffi/ruby/lib/pyroscope/version.rb b/pyroscope_ffi/ruby/lib/pyroscope/version.rb index 22e8cc02..3599a352 100644 --- a/pyroscope_ffi/ruby/lib/pyroscope/version.rb +++ b/pyroscope_ffi/ruby/lib/pyroscope/version.rb @@ -1,3 +1,3 @@ module Pyroscope - VERSION = '0.1.8'.freeze + VERSION = '0.1.9'.freeze end diff --git a/pyroscope_ffi/ruby/lib/pyroscope_beta.rb b/pyroscope_ffi/ruby/lib/pyroscope_beta.rb index 344fcd97..a79a1f4e 100644 --- a/pyroscope_ffi/ruby/lib/pyroscope_beta.rb +++ b/pyroscope_ffi/ruby/lib/pyroscope_beta.rb @@ -66,7 +66,7 @@ def tags_to_string(tags) # get thread id def thread_id - thread_id = Fiddle::Function.new($libm['thread_id'], [], Fiddle::TYPE_INT64_T) + thread_id = Fiddle::Function.new($libm['thread_id'], [], Fiddle::TYPE_LONG_LONG) thread_id.call end diff --git a/pyroscope_ffi/ruby/pyroscope.gemspec b/pyroscope_ffi/ruby/pyroscope.gemspec index f350327b..52bf7e3f 100644 --- a/pyroscope_ffi/ruby/pyroscope.gemspec +++ b/pyroscope_ffi/ruby/pyroscope.gemspec @@ -21,23 +21,13 @@ Gem::Specification.new do |s| s.platform = Gem::Platform::RUBY - s.required_ruby_version = ">= 2.7.0" + s.required_ruby_version = ">= 2.5.9" s.extensions = ['ext/rbspy/extconf.rb', 'ext/thread_id/extconf.rb'] - s.add_dependency 'ffi', '~> 1.9' - s.add_dependency 'fiddle', '~> 1.1' + s.add_dependency 'ffi' + s.add_dependency 'fiddle' s.add_development_dependency 'bundler' - s.add_development_dependency 'github-release' - s.add_development_dependency 'guard-rspec' s.add_development_dependency 'rake', '~> 13.0' - s.add_development_dependency 'rake-compiler', '~> 1.2' - s.add_development_dependency 'rake-compiler-dock', '~> 1.2' - s.add_development_dependency 'rb-inotify', '~> 0.9' - s.add_development_dependency 'rb_sys', '~> 0.1' - s.add_development_dependency 'redcarpet' - s.add_development_dependency 'rspec' - s.add_development_dependency 'simplecov' - s.add_development_dependency 'yard' end From d85d52cc692f3cd3eed49cc103c0d020dbfa9190 Mon Sep 17 00:00:00 2001 From: Abid Omar Date: Mon, 13 Jun 2022 19:48:27 +0000 Subject: [PATCH 02/31] wip: remove fiddle dependency --- pyroscope_ffi/ruby/lib/pyroscope_beta.rb | 13 +++++++------ pyroscope_ffi/ruby/pyroscope.gemspec | 1 - 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pyroscope_ffi/ruby/lib/pyroscope_beta.rb b/pyroscope_ffi/ruby/lib/pyroscope_beta.rb index a79a1f4e..966a688b 100644 --- a/pyroscope_ffi/ruby/lib/pyroscope_beta.rb +++ b/pyroscope_ffi/ruby/lib/pyroscope_beta.rb @@ -1,8 +1,4 @@ require 'ffi' -require 'fiddle' - -$libm = Fiddle.dlopen(File.expand_path(File.dirname(__FILE__)) + "/thread_id/thread_id.#{RbConfig::CONFIG["DLEXT"]}") - module Rust extend FFI::Library @@ -13,6 +9,12 @@ module Rust attach_function :drop_agent, [], :bool end +module Utils + extend FFI::Library + ffi_lib File.expand_path(File.dirname(__FILE__)) + "/thread_id/thread_id.#{RbConfig::CONFIG["DLEXT"]}" + attach_function :thread_id, [], :uint64 +end + module Pyroscope Config = Struct.new(:application_name, :server_address, :sample_rate, :detect_subprocesses, :log_level, :tags) do def initialize(*) @@ -66,8 +68,7 @@ def tags_to_string(tags) # get thread id def thread_id - thread_id = Fiddle::Function.new($libm['thread_id'], [], Fiddle::TYPE_LONG_LONG) - thread_id.call + return Utils.thread_id() end # add tags diff --git a/pyroscope_ffi/ruby/pyroscope.gemspec b/pyroscope_ffi/ruby/pyroscope.gemspec index 52bf7e3f..b7b8d736 100644 --- a/pyroscope_ffi/ruby/pyroscope.gemspec +++ b/pyroscope_ffi/ruby/pyroscope.gemspec @@ -26,7 +26,6 @@ Gem::Specification.new do |s| s.extensions = ['ext/rbspy/extconf.rb', 'ext/thread_id/extconf.rb'] s.add_dependency 'ffi' - s.add_dependency 'fiddle' s.add_development_dependency 'bundler' s.add_development_dependency 'rake', '~> 13.0' From 65c6f16d4be3f87dec1a7fe89f7d8232872cc9d5 Mon Sep 17 00:00:00 2001 From: Abid Omar Date: Mon, 13 Jun 2022 20:18:06 +0000 Subject: [PATCH 03/31] wip: add auth_token support --- pyroscope_ffi/ruby/ext/rbspy/Cargo.lock | 18 +++++++++--------- pyroscope_ffi/ruby/ext/rbspy/src/lib.rs | 24 ++++++++++++++++++------ pyroscope_ffi/ruby/lib/pyroscope_beta.rb | 6 ++++-- 3 files changed, 31 insertions(+), 17 deletions(-) diff --git a/pyroscope_ffi/ruby/ext/rbspy/Cargo.lock b/pyroscope_ffi/ruby/ext/rbspy/Cargo.lock index dbb0b4e1..4217a003 100644 --- a/pyroscope_ffi/ruby/ext/rbspy/Cargo.lock +++ b/pyroscope_ffi/ruby/ext/rbspy/Cargo.lock @@ -204,9 +204,9 @@ dependencies = [ [[package]] name = "clap" -version = "3.1.18" +version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2dbdf4bdacb33466e854ce889eee8dfd5729abf7ccd7664d0a2d60cd384440b" +checksum = "a836566fa5f52f7ddf909a8a2f9029b9f78ca584cd95cf7e87f8073110f4c5c9" dependencies = [ "atty", "bitflags", @@ -221,9 +221,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "3.1.18" +version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25320346e922cffe59c0bbc5410c8d8784509efb321488971081313cb1e1a33c" +checksum = "986fd75d1dfd2c34eb8c9275ae38ad87ea9478c9b79e87f1801f7d866dfb1e37" dependencies = [ "heck", "proc-macro-error", @@ -234,9 +234,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.2.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a37c35f1112dad5e6e0b1adaff798507497a18fceeb30cceb3bae7d1427b9213" +checksum = "5538cd660450ebeb4234cfecf8f2284b844ffc4c50531e66d584ad5b91293613" dependencies = [ "os_str_bytes", ] @@ -708,7 +708,7 @@ checksum = "1a3cb215599901c8f491666421d44ffaed08d6872b4c7ced6f425683b951271e" dependencies = [ "ahash", "atty", - "clap 3.1.18", + "clap 3.2.1", "crossbeam-channel", "crossbeam-utils", "dashmap", @@ -931,7 +931,7 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7d66043b25d4a6cccb23619d10c19c25304b355a7dccd4a8e11423dd2382146" dependencies = [ - "clap 3.1.18", + "clap 3.2.1", "rand 0.8.5", ] @@ -1343,7 +1343,7 @@ checksum = "bcbebdf0037de5a92722b0bca2965ce0a76cd5c962225cf355e31ac668ea653f" dependencies = [ "anyhow", "chrono", - "clap 3.1.18", + "clap 3.2.1", "ctrlc", "directories", "elf", diff --git a/pyroscope_ffi/ruby/ext/rbspy/src/lib.rs b/pyroscope_ffi/ruby/ext/rbspy/src/lib.rs index 8f35b1be..d99495da 100644 --- a/pyroscope_ffi/ruby/ext/rbspy/src/lib.rs +++ b/pyroscope_ffi/ruby/ext/rbspy/src/lib.rs @@ -36,17 +36,24 @@ fn signalpass() -> &'static SignalPass { #[no_mangle] pub extern "C" fn initialize_agent( - application_name: *const c_char, server_address: *const c_char, sample_rate: u32, - detect_subprocesses: bool, tags: *const c_char, + application_name: *const c_char, server_address: *const c_char, auth_token: *const c_char, + sample_rate: u32, detect_subprocesses: bool, tags: *const c_char, ) -> bool { let application_name = unsafe { CStr::from_ptr(application_name) } .to_str() .unwrap() .to_string(); + let server_address = unsafe { CStr::from_ptr(server_address) } .to_str() .unwrap() .to_string(); + + let auth_token = unsafe { CStr::from_ptr(auth_token) } + .to_str() + .unwrap() + .to_string(); + let tags_string = unsafe { CStr::from_ptr(tags) } .to_str() .unwrap() @@ -65,11 +72,16 @@ pub extern "C" fn initialize_agent( let tags_ref = tags_string.as_str(); let tags = string_to_tags(tags_ref); let rbspy = rbspy_backend(rbspy_config); - let agent = PyroscopeAgent::builder(server_address, application_name) + + let mut agent_builder = PyroscopeAgent::builder(server_address, application_name) .backend(rbspy) - .tags(tags) - .build() - .unwrap(); + .tags(tags); + + if auth_token != "" { + agent_builder = agent_builder.auth_token(auth_token); + } + + let agent = agent_builder.build().unwrap(); let agent_running = agent.start().unwrap(); diff --git a/pyroscope_ffi/ruby/lib/pyroscope_beta.rb b/pyroscope_ffi/ruby/lib/pyroscope_beta.rb index 966a688b..c00300c9 100644 --- a/pyroscope_ffi/ruby/lib/pyroscope_beta.rb +++ b/pyroscope_ffi/ruby/lib/pyroscope_beta.rb @@ -3,7 +3,7 @@ module Rust extend FFI::Library ffi_lib File.expand_path(File.dirname(__FILE__)) + "/rbspy/rbspy.#{RbConfig::CONFIG["DLEXT"]}" - attach_function :initialize_agent, [:string, :string, :int, :bool, :string], :bool + attach_function :initialize_agent, [:string, :string, :string, :int, :bool, :string], :bool attach_function :add_tag, [:uint64, :string, :string], :bool attach_function :remove_tag, [:uint64, :string, :string], :bool attach_function :drop_agent, [], :bool @@ -16,11 +16,12 @@ module Utils end module Pyroscope - Config = Struct.new(:application_name, :server_address, :sample_rate, :detect_subprocesses, :log_level, :tags) do + Config = Struct.new(:application_name, :server_address, :auth_token, :sample_rate, :detect_subprocesses, :log_level, :tags) do def initialize(*) super self.application_name ||= '' self.server_address ||= 'http://localhost:4040' + self.auth_token ||= '' self.sample_rate ||= 100 self.detect_subprocesses ||= true self.log_level ||= 'info' @@ -38,6 +39,7 @@ def configure Rust.initialize_agent( @config.application_name, @config.server_address, + @config.auth_token, @config.sample_rate, @config.detect_subprocesses, tags_to_string(@config.tags) From bdb93c4dded6f8cfee7d08a0ed43377d663997d2 Mon Sep 17 00:00:00 2001 From: Abid Omar Date: Mon, 13 Jun 2022 20:18:37 +0000 Subject: [PATCH 04/31] wip: version bump --- pyroscope_ffi/ruby/lib/pyroscope/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyroscope_ffi/ruby/lib/pyroscope/version.rb b/pyroscope_ffi/ruby/lib/pyroscope/version.rb index 3599a352..403e4304 100644 --- a/pyroscope_ffi/ruby/lib/pyroscope/version.rb +++ b/pyroscope_ffi/ruby/lib/pyroscope/version.rb @@ -1,3 +1,3 @@ module Pyroscope - VERSION = '0.1.9'.freeze + VERSION = '0.2.2'.freeze end From e9c2b8c75113b227096a6e037c2e724f7bf505f8 Mon Sep 17 00:00:00 2001 From: Abid Omar Date: Thu, 16 Jun 2022 23:27:00 -0500 Subject: [PATCH 05/31] wip: remove Cargo.lock files --- pyroscope_ffi/ruby/ext/rbspy/Cargo.lock | 2220 ------------------- pyroscope_ffi/ruby/ext/thread_id/Cargo.lock | 16 - 2 files changed, 2236 deletions(-) delete mode 100644 pyroscope_ffi/ruby/ext/rbspy/Cargo.lock delete mode 100644 pyroscope_ffi/ruby/ext/thread_id/Cargo.lock diff --git a/pyroscope_ffi/ruby/ext/rbspy/Cargo.lock b/pyroscope_ffi/ruby/ext/rbspy/Cargo.lock deleted file mode 100644 index 4217a003..00000000 --- a/pyroscope_ffi/ruby/ext/rbspy/Cargo.lock +++ /dev/null @@ -1,2220 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "addr2line" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" -dependencies = [ - "cpp_demangle", - "fallible-iterator", - "gimli", - "object", - "rustc-demangle", - "smallvec", -] - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "ahash" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" -dependencies = [ - "getrandom", - "once_cell", - "version_check", -] - -[[package]] -name = "aho-corasick" -version = "0.7.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" -dependencies = [ - "memchr", -] - -[[package]] -name = "ansi_term" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" -dependencies = [ - "winapi", -] - -[[package]] -name = "anyhow" -version = "1.0.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f9b8508dccb7687a1d6c4ce66b2b0ecef467c94667de27d8d7fe1f8d2a9cdc" - -[[package]] -name = "arrayvec" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9" -dependencies = [ - "nodrop", -] - -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi", - "libc", - "winapi", -] - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "base64" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" - -[[package]] -name = "bindgen" -version = "0.59.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bd2a9a458e8f4304c52c43ebb0cfbd520289f8379a52e329a38afda99bf8eb8" -dependencies = [ - "bitflags", - "cexpr", - "clang-sys", - "clap 2.34.0", - "env_logger", - "lazy_static", - "lazycell", - "log", - "peeking_take_while", - "proc-macro2", - "quote", - "regex", - "rustc-hash", - "shlex", - "which", -] - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bumpalo" -version = "3.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ccbd214614c6783386c1af30caf03192f17891059cecc394b4fb119e363de3" - -[[package]] -name = "bytemuck" -version = "1.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdead85bdec19c194affaeeb670c0e41fe23de31459efd1c174d049269cf02cc" - -[[package]] -name = "byteorder" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fc10e8cc6b2580fda3f36eb6dc5316657f812a3df879a44a66fc9f0fdbc4855" - -[[package]] -name = "bytes" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" - -[[package]] -name = "cc" -version = "1.0.73" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" - -[[package]] -name = "cexpr" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" -dependencies = [ - "nom", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "chrono" -version = "0.4.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" -dependencies = [ - "libc", - "num-integer", - "num-traits", - "time", - "winapi", -] - -[[package]] -name = "clang-sys" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a050e2153c5be08febd6734e29298e844fdb0fa21aeddd63b4eb7baa106c69b" -dependencies = [ - "glob", - "libc", - "libloading", -] - -[[package]] -name = "clap" -version = "2.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" -dependencies = [ - "ansi_term", - "atty", - "bitflags", - "strsim 0.8.0", - "textwrap 0.11.0", - "unicode-width", - "vec_map", -] - -[[package]] -name = "clap" -version = "3.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a836566fa5f52f7ddf909a8a2f9029b9f78ca584cd95cf7e87f8073110f4c5c9" -dependencies = [ - "atty", - "bitflags", - "clap_derive", - "clap_lex", - "indexmap", - "lazy_static", - "strsim 0.10.0", - "termcolor", - "textwrap 0.15.0", -] - -[[package]] -name = "clap_derive" -version = "3.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "986fd75d1dfd2c34eb8c9275ae38ad87ea9478c9b79e87f1801f7d866dfb1e37" -dependencies = [ - "heck", - "proc-macro-error", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "clap_lex" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5538cd660450ebeb4234cfecf8f2284b844ffc4c50531e66d584ad5b91293613" -dependencies = [ - "os_str_bytes", -] - -[[package]] -name = "core-foundation" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" - -[[package]] -name = "cpp_demangle" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeaa953eaad386a53111e47172c2fedba671e5684c8dd601a5f474f4f118710f" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crc32fast" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crossbeam-channel" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aaa7bd5fb665c6864b5f963dd9097905c54125909c7aa94c9e18507cdbe6c53" -dependencies = [ - "cfg-if", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38" -dependencies = [ - "cfg-if", - "lazy_static", -] - -[[package]] -name = "ctrlc" -version = "3.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b37feaa84e6861e00a1f5e5aa8da3ee56d605c9992d33e082786754828e20865" -dependencies = [ - "nix 0.24.1", - "winapi", -] - -[[package]] -name = "dashmap" -version = "5.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3495912c9c1ccf2e18976439f4443f3fee0fd61f424ff99fde6a66b15ecb448f" -dependencies = [ - "cfg-if", - "hashbrown 0.12.1", - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "directories" -version = "4.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f51c5d4ddabd36886dd3e1438cb358cdcb0d7c499cb99cb4ac2e38e18b5cb210" -dependencies = [ - "dirs-sys", -] - -[[package]] -name = "dirs-sys" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" -dependencies = [ - "libc", - "redox_users", - "winapi", -] - -[[package]] -name = "either" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" - -[[package]] -name = "elf" -version = "0.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4841de15dbe0e49b9b62a417589299e3be0d557e0900d36acb87e6dae47197f5" -dependencies = [ - "byteorder", -] - -[[package]] -name = "encoding_rs" -version = "0.8.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "env_logger" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3" -dependencies = [ - "atty", - "humantime", - "log", - "regex", - "termcolor", -] - -[[package]] -name = "errno" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" -dependencies = [ - "errno-dragonfly", - "libc", - "winapi", -] - -[[package]] -name = "errno-dragonfly" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" -dependencies = [ - "cc", - "libc", -] - -[[package]] -name = "fallible-iterator" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" - -[[package]] -name = "fastrand" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" -dependencies = [ - "instant", -] - -[[package]] -name = "flate2" -version = "1.0.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6" -dependencies = [ - "crc32fast", - "miniz_oxide", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - -[[package]] -name = "form_urlencoded" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" -dependencies = [ - "matches", - "percent-encoding", -] - -[[package]] -name = "fuchsia-cprng" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" - -[[package]] -name = "futures-channel" -version = "0.3.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" -dependencies = [ - "futures-core", -] - -[[package]] -name = "futures-core" -version = "0.3.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" - -[[package]] -name = "futures-io" -version = "0.3.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" - -[[package]] -name = "futures-sink" -version = "0.3.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" - -[[package]] -name = "futures-task" -version = "0.3.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" - -[[package]] -name = "futures-util" -version = "0.3.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" -dependencies = [ - "futures-core", - "futures-io", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", -] - -[[package]] -name = "getrandom" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9be70c98951c83b8d2f8f60d7065fa6d5146873094452a1008da8c2f1e4205ad" -dependencies = [ - "cfg-if", - "libc", - "wasi 0.10.0+wasi-snapshot-preview1", -] - -[[package]] -name = "gimli" -version = "0.26.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4" -dependencies = [ - "fallible-iterator", - "stable_deref_trait", -] - -[[package]] -name = "glob" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" - -[[package]] -name = "goblin" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfeb764aa29a0774d290c2df134a37ab2e3c1ba59009162626658aabefda321a" -dependencies = [ - "log", - "plain", - "scroll", -] - -[[package]] -name = "h2" -version = "0.3.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37a82c6d637fc9515a4694bbf1cb2457b79d81ce52b3108bdeea58b07dd34a57" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" - -[[package]] -name = "hashbrown" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db0d4cf898abf0081f964436dc980e96670a0f36863e4b83aaacdb65c9d7ccc3" - -[[package]] -name = "heck" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" - -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - -[[package]] -name = "http" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" -dependencies = [ - "bytes", - "fnv", - "itoa 1.0.2", -] - -[[package]] -name = "http-body" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" -dependencies = [ - "bytes", - "http", - "pin-project-lite", -] - -[[package]] -name = "httparse" -version = "1.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "496ce29bb5a52785b44e0f7ca2847ae0bb839c9bd28f69acac9b99d461c0c04c" - -[[package]] -name = "httpdate" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" - -[[package]] -name = "humantime" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" - -[[package]] -name = "hyper" -version = "0.14.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42dc3c131584288d375f2d07f822b0cb012d8c6fb899a5b9fdb3cb7eb9b6004f" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "httparse", - "httpdate", - "itoa 1.0.2", - "pin-project-lite", - "socket2", - "tokio", - "tower-service", - "tracing", - "want", -] - -[[package]] -name = "hyper-rustls" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d87c48c02e0dc5e3b849a2041db3029fd066650f8f717c07bf8ed78ccb895cac" -dependencies = [ - "http", - "hyper", - "rustls", - "tokio", - "tokio-rustls", -] - -[[package]] -name = "hyper-tls" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" -dependencies = [ - "bytes", - "hyper", - "native-tls", - "tokio", - "tokio-native-tls", -] - -[[package]] -name = "idna" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" -dependencies = [ - "matches", - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "indexmap" -version = "1.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6012d540c5baa3589337a98ce73408de9b5a25ec9fc2c6fd6be8f0d39e0ca5a" -dependencies = [ - "autocfg", - "hashbrown 0.11.2", -] - -[[package]] -name = "inferno" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a3cb215599901c8f491666421d44ffaed08d6872b4c7ced6f425683b951271e" -dependencies = [ - "ahash", - "atty", - "clap 3.2.1", - "crossbeam-channel", - "crossbeam-utils", - "dashmap", - "env_logger", - "indexmap", - "itoa 1.0.2", - "lazy_static", - "log", - "num-format", - "num_cpus", - "quick-xml", - "rgb", - "str_stack", -] - -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "ipnet" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "879d54834c8c76457ef4293a689b2a8c59b076067ad77b15efafbb05f92a592b" - -[[package]] -name = "itertools" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" - -[[package]] -name = "itoa" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d" - -[[package]] -name = "js-sys" -version = "0.3.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "671a26f820db17c2a2750743f1dd03bafd15b98c9f30c7c2628c024c05d73397" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "lazycell" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" - -[[package]] -name = "libc" -version = "0.2.126" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" - -[[package]] -name = "libloading" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd" -dependencies = [ - "cfg-if", - "winapi", -] - -[[package]] -name = "libproc" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6466fc1f834276563fbbd4be1c24236ef92bb9efdbd4691e07f1cf85a0b407f0" -dependencies = [ - "errno", - "libc", -] - -[[package]] -name = "libproc" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b799ad155d75ce914c467ee5627b62247c20d4aedbd446f821484cebf3cded7" -dependencies = [ - "bindgen", - "errno", - "libc", -] - -[[package]] -name = "lock_api" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "mach" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" -dependencies = [ - "libc", -] - -[[package]] -name = "mach2" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d0d1830bcd151a6fc4aea1369af235b36c1528fe976b8ff678683c9995eade8" -dependencies = [ - "libc", -] - -[[package]] -name = "mach_o_sys" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e854583a83f20cf329bb9283366335387f7db59d640d1412167e05fedb98826" - -[[package]] -name = "matches" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" - -[[package]] -name = "memchr" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" - -[[package]] -name = "memmap" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "memoffset" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" -dependencies = [ - "autocfg", -] - -[[package]] -name = "mime" -version = "0.3.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" - -[[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - -[[package]] -name = "miniz_oxide" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f5c75688da582b8ffc1f1799e9db273f32133c49e048f614d22ec3256773ccc" -dependencies = [ - "adler", -] - -[[package]] -name = "mio" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "713d550d9b44d89174e066b7a6217ae06234c10cb47819a88290d2b353c31799" -dependencies = [ - "libc", - "log", - "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys", -] - -[[package]] -name = "names" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7d66043b25d4a6cccb23619d10c19c25304b355a7dccd4a8e11423dd2382146" -dependencies = [ - "clap 3.2.1", - "rand 0.8.5", -] - -[[package]] -name = "native-tls" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd7e2f3618557f980e0b17e8856252eee3c97fa12c54dff0ca290fb6266ca4a9" -dependencies = [ - "lazy_static", - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - -[[package]] -name = "nix" -version = "0.23.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f866317acbd3a240710c63f065ffb1e4fd466259045ccb504130b7f668f35c6" -dependencies = [ - "bitflags", - "cc", - "cfg-if", - "libc", - "memoffset", -] - -[[package]] -name = "nix" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f17df307904acd05aa8e32e97bb20f2a0df1728bbc2d771ae8f9a90463441e9" -dependencies = [ - "bitflags", - "cfg-if", - "libc", - "memoffset", -] - -[[package]] -name = "nodrop" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" - -[[package]] -name = "nom" -version = "7.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36" -dependencies = [ - "memchr", - "minimal-lexical", -] - -[[package]] -name = "num-format" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bafe4179722c2894288ee77a9f044f02811c86af699344c498b0840c698a2465" -dependencies = [ - "arrayvec", - "itoa 0.4.8", -] - -[[package]] -name = "num-integer" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" -dependencies = [ - "autocfg", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" -dependencies = [ - "autocfg", -] - -[[package]] -name = "num_cpus" -version = "1.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" -dependencies = [ - "hermit-abi", - "libc", -] - -[[package]] -name = "object" -version = "0.27.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67ac1d3f9a1d3616fd9a60c8d74296f22406a238b6a72f5cc1e6f314df4ffbf9" -dependencies = [ - "flate2", - "memchr", -] - -[[package]] -name = "once_cell" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7709cef83f0c1f58f666e746a08b21e0085f7440fa6a29cc194d68aac97a4225" - -[[package]] -name = "openssl" -version = "0.10.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb81a6430ac911acb25fe5ac8f1d2af1b4ea8a4fdfda0f1ee4292af2e2d8eb0e" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.74" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "835363342df5fba8354c5b453325b110ffd54044e588c539cf2f20a8014e4cb1" -dependencies = [ - "autocfg", - "cc", - "libc", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "os_str_bytes" -version = "6.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21326818e99cfe6ce1e524c2a805c189a99b5ae555a35d19f9a284b427d86afa" - -[[package]] -name = "parking_lot_core" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-sys", -] - -[[package]] -name = "peeking_take_while" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" - -[[package]] -name = "percent-encoding" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" - -[[package]] -name = "pin-project-lite" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "pkg-config" -version = "0.3.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" - -[[package]] -name = "plain" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" - -[[package]] -name = "ppv-lite86" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" - -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - -[[package]] -name = "proc-macro2" -version = "1.0.39" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c54b25569025b7fc9651de43004ae593a75ad88543b17178aa5e1b9c4f15f56f" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "proc-maps" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2f62c16ccc63ce2f590b17b8b9b33616f59631b8982ad52ed21e7f6d936c409" -dependencies = [ - "anyhow", - "bindgen", - "libc", - "libproc 0.10.0", - "mach2", - "winapi", -] - -[[package]] -name = "prost" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71adf41db68aa0daaefc69bb30bcd68ded9b9abaad5d1fbb6304c4fb390e083e" -dependencies = [ - "bytes", - "prost-derive", -] - -[[package]] -name = "prost-derive" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b670f45da57fb8542ebdbb6105a925fe571b67f9e7ed9f47a06a84e72b4e7cc" -dependencies = [ - "anyhow", - "itertools", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "pyroscope" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb63fa944e7139ecce68c6307e50b9f62780fc5b4de21ba2f04f32ec4f36499b" -dependencies = [ - "libc", - "log", - "names", - "reqwest", - "thiserror", -] - -[[package]] -name = "pyroscope_rbspy" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3359aa2a37be1fd6fa096cb1b73380c3f8b975346d5b3423f7a4f559acb9ba0a" -dependencies = [ - "anyhow", - "log", - "pyroscope", - "rbspy 0.12.1", - "thiserror", -] - -[[package]] -name = "quick-xml" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9279fbdacaad3baf559d8cabe0acc3d06e30ea14931af31af79578ac0946decc" -dependencies = [ - "memchr", -] - -[[package]] -name = "quote" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rand" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" -dependencies = [ - "fuchsia-cprng", - "libc", - "rand_core 0.3.1", - "rdrand", - "winapi", -] - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha", - "rand_core 0.6.3", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core 0.6.3", -] - -[[package]] -name = "rand_core" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" -dependencies = [ - "rand_core 0.4.2", -] - -[[package]] -name = "rand_core" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" - -[[package]] -name = "rand_core" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" -dependencies = [ - "getrandom", -] - -[[package]] -name = "rbspy" -version = "0.1.0" -dependencies = [ - "pyroscope", - "pyroscope_rbspy", -] - -[[package]] -name = "rbspy" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcbebdf0037de5a92722b0bca2965ce0a76cd5c962225cf355e31ac668ea653f" -dependencies = [ - "anyhow", - "chrono", - "clap 3.2.1", - "ctrlc", - "directories", - "elf", - "env_logger", - "flate2", - "inferno", - "libc", - "libproc 0.10.0", - "log", - "nix 0.23.1", - "proc-maps", - "prost", - "rand 0.8.5", - "rbspy-ruby-structs", - "remoteprocess", - "serde", - "serde_derive", - "serde_json", - "tempdir", - "term_size", - "thiserror", - "winapi", -] - -[[package]] -name = "rbspy-ruby-structs" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "321d7adbbd5dc84af13b4cacceb22973186ed1dc19d55248fa53d5277ae40e02" - -[[package]] -name = "rdrand" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "read-process-memory" -version = "0.1.4" -source = "git+https://github.com/omarabid/read-process-memory.git?branch=0.1.4-fix#51a5122d0d084478cc7563414255392e8f026971" -dependencies = [ - "libc", - "log", - "mach", - "winapi", -] - -[[package]] -name = "redox_syscall" -version = "0.2.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" -dependencies = [ - "bitflags", -] - -[[package]] -name = "redox_users" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" -dependencies = [ - "getrandom", - "redox_syscall", - "thiserror", -] - -[[package]] -name = "regex" -version = "1.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d83f127d94bdbcda4c8cc2e50f6f84f4b611f69c902699ca385a39c3a75f9ff1" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.6.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49b3de9ec5dc0a3417da371aab17d729997c15010e7fd24ff707773a33bddb64" - -[[package]] -name = "remoteprocess" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9f13e22b81d40176f4d7ed41c029fd2c7306b182db9838a44d88aeb97a7c6d6" -dependencies = [ - "addr2line", - "goblin", - "lazy_static", - "libc", - "libproc 0.12.0", - "log", - "mach", - "mach_o_sys", - "memmap", - "nix 0.24.1", - "object", - "proc-maps", - "read-process-memory", - "regex", - "winapi", -] - -[[package]] -name = "remove_dir_all" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" -dependencies = [ - "winapi", -] - -[[package]] -name = "reqwest" -version = "0.11.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46a1f7aa4f35e5e8b4160449f51afc758f0ce6454315a9fa7d0d113e958c41eb" -dependencies = [ - "base64", - "bytes", - "encoding_rs", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "hyper", - "hyper-rustls", - "hyper-tls", - "ipnet", - "js-sys", - "lazy_static", - "log", - "mime", - "native-tls", - "percent-encoding", - "pin-project-lite", - "rustls", - "rustls-native-certs", - "rustls-pemfile 0.3.0", - "serde", - "serde_json", - "serde_urlencoded", - "tokio", - "tokio-native-tls", - "tokio-rustls", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "winreg", -] - -[[package]] -name = "rgb" -version = "0.8.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e74fdc210d8f24a7dbfedc13b04ba5764f5232754ccebfdf5fff1bad791ccbc6" -dependencies = [ - "bytemuck", -] - -[[package]] -name = "ring" -version = "0.16.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" -dependencies = [ - "cc", - "libc", - "once_cell", - "spin", - "untrusted", - "web-sys", - "winapi", -] - -[[package]] -name = "rustc-demangle" -version = "0.1.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" - -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "rustls" -version = "0.20.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aab8ee6c7097ed6057f43c187a62418d0c05a4bd5f18b3571db50ee0f9ce033" -dependencies = [ - "log", - "ring", - "sct", - "webpki", -] - -[[package]] -name = "rustls-native-certs" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0167bac7a9f490495f3c33013e7722b53cb087ecbe082fb0c6387c96f634ea50" -dependencies = [ - "openssl-probe", - "rustls-pemfile 1.0.0", - "schannel", - "security-framework", -] - -[[package]] -name = "rustls-pemfile" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee86d63972a7c661d1536fefe8c3c8407321c3df668891286de28abcd087360" -dependencies = [ - "base64", -] - -[[package]] -name = "rustls-pemfile" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7522c9de787ff061458fe9a829dc790a3f5b22dc571694fc5883f448b94d9a9" -dependencies = [ - "base64", -] - -[[package]] -name = "ryu" -version = "1.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695" - -[[package]] -name = "schannel" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" -dependencies = [ - "lazy_static", - "windows-sys", -] - -[[package]] -name = "scopeguard" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" - -[[package]] -name = "scroll" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04c565b551bafbef4157586fa379538366e4385d42082f255bfd96e4fe8519da" -dependencies = [ - "scroll_derive", -] - -[[package]] -name = "scroll_derive" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdbda6ac5cd1321e724fa9cee216f3a61885889b896f073b8f82322789c5250e" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "sct" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "security-framework" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dc14f172faf8a0194a3aded622712b0de276821addc574fa54fc0a1167e10dc" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "serde" -version = "1.0.137" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61ea8d54c77f8315140a05f4c7237403bf38b72704d031543aa1d16abbf517d1" - -[[package]] -name = "serde_derive" -version = "1.0.137" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f26faba0c3959972377d3b2d306ee9f71faee9714294e41bb777f83f88578be" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.81" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7ce2b32a1aed03c558dc61a5cd328f15aff2dbc17daad8fb8af04d2100e15c" -dependencies = [ - "itoa 1.0.2", - "ryu", - "serde", -] - -[[package]] -name = "serde_urlencoded" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" -dependencies = [ - "form_urlencoded", - "itoa 1.0.2", - "ryu", - "serde", -] - -[[package]] -name = "shlex" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" - -[[package]] -name = "slab" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb703cfe953bccee95685111adeedb76fabe4e97549a58d16f03ea7b9367bb32" - -[[package]] -name = "smallvec" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" - -[[package]] -name = "socket2" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "spin" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" - -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - -[[package]] -name = "str_stack" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9091b6114800a5f2141aee1d1b9d6ca3592ac062dc5decb3764ec5895a47b4eb" - -[[package]] -name = "strsim" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" - -[[package]] -name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - -[[package]] -name = "syn" -version = "1.0.96" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0748dd251e24453cb8717f0354206b91557e4ec8703673a4b30208f2abaf1ebf" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "tempdir" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8" -dependencies = [ - "rand 0.4.6", - "remove_dir_all", -] - -[[package]] -name = "tempfile" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" -dependencies = [ - "cfg-if", - "fastrand", - "libc", - "redox_syscall", - "remove_dir_all", - "winapi", -] - -[[package]] -name = "term_size" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e4129646ca0ed8f45d09b929036bafad5377103edd06e50bf574b353d2b08d9" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "termcolor" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "textwrap" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" -dependencies = [ - "unicode-width", -] - -[[package]] -name = "textwrap" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb" - -[[package]] -name = "thiserror" -version = "1.0.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "time" -version = "0.1.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" -dependencies = [ - "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "winapi", -] - -[[package]] -name = "tinyvec" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" - -[[package]] -name = "tokio" -version = "1.19.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c51a52ed6686dd62c320f9b89299e9dfb46f730c7a48e635c19f21d116cb1439" -dependencies = [ - "bytes", - "libc", - "memchr", - "mio", - "num_cpus", - "once_cell", - "pin-project-lite", - "socket2", - "winapi", -] - -[[package]] -name = "tokio-native-tls" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" -dependencies = [ - "native-tls", - "tokio", -] - -[[package]] -name = "tokio-rustls" -version = "0.23.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" -dependencies = [ - "rustls", - "tokio", - "webpki", -] - -[[package]] -name = "tokio-util" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc463cd8deddc3770d20f9852143d50bf6094e640b485cb2e189a2099085ff45" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", - "tracing", -] - -[[package]] -name = "tower-service" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" - -[[package]] -name = "tracing" -version = "0.1.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a400e31aa60b9d44a52a8ee0343b5b18566b03a8321e0d321f695cf56e940160" -dependencies = [ - "cfg-if", - "pin-project-lite", - "tracing-core", -] - -[[package]] -name = "tracing-core" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7709595b8878a4965ce5e87ebf880a7d39c9afc6837721b21a5a816a8117d921" -dependencies = [ - "once_cell", -] - -[[package]] -name = "try-lock" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" - -[[package]] -name = "unicode-bidi" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" - -[[package]] -name = "unicode-ident" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d22af068fba1eb5edcb4aea19d382b2a3deb4c8f9d475c589b6ada9e0fd493ee" - -[[package]] -name = "unicode-normalization" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" -dependencies = [ - "tinyvec", -] - -[[package]] -name = "unicode-width" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" - -[[package]] -name = "untrusted" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" - -[[package]] -name = "url" -version = "2.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" -dependencies = [ - "form_urlencoded", - "idna", - "matches", - "percent-encoding", -] - -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - -[[package]] -name = "vec_map" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "want" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" -dependencies = [ - "log", - "try-lock", -] - -[[package]] -name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "wasm-bindgen" -version = "0.2.80" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27370197c907c55e3f1a9fbe26f44e937fe6451368324e009cba39e139dc08ad" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.80" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53e04185bfa3a779273da532f5025e33398409573f348985af9a1cbf3774d3f4" -dependencies = [ - "bumpalo", - "lazy_static", - "log", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f741de44b75e14c35df886aff5f1eb73aa114fa5d4d00dcd37b5e01259bf3b2" -dependencies = [ - "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.80" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17cae7ff784d7e83a2fe7611cfe766ecf034111b49deb850a3dc7699c08251f5" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.80" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99ec0dc7a4756fffc231aab1b9f2f578d23cd391390ab27f952ae0c9b3ece20b" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.80" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d554b7f530dee5964d9a9468d95c1f8b8acae4f282807e7d27d4b03099a46744" - -[[package]] -name = "web-sys" -version = "0.3.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b17e741662c70c8bd24ac5c5b18de314a2c26c32bf8346ee1e6f53de919c283" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "webpki" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "which" -version = "4.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c4fb54e6113b6a8772ee41c3404fb0301ac79604489467e0a9ce1f3e97c24ae" -dependencies = [ - "either", - "lazy_static", - "libc", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi", -] - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows-sys" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" -dependencies = [ - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" - -[[package]] -name = "windows_i686_gnu" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" - -[[package]] -name = "windows_i686_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" - -[[package]] -name = "winreg" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" -dependencies = [ - "winapi", -] diff --git a/pyroscope_ffi/ruby/ext/thread_id/Cargo.lock b/pyroscope_ffi/ruby/ext/thread_id/Cargo.lock deleted file mode 100644 index 0bc17746..00000000 --- a/pyroscope_ffi/ruby/ext/thread_id/Cargo.lock +++ /dev/null @@ -1,16 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "libc" -version = "0.2.126" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" - -[[package]] -name = "thread_id" -version = "0.1.0" -dependencies = [ - "libc", -] From d68275b6c4cd9e64704d4426f7b519c06b819cd5 Mon Sep 17 00:00:00 2001 From: Abid Omar Date: Fri, 17 Jun 2022 22:42:31 -0500 Subject: [PATCH 06/31] wip: add cbindgen for rbspy/thread_id extensions --- pyroscope_ffi/ruby/ext/rbspy/Cargo.toml | 9 ++++++++ pyroscope_ffi/ruby/ext/rbspy/build.rs | 12 ++++++++++ pyroscope_ffi/ruby/ext/rbspy/cbindgen.toml | 22 +++++++++++++++++++ pyroscope_ffi/ruby/ext/thread_id/Cargo.toml | 9 ++++++++ pyroscope_ffi/ruby/ext/thread_id/build.rs | 12 ++++++++++ .../ruby/ext/thread_id/cbindgen.toml | 22 +++++++++++++++++++ 6 files changed, 86 insertions(+) create mode 100644 pyroscope_ffi/ruby/ext/rbspy/build.rs create mode 100644 pyroscope_ffi/ruby/ext/rbspy/cbindgen.toml create mode 100644 pyroscope_ffi/ruby/ext/thread_id/build.rs create mode 100644 pyroscope_ffi/ruby/ext/thread_id/cbindgen.toml diff --git a/pyroscope_ffi/ruby/ext/rbspy/Cargo.toml b/pyroscope_ffi/ruby/ext/rbspy/Cargo.toml index 1b776029..ad8721a1 100644 --- a/pyroscope_ffi/ruby/ext/rbspy/Cargo.toml +++ b/pyroscope_ffi/ruby/ext/rbspy/Cargo.toml @@ -13,3 +13,12 @@ pyroscope_rbspy = { version = "0.2" } [patch.crates-io] read-process-memory = {git = "https://github.com/omarabid/read-process-memory.git", branch = "0.1.4-fix"} + +[build-dependencies] +cbindgen = "0.20.0" + +[profile.release] +opt-level= "z" +debug = false +lto = true +codegen-units = 1 diff --git a/pyroscope_ffi/ruby/ext/rbspy/build.rs b/pyroscope_ffi/ruby/ext/rbspy/build.rs new file mode 100644 index 00000000..2c2f6318 --- /dev/null +++ b/pyroscope_ffi/ruby/ext/rbspy/build.rs @@ -0,0 +1,12 @@ +extern crate cbindgen; + +use cbindgen::Config; + +fn main() { + let bindings = { + let crate_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap(); + let config = Config::from_file("cbindgen.toml").unwrap(); + cbindgen::generate_with_config(&crate_dir, config).unwrap() + }; + bindings.write_to_file("include/rbspy.h"); +} diff --git a/pyroscope_ffi/ruby/ext/rbspy/cbindgen.toml b/pyroscope_ffi/ruby/ext/rbspy/cbindgen.toml new file mode 100644 index 00000000..32a3caed --- /dev/null +++ b/pyroscope_ffi/ruby/ext/rbspy/cbindgen.toml @@ -0,0 +1,22 @@ +# The language to output bindings in +language = "C" +documentation_style = "C" + +style = "type" + +# An optional name to use as an include guard +include_guard = "RBSPY_H_" +# include a comment with the version of cbindgen used to generate the file +include_version = true + +# An optional string of text to output at the beginning of the generated file +header = "/* Licensed under Apache-2.0 */" +autogen_warning = "/* Warning, this file is autogenerated by cbindgen. Don't modify this manually. */" + +braces = "SameLine" +tab_width = 2 +line_length = 80 + +[parse] +# Do not parse dependent crates +parse_deps = false diff --git a/pyroscope_ffi/ruby/ext/thread_id/Cargo.toml b/pyroscope_ffi/ruby/ext/thread_id/Cargo.toml index a64a0149..b435669f 100644 --- a/pyroscope_ffi/ruby/ext/thread_id/Cargo.toml +++ b/pyroscope_ffi/ruby/ext/thread_id/Cargo.toml @@ -9,3 +9,12 @@ crate-type = ["cdylib"] [dependencies] libc = "*" + +[build-dependencies] +cbindgen = "0.20.0" + +[profile.release] +opt-level= "z" +debug = false +lto = true +codegen-units = 1 diff --git a/pyroscope_ffi/ruby/ext/thread_id/build.rs b/pyroscope_ffi/ruby/ext/thread_id/build.rs new file mode 100644 index 00000000..273d1392 --- /dev/null +++ b/pyroscope_ffi/ruby/ext/thread_id/build.rs @@ -0,0 +1,12 @@ +extern crate cbindgen; + +use cbindgen::Config; + +fn main() { + let bindings = { + let crate_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap(); + let config = Config::from_file("cbindgen.toml").unwrap(); + cbindgen::generate_with_config(&crate_dir, config).unwrap() + }; + bindings.write_to_file("include/thread_id.h"); +} diff --git a/pyroscope_ffi/ruby/ext/thread_id/cbindgen.toml b/pyroscope_ffi/ruby/ext/thread_id/cbindgen.toml new file mode 100644 index 00000000..32a3caed --- /dev/null +++ b/pyroscope_ffi/ruby/ext/thread_id/cbindgen.toml @@ -0,0 +1,22 @@ +# The language to output bindings in +language = "C" +documentation_style = "C" + +style = "type" + +# An optional name to use as an include guard +include_guard = "RBSPY_H_" +# include a comment with the version of cbindgen used to generate the file +include_version = true + +# An optional string of text to output at the beginning of the generated file +header = "/* Licensed under Apache-2.0 */" +autogen_warning = "/* Warning, this file is autogenerated by cbindgen. Don't modify this manually. */" + +braces = "SameLine" +tab_width = 2 +line_length = 80 + +[parse] +# Do not parse dependent crates +parse_deps = false From 98d224629617af14041700aee65f7ac0a70a7314 Mon Sep 17 00:00:00 2001 From: Abid Omar Date: Sat, 18 Jun 2022 00:26:42 -0500 Subject: [PATCH 07/31] wip: python wheels --- pyroscope_ffi/ruby/elflib/rbspy/manylinux.sh | 23 ++++++++++ .../ruby/elflib/rbspy/pyproject.toml | 7 +++ .../ruby/elflib/rbspy/rbspy/__init__.py | 0 pyroscope_ffi/ruby/elflib/rbspy/setup.cfg | 22 +++++++++ pyroscope_ffi/ruby/elflib/rbspy/setup.py | 46 +++++++++++++++++++ .../ruby/elflib/thread_id/manylinux.sh | 23 ++++++++++ .../ruby/elflib/thread_id/pyproject.toml | 7 +++ pyroscope_ffi/ruby/elflib/thread_id/setup.cfg | 22 +++++++++ pyroscope_ffi/ruby/elflib/thread_id/setup.py | 46 +++++++++++++++++++ .../elflib/thread_id/thread_id/__init__.py | 0 10 files changed, 196 insertions(+) create mode 100644 pyroscope_ffi/ruby/elflib/rbspy/manylinux.sh create mode 100644 pyroscope_ffi/ruby/elflib/rbspy/pyproject.toml create mode 100644 pyroscope_ffi/ruby/elflib/rbspy/rbspy/__init__.py create mode 100644 pyroscope_ffi/ruby/elflib/rbspy/setup.cfg create mode 100644 pyroscope_ffi/ruby/elflib/rbspy/setup.py create mode 100644 pyroscope_ffi/ruby/elflib/thread_id/manylinux.sh create mode 100644 pyroscope_ffi/ruby/elflib/thread_id/pyproject.toml create mode 100644 pyroscope_ffi/ruby/elflib/thread_id/setup.cfg create mode 100644 pyroscope_ffi/ruby/elflib/thread_id/setup.py create mode 100644 pyroscope_ffi/ruby/elflib/thread_id/thread_id/__init__.py diff --git a/pyroscope_ffi/ruby/elflib/rbspy/manylinux.sh b/pyroscope_ffi/ruby/elflib/rbspy/manylinux.sh new file mode 100644 index 00000000..465a6ece --- /dev/null +++ b/pyroscope_ffi/ruby/elflib/rbspy/manylinux.sh @@ -0,0 +1,23 @@ +#!/bin/sh +set -e + +# Install tooling +#yum -y -q install wget gcc libffi-devel openssl-devel + +# Install Rust +#curl https://sh.rustup.rs -sSf | sh -s -- -y +#export PATH=~/.cargo/bin:$PATH + +# Build wheels +#/opt/python/cp37-cp37m/bin/python setup.py bdist_wheel + +# Audit wheels +#for wheel in dist/*.whl; do + #auditwheel repair $wheel -w dist/ + #rm $wheel +#done + +# Extract wheels +for wheel in dist/*.whl; do + /opt/python/cp37-cp37m/bin/wheel unpack $wheel -d wheelhouse +done diff --git a/pyroscope_ffi/ruby/elflib/rbspy/pyproject.toml b/pyroscope_ffi/ruby/elflib/rbspy/pyproject.toml new file mode 100644 index 00000000..c1b39a88 --- /dev/null +++ b/pyroscope_ffi/ruby/elflib/rbspy/pyproject.toml @@ -0,0 +1,7 @@ +[build-system] +requires = [ + "setuptools>=42", + "wheel", + "milksnakex>=0.1.6" +] +build-backend = "setuptools.build_meta" diff --git a/pyroscope_ffi/ruby/elflib/rbspy/rbspy/__init__.py b/pyroscope_ffi/ruby/elflib/rbspy/rbspy/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/pyroscope_ffi/ruby/elflib/rbspy/setup.cfg b/pyroscope_ffi/ruby/elflib/rbspy/setup.cfg new file mode 100644 index 00000000..2e9fa4ae --- /dev/null +++ b/pyroscope_ffi/ruby/elflib/rbspy/setup.cfg @@ -0,0 +1,22 @@ +[metadata] +name = rbspy +version= 1.0.0 +description = Fake wheel to generate audtiwheel libs +url = https://proscope.io +maintainer = Abid Omar +maintainer_email = contact@pyroscope.io +license = Apache 2.0 +classifiers = + Intended Audience :: Developers +project_urls = + Documentation = https://proscope.io + Bug Tracker = https://proscope.io + Discussions = https://proscope.io + Changelog = https://proscope.io + +[options] +packages = find: +install_requires = + milksnakex>=0.1.6 +include_package_data = True +zip_safe = False diff --git a/pyroscope_ffi/ruby/elflib/rbspy/setup.py b/pyroscope_ffi/ruby/elflib/rbspy/setup.py new file mode 100644 index 00000000..acac0218 --- /dev/null +++ b/pyroscope_ffi/ruby/elflib/rbspy/setup.py @@ -0,0 +1,46 @@ +import os +import sys +from setuptools import find_packages, setup +from pathlib import Path + +SCRIPT_DIR = Path(__file__).resolve().parent + +os.chdir(SCRIPT_DIR) + +# print script_dir +print(SCRIPT_DIR) + +LIB_DIR = str(SCRIPT_DIR / "../../ext/rbspy") + +def build_native(spec): + # Step 1: build the rust library + build = spec.add_external_build( + cmd=['cargo', 'build', '--release'], + path=LIB_DIR + ) + + def find_dylib(): + cargo_target = os.environ.get('CARGO_BUILD_TARGET') + if cargo_target: + in_path = 'target/%s/release' % (cargo_target) + else: + in_path = 'target/release' + return build.find_dylib('rbspy', in_path=in_path) + + # Step 2: package the compiled library + rtld_flags = ["NOW"] + if sys.platform == "darwin": + rtld_flags.append("NODELETE") + + spec.add_cffi_module(module_path='rbspy._native', + dylib=find_dylib, + header_filename=lambda: + build.find_header('rbspy.h',in_path='include'), + rtld_flags=rtld_flags, + ) + +setup( + platforms="any", + milksnake_tasks=[build_native], + setup_requires=["milksnakex>=0.1.6"], +) diff --git a/pyroscope_ffi/ruby/elflib/thread_id/manylinux.sh b/pyroscope_ffi/ruby/elflib/thread_id/manylinux.sh new file mode 100644 index 00000000..465a6ece --- /dev/null +++ b/pyroscope_ffi/ruby/elflib/thread_id/manylinux.sh @@ -0,0 +1,23 @@ +#!/bin/sh +set -e + +# Install tooling +#yum -y -q install wget gcc libffi-devel openssl-devel + +# Install Rust +#curl https://sh.rustup.rs -sSf | sh -s -- -y +#export PATH=~/.cargo/bin:$PATH + +# Build wheels +#/opt/python/cp37-cp37m/bin/python setup.py bdist_wheel + +# Audit wheels +#for wheel in dist/*.whl; do + #auditwheel repair $wheel -w dist/ + #rm $wheel +#done + +# Extract wheels +for wheel in dist/*.whl; do + /opt/python/cp37-cp37m/bin/wheel unpack $wheel -d wheelhouse +done diff --git a/pyroscope_ffi/ruby/elflib/thread_id/pyproject.toml b/pyroscope_ffi/ruby/elflib/thread_id/pyproject.toml new file mode 100644 index 00000000..c1b39a88 --- /dev/null +++ b/pyroscope_ffi/ruby/elflib/thread_id/pyproject.toml @@ -0,0 +1,7 @@ +[build-system] +requires = [ + "setuptools>=42", + "wheel", + "milksnakex>=0.1.6" +] +build-backend = "setuptools.build_meta" diff --git a/pyroscope_ffi/ruby/elflib/thread_id/setup.cfg b/pyroscope_ffi/ruby/elflib/thread_id/setup.cfg new file mode 100644 index 00000000..b9bee016 --- /dev/null +++ b/pyroscope_ffi/ruby/elflib/thread_id/setup.cfg @@ -0,0 +1,22 @@ +[metadata] +name = thread_id +version= 1.0.0 +description = Fake wheel to generate audtiwheel libs +url = https://proscope.io +maintainer = Abid Omar +maintainer_email = contact@pyroscope.io +license = Apache 2.0 +classifiers = + Intended Audience :: Developers +project_urls = + Documentation = https://proscope.io + Bug Tracker = https://proscope.io + Discussions = https://proscope.io + Changelog = https://proscope.io + +[options] +packages = find: +install_requires = + milksnakex>=0.1.6 +include_package_data = True +zip_safe = False diff --git a/pyroscope_ffi/ruby/elflib/thread_id/setup.py b/pyroscope_ffi/ruby/elflib/thread_id/setup.py new file mode 100644 index 00000000..ce5c18c9 --- /dev/null +++ b/pyroscope_ffi/ruby/elflib/thread_id/setup.py @@ -0,0 +1,46 @@ +import os +import sys +from setuptools import find_packages, setup +from pathlib import Path + +SCRIPT_DIR = Path(__file__).resolve().parent + +os.chdir(SCRIPT_DIR) + +# print script_dir +print(SCRIPT_DIR) + +LIB_DIR = str(SCRIPT_DIR / "../../ext/thread_id") + +def build_native(spec): + # Step 1: build the rust library + build = spec.add_external_build( + cmd=['cargo', 'build', '--release'], + path=LIB_DIR + ) + + def find_dylib(): + cargo_target = os.environ.get('CARGO_BUILD_TARGET') + if cargo_target: + in_path = 'target/%s/release' % (cargo_target) + else: + in_path = 'target/release' + return build.find_dylib('thread_id', in_path=in_path) + + # Step 2: package the compiled library + rtld_flags = ["NOW"] + if sys.platform == "darwin": + rtld_flags.append("NODELETE") + + spec.add_cffi_module(module_path='thread_id._native', + dylib=find_dylib, + header_filename=lambda: + build.find_header('thread_id.h',in_path='include'), + rtld_flags=rtld_flags, + ) + +setup( + platforms="any", + milksnake_tasks=[build_native], + setup_requires=["milksnakex>=0.1.6"], +) diff --git a/pyroscope_ffi/ruby/elflib/thread_id/thread_id/__init__.py b/pyroscope_ffi/ruby/elflib/thread_id/thread_id/__init__.py new file mode 100644 index 00000000..e69de29b From e7781f7a0ea721da1fb1665c673d844b61611630 Mon Sep 17 00:00:00 2001 From: Abid Omar Date: Sun, 19 Jun 2022 20:32:53 -0500 Subject: [PATCH 08/31] wip: minor modifications --- pyroscope_ffi/ruby/.gitignore | 8 +++++++- pyroscope_ffi/ruby/Rakefile | 1 + pyroscope_ffi/ruby/lib/pyroscope/version.rb | 2 +- pyroscope_ffi/ruby/scripts/docker.sh | 16 ++++++++++++++++ 4 files changed, 25 insertions(+), 2 deletions(-) create mode 100755 pyroscope_ffi/ruby/scripts/docker.sh diff --git a/pyroscope_ffi/ruby/.gitignore b/pyroscope_ffi/ruby/.gitignore index e7cd07a0..cd91df73 100644 --- a/pyroscope_ffi/ruby/.gitignore +++ b/pyroscope_ffi/ruby/.gitignore @@ -1,7 +1,7 @@ *.gem .DS_Store **/target -*.so +*.so* *.bundle Gemfile.lock /pkg @@ -10,3 +10,9 @@ Gemfile.lock /tmp /vendor /.bundle +.eggs +ext/*/include +elflib/*/build +elflib/*/dist +elflib/*/wheelhouse +elflib/*/*egg-info diff --git a/pyroscope_ffi/ruby/Rakefile b/pyroscope_ffi/ruby/Rakefile index 4aff78c8..6f7393fe 100644 --- a/pyroscope_ffi/ruby/Rakefile +++ b/pyroscope_ffi/ruby/Rakefile @@ -55,6 +55,7 @@ namespace :x86_64_linux do spec = Bundler.load_gemspec('pyroscope.gemspec') spec.platform = 'x86_64-linux' spec.files += FileList['lib/rbspy/rbspy.*'] + spec.files += FileList['lib/rbspy.libs/*'] spec.files += FileList['lib/thread_id/thread_id.*'] spec.extensions = [] diff --git a/pyroscope_ffi/ruby/lib/pyroscope/version.rb b/pyroscope_ffi/ruby/lib/pyroscope/version.rb index 403e4304..f098414d 100644 --- a/pyroscope_ffi/ruby/lib/pyroscope/version.rb +++ b/pyroscope_ffi/ruby/lib/pyroscope/version.rb @@ -1,3 +1,3 @@ module Pyroscope - VERSION = '0.2.2'.freeze + VERSION = '0.2.3'.freeze end diff --git a/pyroscope_ffi/ruby/scripts/docker.sh b/pyroscope_ffi/ruby/scripts/docker.sh new file mode 100755 index 00000000..8c9e44e4 --- /dev/null +++ b/pyroscope_ffi/ruby/scripts/docker.sh @@ -0,0 +1,16 @@ +#!/bin/bash +set -ex + +BUILD_DIR="/work" + +docker run \ + -w /work/pyroscope_ffi/ruby/elflib/rbspy \ + -v `pwd`:/work \ + quay.io/pypa/${BUILD_ARCH} \ + sh manylinux.sh + +docker run \ + -w /work/pyroscope_ffi/ruby/elflib/thread_id \ + -v `pwd`:/work \ + quay.io/pypa/${BUILD_ARCH} \ + sh manylinux.sh From a2ebe18c8701889cfda453086f304f080fe87650 Mon Sep 17 00:00:00 2001 From: Abid Omar Date: Mon, 20 Jun 2022 22:56:13 -0500 Subject: [PATCH 09/31] wip: cargo patch --- Cargo.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 01370421..fd027ec7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -57,6 +57,10 @@ names = "0.13.0" reqwest = { version = "0.11", features = ["blocking", "rustls-tls-native-roots"]} libc = "^0.2.124" +#[patch.crates-io] +#rbspy = {path = "../forks/rbspy"} +#read-process-memory = {git = "https://github.com/omarabid/read-process-memorbgit", branch = "0.1.4-fix"} + [dev-dependencies] tokio = { version = "1.18", features = ["full"] } pretty_env_logger = "0.4.0" From bdecaa13aeae3ce7d4c3d97f88bdd104ec35e7c5 Mon Sep 17 00:00:00 2001 From: Abid Omar Date: Tue, 21 Jun 2022 01:01:36 -0500 Subject: [PATCH 10/31] fix(lib): fixed an obsecure bug when counting stacktraces --- pyroscope_backends/pyroscope_rbspy/src/lib.rs | 7 ++----- src/backend/types.rs | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/pyroscope_backends/pyroscope_rbspy/src/lib.rs b/pyroscope_backends/pyroscope_rbspy/src/lib.rs index 24912fbd..cf51a0f4 100644 --- a/pyroscope_backends/pyroscope_rbspy/src/lib.rs +++ b/pyroscope_backends/pyroscope_rbspy/src/lib.rs @@ -234,13 +234,10 @@ impl Backend for Rbspy { } fn report(&mut self) -> Result> { - // Get an Arc reference to the Report Buffer - let buffer = self.buffer.clone(); - - let v8: StackBuffer = buffer.lock()?.deref().to_owned(); + let v8: StackBuffer = self.buffer.lock()?.deref().to_owned(); let reports: Vec = v8.into(); - buffer.lock()?.clear(); + self.buffer.lock()?.clear(); // Return the writer's buffer Ok(reports) diff --git a/src/backend/types.rs b/src/backend/types.rs index d3c56e10..9baa1b6c 100644 --- a/src/backend/types.rs +++ b/src/backend/types.rs @@ -82,7 +82,7 @@ impl From for Vec { // set the metadata of the report, from the stacktrace own metadata. let mut report = report.metadata(stacktrace.metadata.clone()); // record the stacktrace. The count should be 1. - report.record(stacktrace)?; + report.record_with_count(stacktrace, count)?; // add the report to the accumulator. acc.insert(report_id, report); } From bd44e0a4582c6f4cadde165ae9dbc1ee641898d1 Mon Sep 17 00:00:00 2001 From: Abid Omar Date: Tue, 21 Jun 2022 20:53:24 -0500 Subject: [PATCH 11/31] wip: rbspy backend with patched oncpu --- Cargo.toml | 6 +++--- pyroscope_backends/pyroscope_rbspy/src/lib.rs | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index fd027ec7..4b5ac82e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -57,9 +57,9 @@ names = "0.13.0" reqwest = { version = "0.11", features = ["blocking", "rustls-tls-native-roots"]} libc = "^0.2.124" -#[patch.crates-io] -#rbspy = {path = "../forks/rbspy"} -#read-process-memory = {git = "https://github.com/omarabid/read-process-memorbgit", branch = "0.1.4-fix"} +[patch.crates-io] +rbspy = {path = "../forks/rbspy"} +read-process-memory = {git = "https://github.com/omarabid/read-process-memory.git", branch = "0.1.4-fix"} [dev-dependencies] tokio = { version = "1.18", features = ["full"] } diff --git a/pyroscope_backends/pyroscope_rbspy/src/lib.rs b/pyroscope_backends/pyroscope_rbspy/src/lib.rs index cf51a0f4..2bd5df5f 100644 --- a/pyroscope_backends/pyroscope_rbspy/src/lib.rs +++ b/pyroscope_backends/pyroscope_rbspy/src/lib.rs @@ -167,6 +167,7 @@ impl Backend for Rbspy { self.config.time_limit, self.config.with_subprocesses, None, + false, )); // Channel for Errors generated by the RubySpy Sampler From 1a2e6f1d932fbd100d0a7053c75ff27a54865083 Mon Sep 17 00:00:00 2001 From: Abid Omar Date: Tue, 21 Jun 2022 21:23:12 -0500 Subject: [PATCH 12/31] wip: add oncpu/native/gil_only options --- pyroscope_ffi/python/lib/include/pyroscope_ffi.h | 3 +++ pyroscope_ffi/python/lib/src/lib.rs | 7 +++++-- pyroscope_ffi/python/pyroscope_beta/__init__.py | 8 ++++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/pyroscope_ffi/python/lib/include/pyroscope_ffi.h b/pyroscope_ffi/python/lib/include/pyroscope_ffi.h index 4ec62f23..5194bce8 100644 --- a/pyroscope_ffi/python/lib/include/pyroscope_ffi.h +++ b/pyroscope_ffi/python/lib/include/pyroscope_ffi.h @@ -16,6 +16,9 @@ bool initialize_agent(const char *application_name, const char *server_address, uint32_t sample_rate, bool detect_subprocesses, + bool oncpu, + bool native, + bool gil_only, const char *tags); bool drop_agent(void); diff --git a/pyroscope_ffi/python/lib/src/lib.rs b/pyroscope_ffi/python/lib/src/lib.rs index 30bdbfd1..0fe52624 100644 --- a/pyroscope_ffi/python/lib/src/lib.rs +++ b/pyroscope_ffi/python/lib/src/lib.rs @@ -39,7 +39,7 @@ fn signalpass() -> &'static SignalPass { #[no_mangle] pub extern "C" fn initialize_agent( application_name: *const c_char, server_address: *const c_char, sample_rate: u32, - detect_subprocesses: bool, tags: *const c_char, + detect_subprocesses: bool, oncpu: bool, native: bool, gil_only: bool, tags: *const c_char, ) -> bool { let application_name = unsafe { CStr::from_ptr(application_name) } .to_str() @@ -58,7 +58,10 @@ pub extern "C" fn initialize_agent( let pyspy_config = PyspyConfig::new(pid.try_into().unwrap()) .sample_rate(sample_rate) .lock_process(false) - .with_subprocesses(detect_subprocesses); + .with_subprocesses(detect_subprocesses) + .include_idle(!oncpu) + .native(native) + .gil_only(gil_only); let tags_ref = tags_string.as_str(); let tags = string_to_tags(tags_ref); diff --git a/pyroscope_ffi/python/pyroscope_beta/__init__.py b/pyroscope_ffi/python/pyroscope_beta/__init__.py index 5b2043ca..e5ebe3f9 100644 --- a/pyroscope_ffi/python/pyroscope_beta/__init__.py +++ b/pyroscope_ffi/python/pyroscope_beta/__init__.py @@ -3,11 +3,15 @@ from pyroscope_beta._native import ffi, lib from contextlib import contextmanager -Config = namedtuple('Config', ('application_name', 'server_address', 'sample_rate', 'detect_subprocesses', 'log_level')) +Config = namedtuple('Config', ('application_name', 'server_address', +'sample_rate', 'detect_subprocesses','oncpu', 'native', 'gil_only', 'log_level')) -def configure(application_name=None, server_address="http://localhost:4040", sample_rate=100, detect_subprocesses=False, log_level="info", tags=None): +def configure(application_name=None, server_address="http://localhost:4040", +sample_rate=100, detect_subprocesses=False, oncpu=False, native=False, +gil_only=False, log_level="info", tags=None): lib.initialize_agent(application_name.encode("UTF-8"), server_address.encode("UTF-8"), sample_rate, detect_subprocesses, + oncpu, native, gil_only, tags_to_string(tags).encode("UTF-8")) def add_thread_tag(thread_id, key, value): From 4a1e1df77dba9323269308692d449ea0b9366ea7 Mon Sep 17 00:00:00 2001 From: Abid Omar Date: Wed, 22 Jun 2022 00:48:56 -0500 Subject: [PATCH 13/31] wip(python): add auth_token support --- .../python/lib/include/pyroscope_ffi.h | 1 + pyroscope_ffi/python/lib/src/lib.rs | 21 +++++++++++++------ .../python/pyroscope_beta/__init__.py | 9 +++----- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/pyroscope_ffi/python/lib/include/pyroscope_ffi.h b/pyroscope_ffi/python/lib/include/pyroscope_ffi.h index 5194bce8..0b85af22 100644 --- a/pyroscope_ffi/python/lib/include/pyroscope_ffi.h +++ b/pyroscope_ffi/python/lib/include/pyroscope_ffi.h @@ -14,6 +14,7 @@ bool initialize_agent(const char *application_name, const char *server_address, + const char *auth_token, uint32_t sample_rate, bool detect_subprocesses, bool oncpu, diff --git a/pyroscope_ffi/python/lib/src/lib.rs b/pyroscope_ffi/python/lib/src/lib.rs index 0fe52624..506437a2 100644 --- a/pyroscope_ffi/python/lib/src/lib.rs +++ b/pyroscope_ffi/python/lib/src/lib.rs @@ -38,8 +38,9 @@ fn signalpass() -> &'static SignalPass { #[no_mangle] pub extern "C" fn initialize_agent( - application_name: *const c_char, server_address: *const c_char, sample_rate: u32, - detect_subprocesses: bool, oncpu: bool, native: bool, gil_only: bool, tags: *const c_char, + application_name: *const c_char, server_address: *const c_char, auth_token: *const c_char, + sample_rate: u32, detect_subprocesses: bool, oncpu: bool, native: bool, gil_only: bool, + tags: *const c_char, ) -> bool { let application_name = unsafe { CStr::from_ptr(application_name) } .to_str() @@ -49,6 +50,10 @@ pub extern "C" fn initialize_agent( .to_str() .unwrap() .to_string(); + let auth_token = unsafe { CStr::from_ptr(auth_token) } + .to_str() + .unwrap() + .to_string(); let tags_string = unsafe { CStr::from_ptr(tags) } .to_str() .unwrap() @@ -66,11 +71,15 @@ pub extern "C" fn initialize_agent( let tags_ref = tags_string.as_str(); let tags = string_to_tags(tags_ref); let pyspy = pyspy_backend(pyspy_config); - let agent = PyroscopeAgent::builder(server_address, application_name) + let mut agent_builder = PyroscopeAgent::builder(server_address, application_name) .backend(pyspy) - .tags(tags) - .build() - .unwrap(); + .tags(tags); + + if auth_token != "" { + agent_builder = agent_builder.auth_token(auth_token); + } + + let agent = agent_builder.build().unwrap(); let agent_running = agent.start().unwrap(); diff --git a/pyroscope_ffi/python/pyroscope_beta/__init__.py b/pyroscope_ffi/python/pyroscope_beta/__init__.py index e5ebe3f9..a7405e82 100644 --- a/pyroscope_ffi/python/pyroscope_beta/__init__.py +++ b/pyroscope_ffi/python/pyroscope_beta/__init__.py @@ -3,14 +3,11 @@ from pyroscope_beta._native import ffi, lib from contextlib import contextmanager -Config = namedtuple('Config', ('application_name', 'server_address', -'sample_rate', 'detect_subprocesses','oncpu', 'native', 'gil_only', 'log_level')) +Config = namedtuple('Config', ('application_name', 'server_address', 'auth_token', 'sample_rate', 'detect_subprocesses','oncpu', 'native', 'gil_only', 'log_level')) -def configure(application_name=None, server_address="http://localhost:4040", -sample_rate=100, detect_subprocesses=False, oncpu=False, native=False, -gil_only=False, log_level="info", tags=None): +def configure(application_name=None, server_address="http://localhost:4040", auth_token = "", sample_rate=100, detect_subprocesses=False, oncpu=False, native=False, gil_only=False, log_level="info", tags=None): lib.initialize_agent(application_name.encode("UTF-8"), - server_address.encode("UTF-8"), sample_rate, detect_subprocesses, + server_address.encode("UTF-8"), auth_token.encode("UTF-8"), sample_rate, detect_subprocesses, oncpu, native, gil_only, tags_to_string(tags).encode("UTF-8")) From c3fb878846b02f7774299b1655a98bb5662b9767 Mon Sep 17 00:00:00 2001 From: Abid Omar Date: Wed, 22 Jun 2022 03:06:31 -0500 Subject: [PATCH 14/31] wip(python): name change --- pyroscope_ffi/python/README.md | 15 ++++++++------- .../{pyroscope_beta => pyroscope}/__init__.py | 2 +- pyroscope_ffi/python/setup.cfg | 4 ++-- pyroscope_ffi/python/setup.py | 2 +- 4 files changed, 12 insertions(+), 11 deletions(-) rename pyroscope_ffi/python/{pyroscope_beta => pyroscope}/__init__.py (97%) diff --git a/pyroscope_ffi/python/README.md b/pyroscope_ffi/python/README.md index 2583d967..c5f9d868 100644 --- a/pyroscope_ffi/python/README.md +++ b/pyroscope_ffi/python/README.md @@ -1,8 +1,9 @@ -Pyroscope Python Integration --Beta-- -===================================== +Pyroscope Python Integration +============================ -**note**: This is a beta release. It requires local compilation, might be -buggy and is frequently updated. For the initial implementation, find it [here](https://github.com/pyroscope-io/pyroscope-python). Please report any [issues](https://github.com/pyroscope-io/pyroscope-rs/issues). +**note**: This is an early release. It might require local compilation, might be +buggy and will be frequently updated. For the initial implementation, revert +to version 2.x. ## Installation @@ -39,9 +40,9 @@ make install Configuration is similar to the old package except for `application_name`: ``` -import pyroscope_beta +import pyroscope -pyroscope_beta.configure( +pyroscope.configure( application_name = "python.app", server_address = "http://localhost:4040", @@ -56,6 +57,6 @@ pyroscope_beta.configure( Tags passed to configure are global. To tag code locally, you can use: ``` -with pyroscope_beta.tag_wrapper({ "profile": "profile-1" }): +with pyroscope.tag_wrapper({ "profile": "profile-1" }): // Tagged profile ``` diff --git a/pyroscope_ffi/python/pyroscope_beta/__init__.py b/pyroscope_ffi/python/pyroscope/__init__.py similarity index 97% rename from pyroscope_ffi/python/pyroscope_beta/__init__.py rename to pyroscope_ffi/python/pyroscope/__init__.py index a7405e82..908e0773 100644 --- a/pyroscope_ffi/python/pyroscope_beta/__init__.py +++ b/pyroscope_ffi/python/pyroscope/__init__.py @@ -1,6 +1,6 @@ import threading from collections import namedtuple -from pyroscope_beta._native import ffi, lib +from pyroscope._native import ffi, lib from contextlib import contextmanager Config = namedtuple('Config', ('application_name', 'server_address', 'auth_token', 'sample_rate', 'detect_subprocesses','oncpu', 'native', 'gil_only', 'log_level')) diff --git a/pyroscope_ffi/python/setup.cfg b/pyroscope_ffi/python/setup.cfg index 4661dcf5..91243fe6 100644 --- a/pyroscope_ffi/python/setup.cfg +++ b/pyroscope_ffi/python/setup.cfg @@ -1,6 +1,6 @@ [metadata] -name = pyroscope_beta -version= 0.3.1 +name = pyroscope-io +version= 0.3.0 description = Pyroscope Python integration long_description = file: README.md long_description_content_type = text/markdown diff --git a/pyroscope_ffi/python/setup.py b/pyroscope_ffi/python/setup.py index a19f8293..aff34276 100644 --- a/pyroscope_ffi/python/setup.py +++ b/pyroscope_ffi/python/setup.py @@ -27,7 +27,7 @@ def find_dylib(): if sys.platform == "darwin": rtld_flags.append("NODELETE") - spec.add_cffi_module(module_path='pyroscope_beta._native', + spec.add_cffi_module(module_path='pyroscope._native', dylib=find_dylib, header_filename=lambda: build.find_header('pyroscope_ffi.h',in_path='include'), From ccdf167439838bd6ffd7defb1113001666d7896b Mon Sep 17 00:00:00 2001 From: Abid Omar Date: Wed, 22 Jun 2022 10:10:32 -0500 Subject: [PATCH 15/31] wip(python): bump version --- pyroscope_ffi/python/setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyroscope_ffi/python/setup.cfg b/pyroscope_ffi/python/setup.cfg index 91243fe6..fca44260 100644 --- a/pyroscope_ffi/python/setup.cfg +++ b/pyroscope_ffi/python/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = pyroscope-io -version= 0.3.0 +version= 0.7.0 description = Pyroscope Python integration long_description = file: README.md long_description_content_type = text/markdown From 0a154525aeb2ca595c2d96eafa3faf008fac9dfd Mon Sep 17 00:00:00 2001 From: Abid Omar Date: Fri, 24 Jun 2022 00:51:32 -0500 Subject: [PATCH 16/31] fix(pyspy): add read-process-memory patched crate --- pyroscope_ffi/python/lib/Cargo.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyroscope_ffi/python/lib/Cargo.toml b/pyroscope_ffi/python/lib/Cargo.toml index c89a61ef..71a5500a 100644 --- a/pyroscope_ffi/python/lib/Cargo.toml +++ b/pyroscope_ffi/python/lib/Cargo.toml @@ -11,6 +11,9 @@ crate-type = ["cdylib"] pyroscope = { version = "0.5.2" } pyroscope_pyspy = { version = "0.2.2" } +[patch.crates-io] +read-process-memory = {git = "https://github.com/omarabid/read-process-memory.git", branch = "0.1.4-fix"} + [build-dependencies] cbindgen = "0.20.0" From 353a51e7cb9d8bcfba6fa3386f220a83d22f7914 Mon Sep 17 00:00:00 2001 From: Abid Omar Date: Fri, 24 Jun 2022 21:02:51 -0500 Subject: [PATCH 17/31] wip: stash --- pyroscope_backends/pyroscope_rbspy/src/lib.rs | 1 + pyroscope_ffi/ruby/ext/rbspy/Cargo.toml | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pyroscope_backends/pyroscope_rbspy/src/lib.rs b/pyroscope_backends/pyroscope_rbspy/src/lib.rs index 24912fbd..e4c52a01 100644 --- a/pyroscope_backends/pyroscope_rbspy/src/lib.rs +++ b/pyroscope_backends/pyroscope_rbspy/src/lib.rs @@ -167,6 +167,7 @@ impl Backend for Rbspy { self.config.time_limit, self.config.with_subprocesses, None, + true, )); // Channel for Errors generated by the RubySpy Sampler diff --git a/pyroscope_ffi/ruby/ext/rbspy/Cargo.toml b/pyroscope_ffi/ruby/ext/rbspy/Cargo.toml index ad8721a1..f9f49dfa 100644 --- a/pyroscope_ffi/ruby/ext/rbspy/Cargo.toml +++ b/pyroscope_ffi/ruby/ext/rbspy/Cargo.toml @@ -8,11 +8,14 @@ name = "rbspy" crate-type = ["cdylib"] [dependencies] -pyroscope = {version = "0.5.2" } -pyroscope_rbspy = { version = "0.2" } +#pyroscope = {version = "0.5.2" } +pyroscope = { path = "../../../../" } +#pyroscope_rbspy = { version = "0.2" } +pyroscope_rbspy = { path = "../../../../pyroscope_backends/pyroscope_rbspy" } [patch.crates-io] read-process-memory = {git = "https://github.com/omarabid/read-process-memory.git", branch = "0.1.4-fix"} +rbspy = {git="https://github.com/omarabid/rbspy.git", branch="oncpu-fix"} [build-dependencies] cbindgen = "0.20.0" From c8770410447d6d9bfd51952a83f93aaef50a66d3 Mon Sep 17 00:00:00 2001 From: Abid Omar Date: Fri, 24 Jun 2022 23:28:50 -0500 Subject: [PATCH 18/31] imp(backend): add Backend extension to application_name --- src/backend/backend.rs | 11 +++++++++++ src/backend/void.rs | 5 +++++ src/pyroscope.rs | 11 ++++++++++- 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/backend/backend.rs b/src/backend/backend.rs index 7f4c98f2..2445ae2a 100644 --- a/src/backend/backend.rs +++ b/src/backend/backend.rs @@ -15,6 +15,8 @@ use super::Report; pub trait Backend: Send + Debug { /// Backend Spy Name fn spy_name(&self) -> Result; + /// Backend name extension + fn spy_extension(&self) -> Result>; /// Get backend configuration. fn sample_rate(&self) -> Result; /// Initialize the backend. @@ -102,6 +104,15 @@ impl BackendImpl { .spy_name() } + /// Return the backend extension + pub fn spy_extension(&self) -> Result> { + self.backend + .lock()? + .as_ref() + .ok_or(PyroscopeError::BackendImpl)? + .spy_extension() + } + /// Return the backend sample rate pub fn sample_rate(&self) -> Result { self.backend diff --git a/src/backend/void.rs b/src/backend/void.rs index 97d0194f..ff8d4f34 100644 --- a/src/backend/void.rs +++ b/src/backend/void.rs @@ -73,6 +73,11 @@ impl Backend for VoidBackend { Ok("void".to_string()) } + /// Return the Backend extension. + fn spy_extension(&self) -> Result> { + Ok(Some("void".to_string())) + } + /// Return the set sample rate. fn sample_rate(&self) -> Result { Ok(self.config.sample_rate) diff --git a/src/pyroscope.rs b/src/pyroscope.rs index 45f9afff..239fe0d6 100644 --- a/src/pyroscope.rs +++ b/src/pyroscope.rs @@ -262,10 +262,19 @@ impl PyroscopeAgentBuilder { /// state. While you can call this method, you should call it through the /// `PyroscopeAgent.build()` method. pub fn build(self) -> Result> { - // Set Spy Name and Sample Rate from the Backend + // Set Spy Name, Spy Extension and Sample Rate from the Backend let config = self.config.sample_rate(self.backend.sample_rate()?); let config = config.spy_name(self.backend.spy_name()?); + // use match instead of if let to avoid the need to borrow + let config = match self.backend.spy_extension()? { + Some(extension) => { + let application_name = config.application_name.clone(); + config.application_name(format!("{}.{}", application_name, extension)) + } + None => config, + }; + // Set Global Tags for (key, value) in config.tags.iter() { self.backend From e8a0274f0a8bc3d05ebadd47481dcc3dad5e8437 Mon Sep 17 00:00:00 2001 From: Abid Omar Date: Sat, 25 Jun 2022 01:35:33 -0500 Subject: [PATCH 19/31] imp(backend): add BackendConfig --- src/backend/backend.rs | 47 +++++++++++++++++++++++++++++++++++++++++- src/backend/types.rs | 6 ++++-- src/backend/void.rs | 26 ++++++++++++++++++----- 3 files changed, 71 insertions(+), 8 deletions(-) diff --git a/src/backend/backend.rs b/src/backend/backend.rs index 2445ae2a..883db24e 100644 --- a/src/backend/backend.rs +++ b/src/backend/backend.rs @@ -11,6 +11,25 @@ use std::{ use super::Report; +/// Backend Config +pub struct BackendConfig { + pub report_thread_id: bool, + pub report_thread_name: bool, + pub report_pid: bool, + pub report_oncpu: bool, +} + +impl Default for BackendConfig { + fn default() -> Self { + Self { + report_thread_id: false, + report_thread_name: false, + report_pid: false, + report_oncpu: false, + } + } +} + /// Backend Trait pub trait Backend: Send + Debug { /// Backend Spy Name @@ -29,6 +48,10 @@ pub trait Backend: Send + Debug { fn add_rule(&self, ruleset: Rule) -> Result<()>; /// Remove a report-splitting rule from the backend. fn remove_rule(&self, ruleset: Rule) -> Result<()>; + /// Set the backend's configuration. + fn set_config(&self, config: BackendConfig) -> Result<()>; + /// Get the backend's configuration. + fn get_config(&self) -> Result; } /// Marker struct for Empty BackendImpl @@ -69,7 +92,17 @@ pub struct BackendImpl { impl BackendImpl { /// Create a new BackendImpl instance - pub fn new(backend_box: Box) -> BackendImpl { + pub fn new( + backend_box: Box, config: Option, + ) -> BackendImpl { + // Set the backend's configuration if it exists. + if let Some(config) = config { + backend_box.set_config(config); + } else { + backend_box.set_config(BackendConfig::default()); + } + + // Transition to BackendUninitialized BackendImpl { backend: Arc::new(Mutex::new(Some(backend_box))), _state: std::marker::PhantomData, @@ -81,12 +114,15 @@ impl BackendImpl { /// Initialize the backend pub fn initialize(self) -> Result> { let backend = self.backend.clone(); + + // Initialize the backend backend .lock()? .as_mut() .ok_or(PyroscopeError::BackendImpl)? .initialize()?; + // Transition to BackendReady Ok(BackendImpl { backend, _state: std::marker::PhantomData, @@ -122,6 +158,15 @@ impl BackendImpl { .sample_rate() } + /// Return the backend configuration + pub fn get_config(&self) -> Result { + self.backend + .lock()? + .as_ref() + .ok_or(PyroscopeError::BackendImpl)? + .get_config() + } + /// Add a report-splitting rule to the backend pub fn add_rule(&self, rule: Rule) -> Result<()> { self.backend diff --git a/src/backend/types.rs b/src/backend/types.rs index d3c56e10..107abb8e 100644 --- a/src/backend/types.rs +++ b/src/backend/types.rs @@ -5,6 +5,8 @@ use std::{ use crate::error::Result; +use super::BackendConfig; + /// Pyroscope Tag #[derive(Debug, PartialOrd, Ord, Eq, PartialEq, Hash, Clone)] pub struct Tag { @@ -220,8 +222,8 @@ impl std::fmt::Display for StackTrace { impl StackTrace { /// Create a new StackTrace pub fn new( - pid: Option, thread_id: Option, thread_name: Option, - frames: Vec, + config: BackendConfig, pid: Option, thread_id: Option, + thread_name: Option, frames: Vec, ) -> Self { // Set StackTrace specific tags let mut metadata = Metadata::default(); diff --git a/src/backend/void.rs b/src/backend/void.rs index ff8d4f34..a4b319ce 100644 --- a/src/backend/void.rs +++ b/src/backend/void.rs @@ -1,6 +1,6 @@ use super::{ - Backend, BackendImpl, BackendUninitialized, Report, Rule, Ruleset, StackBuffer, StackFrame, - StackTrace, + Backend, BackendConfig, BackendImpl, BackendUninitialized, Report, Rule, Ruleset, StackBuffer, + StackFrame, StackTrace, }; use crate::error::Result; @@ -14,9 +14,15 @@ fn generate_stack_trace() -> Result> { None, Some(0), )]; - let stack_trace_1 = StackTrace::new(None, Some(1), None, frames.clone()); + let stack_trace_1 = StackTrace::new( + BackendConfig::default(), + None, + Some(1), + None, + frames.clone(), + ); - let stack_trace_2 = StackTrace::new(None, Some(2), None, frames); + let stack_trace_2 = StackTrace::new(BackendConfig::default(), None, Some(2), None, frames); Ok(vec![stack_trace_1, stack_trace_2]) } @@ -109,6 +115,16 @@ impl Backend for VoidBackend { Ok(reports) } + /// Set the configuration. + fn set_config(&self, config: BackendConfig) -> Result<()> { + Ok(()) + } + + /// Return the configuration. + fn get_config(&self) -> Result { + Ok(BackendConfig::default()) + } + /// Add a Rule to the Backend. fn add_rule(&self, rule: Rule) -> Result<()> { self.ruleset.add_rule(rule)?; @@ -126,5 +142,5 @@ impl Backend for VoidBackend { /// A Backend implementation for testing purposes. pub fn void_backend(config: VoidConfig) -> BackendImpl { - BackendImpl::new(Box::new(VoidBackend::new(config))) + BackendImpl::new(Box::new(VoidBackend::new(config)), None) } From 84030428520c3c04f91ccb4898feb19a46e84c6e Mon Sep 17 00:00:00 2001 From: Abid Omar Date: Sun, 26 Jun 2022 00:08:03 -0500 Subject: [PATCH 20/31] imp(pprof): implement BackendConfig for pprof-rs and add example --- examples/multi-thread-report.rs | 128 ++++++++++++++++++ .../pyroscope_pprofrs/src/lib.rs | 101 +++++++++----- src/backend/backend.rs | 3 +- src/backend/types.rs | 20 ++- src/backend/void.rs | 8 +- 5 files changed, 211 insertions(+), 49 deletions(-) create mode 100644 examples/multi-thread-report.rs diff --git a/examples/multi-thread-report.rs b/examples/multi-thread-report.rs new file mode 100644 index 00000000..6dfd77b7 --- /dev/null +++ b/examples/multi-thread-report.rs @@ -0,0 +1,128 @@ +extern crate pyroscope; + +use pyroscope::{PyroscopeAgent, Result}; +use pyroscope_pprofrs::{pprof_backend, PprofConfig}; +use std::{ + collections::hash_map::DefaultHasher, + hash::{Hash, Hasher}, + thread, +}; + +fn hash_rounds1(n: u64) -> u64 { + let hash_str = "Some string to hash"; + let mut default_hasher = DefaultHasher::new(); + + for _ in 0..n { + for _ in 0..1000 { + default_hasher.write(hash_str.as_bytes()); + } + hash_str.hash(&mut default_hasher); + } + + n +} + +fn hash_rounds2(n: u64) -> u64 { + let hash_str = "Some string to hash"; + let mut default_hasher = DefaultHasher::new(); + + for _ in 0..n { + for _ in 0..1000 { + default_hasher.write(hash_str.as_bytes()); + } + hash_str.hash(&mut default_hasher); + } + + n +} + +fn extra_rounds1(n: u64) -> u64 { + let hash_str = "Some string to hash"; + let mut default_hasher = DefaultHasher::new(); + + for _ in 0..n { + for _ in 0..1000 { + default_hasher.write(hash_str.as_bytes()); + } + hash_str.hash(&mut default_hasher); + } + + n +} + +fn extra_rounds2(n: u64) -> u64 { + let hash_str = "Some string to hash"; + let mut default_hasher = DefaultHasher::new(); + + for _ in 0..n { + for _ in 0..1000 { + default_hasher.write(hash_str.as_bytes()); + } + hash_str.hash(&mut default_hasher); + } + + n +} + +fn main() -> Result<()> { + let agent = PyroscopeAgent::builder("http://localhost:4040", "example.multithread.report") + .tags([("Host", "Rust")].to_vec()) + .backend(pprof_backend( + PprofConfig::new() + .sample_rate(100) + .report_thread_id() + .report_thread_name(), + )) + .build()?; + + // Show start time + let start = std::time::SystemTime::now() + .duration_since(std::time::UNIX_EPOCH) + .unwrap() + .as_secs(); + println!("Start Time: {}", start); + + // Start Agent + let agent_running = agent.start()?; + + let (add_tag, remove_tag) = agent_running.tag_wrapper(); + + let handle_1 = thread::Builder::new() + .name("thread-1".to_string()) + .spawn(move || { + hash_rounds1(300_000); + add_tag("extra".to_string(), "round-1".to_string()).unwrap(); + extra_rounds1(200_000); + remove_tag("extra".to_string(), "round-1".to_string()).unwrap(); + })?; + + let (add_tag, remove_tag) = agent_running.tag_wrapper(); + + let handle_2 = thread::Builder::new() + .name("thread-2".to_string()) + .spawn(move || { + add_tag("extra".to_string(), "round-2".to_string()).unwrap(); + extra_rounds2(100_000); + remove_tag("extra".to_string(), "round-2".to_string()).unwrap(); + hash_rounds2(500_000); + })?; + + // Wait for the threads to complete + handle_1.join().unwrap(); + handle_2.join().unwrap(); + + // Stop Agent + let agent_ready = agent_running.stop()?; + + // Shutdown the Agent + agent_ready.shutdown(); + + // Show program exit time + let exit = std::time::SystemTime::now() + .duration_since(std::time::UNIX_EPOCH) + .unwrap() + .as_secs(); + println!("Exit Time: {}", exit); + + Ok(()) +} diff --git a/pyroscope_backends/pyroscope_pprofrs/src/lib.rs b/pyroscope_backends/pyroscope_pprofrs/src/lib.rs index aa999316..f74cc478 100644 --- a/pyroscope_backends/pyroscope_pprofrs/src/lib.rs +++ b/pyroscope_backends/pyroscope_pprofrs/src/lib.rs @@ -1,8 +1,8 @@ use pprof::{ProfilerGuard, ProfilerGuardBuilder}; use pyroscope::{ backend::{ - Backend, BackendImpl, BackendUninitialized, Report, Rule, Ruleset, StackBuffer, StackFrame, - StackTrace, + Backend, BackendConfig, BackendImpl, BackendUninitialized, Report, Rule, Ruleset, + StackBuffer, StackFrame, StackTrace, }, error::{PyroscopeError, Result}, }; @@ -14,18 +14,23 @@ use std::{ }; pub fn pprof_backend(config: PprofConfig) -> BackendImpl { - BackendImpl::new(Box::new(Pprof::new(config))) + let backend_config = config.backend_config.clone(); + BackendImpl::new(Box::new(Pprof::new(config)), Some(backend_config)) } /// Pprof Configuration #[derive(Debug)] pub struct PprofConfig { sample_rate: u32, + backend_config: BackendConfig, } impl Default for PprofConfig { fn default() -> Self { - PprofConfig { sample_rate: 100 } + PprofConfig { + sample_rate: 100, + backend_config: BackendConfig::default(), + } } } @@ -37,7 +42,36 @@ impl PprofConfig { /// Set the sample rate pub fn sample_rate(self, sample_rate: u32) -> Self { - PprofConfig { sample_rate } + PprofConfig { + sample_rate, + ..self + } + } + + /// Tag thread id in report + pub fn report_thread_id(self) -> Self { + let backend_config = BackendConfig { + report_thread_id: true, + ..self.backend_config + }; + + PprofConfig { + backend_config, + ..self + } + } + + /// Tag thread name in report + pub fn report_thread_name(self) -> Self { + let backend_config = BackendConfig { + report_thread_name: true, + ..self.backend_config + }; + + PprofConfig { + backend_config, + ..self + } } } @@ -48,6 +82,8 @@ pub struct Pprof<'a> { buffer: Arc>, /// pprof-rs Configuration config: PprofConfig, + /// Backend Configuration + backend_config: BackendConfig, /// pprof-rs profiler Guard Builder inner_builder: Arc>>, /// pprof-rs profiler Guard @@ -65,9 +101,11 @@ impl std::fmt::Debug for Pprof<'_> { impl<'a> Pprof<'a> { /// Create a new Pprof Backend pub fn new(config: PprofConfig) -> Self { + let backend_config = config.backend_config.clone(); Pprof { buffer: Arc::new(Mutex::new(StackBuffer::default())), config, + backend_config: backend_config, inner_builder: Arc::new(Mutex::new(None)), guard: Arc::new(Mutex::new(None)), ruleset: Ruleset::default(), @@ -80,6 +118,10 @@ impl Backend for Pprof<'_> { Ok("pyroscope-rs".to_string()) } + fn spy_extension(&self) -> std::result::Result, PyroscopeError> { + Ok(Some("cpu".to_string())) + } + fn sample_rate(&self) -> Result { Ok(self.config.sample_rate) } @@ -124,6 +166,12 @@ impl Backend for Pprof<'_> { Ok(reports) } + fn set_config(&self, config: BackendConfig) {} + + fn get_config(&self) -> Result { + Ok(self.backend_config) + } + fn add_rule(&self, rule: Rule) -> Result<()> { if self.guard.lock()?.as_ref().is_some() { self.dump_report()?; @@ -157,7 +205,10 @@ impl Pprof<'_> { .build() .map_err(|e| PyroscopeError::new(e.to_string().as_str()))?; - let stack_buffer = Into::::into(Into::::into(report)); + let stack_buffer = Into::::into(Into::::into(( + report, + &self.backend_config, + ))); // apply ruleset to stack_buffer let data: HashMap = stack_buffer @@ -197,31 +248,6 @@ impl Pprof<'_> { } } -struct ReportWrapper(Report); - -impl From for Report { - fn from(report: ReportWrapper) -> Self { - report.0 - } -} - -impl From for ReportWrapper { - fn from(report: pprof::Report) -> Self { - //convert report to Report - let report_data: HashMap = report - .data - .iter() - .map(|(key, value)| { - ( - Into::::into(key.to_owned()).into(), - value.to_owned() as usize, - ) - }) - .collect(); - ReportWrapper(Report::new(report_data)) - } -} - struct StackBufferWrapper(StackBuffer); impl From for StackBuffer { @@ -230,15 +256,16 @@ impl From for StackBuffer { } } -impl From for StackBufferWrapper { - fn from(report: pprof::Report) -> Self { +impl From<(pprof::Report, &BackendConfig)> for StackBufferWrapper { + fn from(arg: (pprof::Report, &BackendConfig)) -> Self { + let (report, config) = arg; //convert report to stackbuffer let buffer_data: HashMap = report .data .iter() .map(|(key, value)| { ( - Into::::into(key.to_owned()).into(), + Into::::into((key.to_owned(), config)).into(), value.to_owned() as usize, ) }) @@ -255,9 +282,11 @@ impl From for StackTrace { } } -impl From for StackTraceWrapper { - fn from(frames: pprof::Frames) -> Self { +impl From<(pprof::Frames, &BackendConfig)> for StackTraceWrapper { + fn from(arg: (pprof::Frames, &BackendConfig)) -> Self { + let (frames, config) = arg; StackTraceWrapper(StackTrace::new( + config, None, Some(frames.thread_id), Some(frames.thread_name), diff --git a/src/backend/backend.rs b/src/backend/backend.rs index 883db24e..cd9dada3 100644 --- a/src/backend/backend.rs +++ b/src/backend/backend.rs @@ -12,6 +12,7 @@ use std::{ use super::Report; /// Backend Config +#[derive(Debug, Copy, Clone)] pub struct BackendConfig { pub report_thread_id: bool, pub report_thread_name: bool, @@ -49,7 +50,7 @@ pub trait Backend: Send + Debug { /// Remove a report-splitting rule from the backend. fn remove_rule(&self, ruleset: Rule) -> Result<()>; /// Set the backend's configuration. - fn set_config(&self, config: BackendConfig) -> Result<()>; + fn set_config(&self, config: BackendConfig); /// Get the backend's configuration. fn get_config(&self) -> Result; } diff --git a/src/backend/types.rs b/src/backend/types.rs index 107abb8e..fad94164 100644 --- a/src/backend/types.rs +++ b/src/backend/types.rs @@ -222,22 +222,28 @@ impl std::fmt::Display for StackTrace { impl StackTrace { /// Create a new StackTrace pub fn new( - config: BackendConfig, pid: Option, thread_id: Option, + config: &BackendConfig, pid: Option, thread_id: Option, thread_name: Option, frames: Vec, ) -> Self { // Set StackTrace specific tags let mut metadata = Metadata::default(); - if let Some(pid) = pid { - metadata.add_tag(Tag::new("pid".to_owned(), pid.to_string())); + if config.report_pid { + if let Some(pid) = pid { + metadata.add_tag(Tag::new("pid".to_owned(), pid.to_string())); + } } - if let Some(thread_id) = thread_id { - metadata.add_tag(Tag::new("thread_id".to_owned(), thread_id.to_string())); + if config.report_thread_id { + if let Some(thread_id) = thread_id { + metadata.add_tag(Tag::new("thread_id".to_owned(), thread_id.to_string())); + } } - if let Some(thread_name) = thread_name.clone() { - metadata.add_tag(Tag::new("thread_name".to_owned(), thread_name)); + if config.report_thread_name { + if let Some(thread_name) = thread_name.clone() { + metadata.add_tag(Tag::new("thread_name".to_owned(), thread_name)); + } } Self { diff --git a/src/backend/void.rs b/src/backend/void.rs index a4b319ce..cb917a1f 100644 --- a/src/backend/void.rs +++ b/src/backend/void.rs @@ -15,14 +15,14 @@ fn generate_stack_trace() -> Result> { Some(0), )]; let stack_trace_1 = StackTrace::new( - BackendConfig::default(), + &BackendConfig::default(), None, Some(1), None, frames.clone(), ); - let stack_trace_2 = StackTrace::new(BackendConfig::default(), None, Some(2), None, frames); + let stack_trace_2 = StackTrace::new(&BackendConfig::default(), None, Some(2), None, frames); Ok(vec![stack_trace_1, stack_trace_2]) } @@ -116,9 +116,7 @@ impl Backend for VoidBackend { } /// Set the configuration. - fn set_config(&self, config: BackendConfig) -> Result<()> { - Ok(()) - } + fn set_config(&self, _config: BackendConfig) {} /// Return the configuration. fn get_config(&self) -> Result { From 0bbbbb3f20522c359a06e621b319a4870daa576e Mon Sep 17 00:00:00 2001 From: Abid Omar Date: Sun, 26 Jun 2022 22:06:28 -0500 Subject: [PATCH 21/31] imp(rbspy): add BackendConfig support --- pyroscope_backends/pyroscope_rbspy/src/lib.rs | 75 +++++++++++++++++-- 1 file changed, 69 insertions(+), 6 deletions(-) diff --git a/pyroscope_backends/pyroscope_rbspy/src/lib.rs b/pyroscope_backends/pyroscope_rbspy/src/lib.rs index 24912fbd..8299df4e 100644 --- a/pyroscope_backends/pyroscope_rbspy/src/lib.rs +++ b/pyroscope_backends/pyroscope_rbspy/src/lib.rs @@ -1,7 +1,7 @@ use pyroscope::{ backend::{ - Backend, BackendImpl, BackendUninitialized, Report, Rule, Ruleset, StackBuffer, StackFrame, - StackTrace, + Backend, BackendConfig, BackendImpl, BackendUninitialized, Report, Rule, Ruleset, + StackBuffer, StackFrame, StackTrace, }, error::{PyroscopeError, Result}, }; @@ -17,7 +17,11 @@ use std::{ /// Short-hand function for creating a new Rbspy backend. pub fn rbspy_backend(config: RbspyConfig) -> BackendImpl { - BackendImpl::new(Box::new(Rbspy::new(config))) + // Clone BackendConfig to pass to the backend object. + let backend_config = config.backend_config.clone(); + + // Create a new backend object. + BackendImpl::new(Box::new(Rbspy::new(config)), Some(backend_config)) } /// Rbspy Configuration @@ -27,6 +31,8 @@ pub struct RbspyConfig { pid: Option, /// Sampling rate sample_rate: u32, + /// Backend Config + backend_config: BackendConfig, /// Lock Process while sampling lock_process: bool, /// Profiling duration. None for infinite. @@ -40,6 +46,7 @@ impl Default for RbspyConfig { RbspyConfig { pid: None, sample_rate: 100, + backend_config: BackendConfig::default(), lock_process: false, time_limit: None, with_subprocesses: false, @@ -64,6 +71,45 @@ impl RbspyConfig { } } + /// Tag thread id in report + pub fn report_pid(self) -> Self { + let backend_config = BackendConfig { + report_pid: true, + ..self.backend_config + }; + + RbspyConfig { + backend_config, + ..self + } + } + + /// Tag thread id in report + pub fn report_thread_id(self) -> Self { + let backend_config = BackendConfig { + report_thread_id: true, + ..self.backend_config + }; + + RbspyConfig { + backend_config, + ..self + } + } + + /// Tag thread name in report + pub fn report_thread_name(self) -> Self { + let backend_config = BackendConfig { + report_thread_name: true, + ..self.backend_config + }; + + RbspyConfig { + backend_config, + ..self + } + } + /// Set the lock process flag pub fn lock_process(self, lock_process: bool) -> Self { RbspyConfig { @@ -133,11 +179,22 @@ impl Backend for Rbspy { Ok("rbspy".to_string()) } + /// Return the backend extension + fn spy_extension(&self) -> Result> { + Ok(Some("cpu".to_string())) + } + /// Return the sample rate fn sample_rate(&self) -> Result { Ok(self.config.sample_rate) } + fn set_config(&self, config: BackendConfig) {} + + fn get_config(&self) -> Result { + Ok(self.config.backend_config) + } + /// Add a rule to the ruleset fn add_rule(&self, rule: Rule) -> Result<()> { self.ruleset.add_rule(rule)?; @@ -206,11 +263,14 @@ impl Backend for Rbspy { // ruleset reference let ruleset = self.ruleset.clone(); + let backend_config = self.config.backend_config.clone(); + let _: JoinHandle> = std::thread::spawn(move || { // Iterate over the StackTrace while let Ok(stack_trace) = stack_receiver.recv() { // convert StackTrace - let own_trace: StackTrace = Into::::into(stack_trace).into(); + let own_trace: StackTrace = + Into::::into((stack_trace, &backend_config)).into(); let stacktrace = own_trace + &ruleset; @@ -276,9 +336,12 @@ impl From for StackTrace { } } -impl From for StackTraceWrapper { - fn from(trace: rbspy::StackTrace) -> Self { +impl From<(rbspy::StackTrace, &BackendConfig)> for StackTraceWrapper { + fn from(arg: (rbspy::StackTrace, &BackendConfig)) -> Self { + let (trace, config) = arg; + StackTraceWrapper(StackTrace::new( + config, trace.pid.map(|pid| pid as u32), trace.thread_id.map(|id| id as u64), None, From ad34c2c3c7bad8e070068514123b2efc5bc86473 Mon Sep 17 00:00:00 2001 From: Abid Omar Date: Sun, 26 Jun 2022 22:09:37 -0500 Subject: [PATCH 22/31] imp(pyspy): add spy extension --- pyroscope_backends/pyroscope_pyspy/src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pyroscope_backends/pyroscope_pyspy/src/lib.rs b/pyroscope_backends/pyroscope_pyspy/src/lib.rs index 29487924..fa8bed28 100644 --- a/pyroscope_backends/pyroscope_pyspy/src/lib.rs +++ b/pyroscope_backends/pyroscope_pyspy/src/lib.rs @@ -162,6 +162,11 @@ impl Backend for Pyspy { Ok("pyspy".to_string()) } + /// Return the extension of the backend. + fn spy_extension(&self) -> Result> { + Ok(Some("cpu".to_string())) + } + /// Return the sample rate. fn sample_rate(&self) -> Result { Ok(self.config.sample_rate) From 24b29dff94e0d7868c5ac2baa4eec4b8d478c8e4 Mon Sep 17 00:00:00 2001 From: Abid Omar Date: Mon, 27 Jun 2022 00:49:03 -0500 Subject: [PATCH 23/31] refactor(rbspy): remove report_thread_name --- Cargo.toml | 6 ++++++ pyroscope_backends/pyroscope_rbspy/src/lib.rs | 13 ------------- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 01370421..36d765ef 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -65,6 +65,12 @@ pyroscope_pprofrs = { path = "pyroscope_backends/pyroscope_pprofrs" } pyroscope_pyspy = { path = "pyroscope_backends/pyroscope_pyspy" } pyroscope_rbspy = { path = "pyroscope_backends/pyroscope_rbspy" } +[patch.crates-io] +rbspy = {git = "https://github.com/omarabid/rbspy.git", branch="oncpu-fix"} +read-process-memory = {git = "https://github.com/omarabid/read-process-memory.git", branch = "0.1.4-fix"} + + + [profile.dev] opt-level=0 debug = true diff --git a/pyroscope_backends/pyroscope_rbspy/src/lib.rs b/pyroscope_backends/pyroscope_rbspy/src/lib.rs index b1178dfb..9c41bf14 100644 --- a/pyroscope_backends/pyroscope_rbspy/src/lib.rs +++ b/pyroscope_backends/pyroscope_rbspy/src/lib.rs @@ -97,19 +97,6 @@ impl RbspyConfig { } } - /// Tag thread name in report - pub fn report_thread_name(self) -> Self { - let backend_config = BackendConfig { - report_thread_name: true, - ..self.backend_config - }; - - RbspyConfig { - backend_config, - ..self - } - } - /// Set the lock process flag pub fn lock_process(self, lock_process: bool) -> Self { RbspyConfig { From cc2f0906c3c5e711e34bb56f741476a7886e51fe Mon Sep 17 00:00:00 2001 From: Abid Omar Date: Mon, 27 Jun 2022 01:20:53 -0500 Subject: [PATCH 24/31] imp(pyspy): add BackendConfig support --- pyroscope_backends/pyroscope_pyspy/Cargo.toml | 4 + pyroscope_backends/pyroscope_pyspy/src/lib.rs | 75 ++++++++++++++++--- 2 files changed, 69 insertions(+), 10 deletions(-) diff --git a/pyroscope_backends/pyroscope_pyspy/Cargo.toml b/pyroscope_backends/pyroscope_pyspy/Cargo.toml index 6a166217..4c6a67ac 100644 --- a/pyroscope_backends/pyroscope_pyspy/Cargo.toml +++ b/pyroscope_backends/pyroscope_pyspy/Cargo.toml @@ -19,6 +19,10 @@ pyroscope = { version = "0.5.2", path = "../../" } thiserror ="1.0" log = "0.4" +[patch.crates-io] +read-process-memory = {git = "https://github.com/omarabid/read-process-memory.git", branch = "0.1.4-fix"} + + [profile.dev] opt-level=0 debug = true diff --git a/pyroscope_backends/pyroscope_pyspy/src/lib.rs b/pyroscope_backends/pyroscope_pyspy/src/lib.rs index fa8bed28..7d2174da 100644 --- a/pyroscope_backends/pyroscope_pyspy/src/lib.rs +++ b/pyroscope_backends/pyroscope_pyspy/src/lib.rs @@ -1,8 +1,8 @@ use py_spy::{config::Config, sampler::Sampler}; use pyroscope::{ backend::{ - Backend, BackendImpl, BackendUninitialized, Report, Rule, Ruleset, StackBuffer, StackFrame, - StackTrace, + Backend, BackendConfig, BackendImpl, BackendUninitialized, Report, Rule, Ruleset, + StackBuffer, StackFrame, StackTrace, }, error::{PyroscopeError, Result}, }; @@ -19,7 +19,10 @@ const LOG_TAG: &str = "Pyroscope::Pyspy"; /// Short-hand function for creating a new Pyspy backend. pub fn pyspy_backend(config: PyspyConfig) -> BackendImpl { - BackendImpl::new(Box::new(Pyspy::new(config))) + // Clone BackendConfig to pass to the backend object. + let backend_config = config.backend_config.clone(); + + BackendImpl::new(Box::new(Pyspy::new(config)), Some(backend_config)) } /// Pyspy Configuration @@ -29,6 +32,8 @@ pub struct PyspyConfig { pid: Option, /// Sampling rate sample_rate: u32, + /// Backend Config + backend_config: BackendConfig, /// Lock Process while sampling lock_process: py_spy::config::LockingStrategy, /// Profiling duration (None for infinite) @@ -48,6 +53,7 @@ impl Default for PyspyConfig { PyspyConfig { pid: Some(0), sample_rate: 100, + backend_config: BackendConfig::default(), lock_process: py_spy::config::LockingStrategy::NonBlocking, time_limit: None, with_subprocesses: false, @@ -75,6 +81,45 @@ impl PyspyConfig { } } + /// Tag thread id in report + pub fn report_pid(self) -> Self { + let backend_config = BackendConfig { + report_pid: true, + ..self.backend_config + }; + + PyspyConfig { + backend_config, + ..self + } + } + + /// Tag thread id in report + pub fn report_thread_id(self) -> Self { + let backend_config = BackendConfig { + report_thread_id: true, + ..self.backend_config + }; + + PyspyConfig { + backend_config, + ..self + } + } + + /// Tag thread name in report + pub fn report_thread_name(self) -> Self { + let backend_config = BackendConfig { + report_thread_name: true, + ..self.backend_config + }; + + PyspyConfig { + backend_config, + ..self + } + } + /// Set the lock process flag pub fn lock_process(self, lock_process: bool) -> Self { PyspyConfig { @@ -172,6 +217,12 @@ impl Backend for Pyspy { Ok(self.config.sample_rate) } + fn set_config(&self, config: BackendConfig) {} + + fn get_config(&self) -> Result { + Ok(self.config.backend_config) + } + /// Add a rule to the ruleset. fn add_rule(&self, rule: Rule) -> Result<()> { self.ruleset.lock()?.add_rule(rule)?; @@ -229,6 +280,8 @@ impl Backend for Pyspy { // create a new ruleset reference let ruleset = self.ruleset.clone(); + let backend_config = self.config.backend_config.clone(); + self.sampler_thread = Some(std::thread::spawn(move || { // Get PID let pid = config @@ -257,7 +310,7 @@ impl Backend for Pyspy { // Convert py-spy trace to a Pyroscope trace let own_trace: StackTrace = - Into::::into(trace.clone()).into(); + Into::::into((trace.clone(), &backend_config)).into(); // apply ruleset let stacktrace = own_trace + &ruleset.lock()?.clone(); @@ -335,13 +388,15 @@ impl From for StackTrace { } } -impl From for StackTraceWrapper { - fn from(trace: py_spy::StackTrace) -> Self { +impl From<(py_spy::StackTrace, &BackendConfig)> for StackTraceWrapper { + fn from(arg: (py_spy::StackTrace, &BackendConfig)) -> Self { + let (stack_trace, config) = arg; let stacktrace = StackTrace::new( - Some(trace.pid as u32), - Some(trace.thread_id as u64), - trace.thread_name.clone(), - trace + config, + Some(stack_trace.pid as u32), + Some(stack_trace.thread_id as u64), + stack_trace.thread_name.clone(), + stack_trace .frames .iter() .map(|frame| Into::::into(frame.clone()).into()) From cf399920d075a67d97489e4728886dfd0bad0a6f Mon Sep 17 00:00:00 2001 From: Abid Omar Date: Mon, 27 Jun 2022 10:15:17 -0500 Subject: [PATCH 25/31] imp(pprof): update pprof-rs version --- pyroscope_backends/pyroscope_pprofrs/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyroscope_backends/pyroscope_pprofrs/Cargo.toml b/pyroscope_backends/pyroscope_pprofrs/Cargo.toml index 0fdc39ee..e788cac6 100644 --- a/pyroscope_backends/pyroscope_pprofrs/Cargo.toml +++ b/pyroscope_backends/pyroscope_pprofrs/Cargo.toml @@ -15,7 +15,7 @@ readme = "README.md" [dependencies] -pprof = "0.9.1" +pprof = "0.10.0" pyroscope = {version = "0.5.2", path = "../../" } thiserror ="1.0" From 1aef9aa8c19dde15dc0f59575c2b9863775a0f66 Mon Sep 17 00:00:00 2001 From: Abid Omar Date: Mon, 27 Jun 2022 10:49:20 -0500 Subject: [PATCH 26/31] refactor(rbspy): use forked upstream crate --- pyroscope_backends/pyroscope_rbspy/Cargo.toml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pyroscope_backends/pyroscope_rbspy/Cargo.toml b/pyroscope_backends/pyroscope_rbspy/Cargo.toml index 71d5afab..2ba36e1e 100644 --- a/pyroscope_backends/pyroscope_rbspy/Cargo.toml +++ b/pyroscope_backends/pyroscope_rbspy/Cargo.toml @@ -14,18 +14,15 @@ repository = "https://github.com/pyroscope-io/pyroscope-rs" readme = "README.md" [dependencies] -rbspy = "0.12.1" +rbspy= {package = "rbspy-oncpu", version = "0.12.1"} pyroscope = { version = "0.5.2", path = "../../" } thiserror ="1.0" log = "0.4" anyhow = "1.0.56" [patch.crates-io] -rbspy = {git = "https://github.com/omarabid/rbspy.git", branch="oncpu-fix"} read-process-memory = {git = "https://github.com/omarabid/read-process-memory.git", branch = "0.1.4-fix"} - - [profile.dev] opt-level=0 debug = true From 84d21dfad116577b7881c89ba35305765ebc00e1 Mon Sep 17 00:00:00 2001 From: Abid Omar Date: Mon, 27 Jun 2022 10:56:29 -0500 Subject: [PATCH 27/31] chore(docs): add CONTRIBUTING guideline --- CONTRIBUTING.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..7fe8930f --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,11 @@ +# Contributing to Pyroscope + +Thank you for your interest in contributing to Pyroscope! We welcome all people who want to contribute in a healthy and constructive manner within our community. To help us create a safe and positive community experience for all, we require all participants to adhere to the [Code of Conduct](CODE_OF_CONDUCT.md). + +This document is a guide to help you through the process of contributing to Pyroscope. + +## Where do I start + +* Set up your [development environment](https://pyroscope.io/docs/developer-guide). +* Read the [style guides](https://pyroscope.io/docs/style-guide) we use. +* Check out the list of [good first issues](https://github.com/pyroscope-io/pyroscope/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22). From cea870a11f9699f2c821dec1d0592983b1a5b126 Mon Sep 17 00:00:00 2001 From: Abid Omar Date: Mon, 27 Jun 2022 11:00:27 -0500 Subject: [PATCH 28/31] chore(docs): add PR template --- .github/PULL_REQUEST_TEMPLATE.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..0757758c --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,9 @@ + From 53ad88057d83686031fe8aa6f67db6f4beaba1d6 Mon Sep 17 00:00:00 2001 From: Abid Omar Date: Mon, 27 Jun 2022 11:01:28 -0500 Subject: [PATCH 29/31] chore(ops): add dependabot config --- .github/dependabot.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..ddbbb867 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,17 @@ +version: 2 +updates: +- package-ecosystem: cargo + directory: "/" + schedule: + interval: weekly + time: "07:00" + open-pull-requests-limit: 10 + labels: + - C-dependencies +- package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: weekly + open-pull-requests-limit: 10 + labels: + - "C-dependencies" From fdef71bd17a7959c7f5cdc8959823d827a5f8dd3 Mon Sep 17 00:00:00 2001 From: Abid Omar Date: Mon, 27 Jun 2022 11:08:17 -0500 Subject: [PATCH 30/31] refactor(cargo): remove patch section from main Cargo.toml file --- Cargo.toml | 6 ------ pyroscope_backends/pyroscope_pyspy/Cargo.toml | 1 - 2 files changed, 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 36d765ef..01370421 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -65,12 +65,6 @@ pyroscope_pprofrs = { path = "pyroscope_backends/pyroscope_pprofrs" } pyroscope_pyspy = { path = "pyroscope_backends/pyroscope_pyspy" } pyroscope_rbspy = { path = "pyroscope_backends/pyroscope_rbspy" } -[patch.crates-io] -rbspy = {git = "https://github.com/omarabid/rbspy.git", branch="oncpu-fix"} -read-process-memory = {git = "https://github.com/omarabid/read-process-memory.git", branch = "0.1.4-fix"} - - - [profile.dev] opt-level=0 debug = true diff --git a/pyroscope_backends/pyroscope_pyspy/Cargo.toml b/pyroscope_backends/pyroscope_pyspy/Cargo.toml index 4c6a67ac..c9230775 100644 --- a/pyroscope_backends/pyroscope_pyspy/Cargo.toml +++ b/pyroscope_backends/pyroscope_pyspy/Cargo.toml @@ -22,7 +22,6 @@ log = "0.4" [patch.crates-io] read-process-memory = {git = "https://github.com/omarabid/read-process-memory.git", branch = "0.1.4-fix"} - [profile.dev] opt-level=0 debug = true From eaff8c0d5eb7af2a9e167c618fc107c91f9b1f97 Mon Sep 17 00:00:00 2001 From: Abid Omar Date: Mon, 27 Jun 2022 11:21:31 -0500 Subject: [PATCH 31/31] chore(release): lib-0.5.3 release --- CHANGELOG.md | 9 +++++++++ Cargo.toml | 2 +- README.md | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b5767a1..3d95e21f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +# v0.5.3 +## New features +- Add BackendConfig to make reporting of pid, thread_id and thread_name + optional. +- Backends can add a suffix to the "application_name" + +## Bug Fixes +- **main**: fixed an obsecure bug when counting stacktraces ([Abid Omar](https://github.com/pyroscope-io/pyroscope-rs/commit/bdecaa13aeae3ce7d4c3d97f88bdd104ec35e7c5)) + # v0.5.2 ## New features - Authentication Token support diff --git a/Cargo.toml b/Cargo.toml index 01370421..a9b4c573 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ Pyroscope Profiler Agent for continuous profiling of Rust, Python and Ruby appli """ keywords = ["pyroscope", "profiler", "profiling", "pprof"] authors = ["Abid Omar "] -version = "0.5.2" +version = "0.5.3" edition = "2021" license = "Apache-2.0" homepage = "https://pyroscope.io/docs/rust" diff --git a/README.md b/README.md index cc89a23d..6ad6da1e 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Add this to your `Cargo.toml`: ```toml [dependencies] -pyroscope = "0.5.2" +pyroscope = "0.5.3" pyroscope_pprofrs = "0.2" ```