Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: migrate to pprof2 crate #183

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 66 additions & 49 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions pyroscope_backends/pyroscope_pprofrs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ readme = "README.md"


[dependencies]
pprof = "0.12"
pyroscope = { version = "0.5.7", path = "../../", default-features = false }
pprof2 = "0.13"
pyroscope = { version = "0.5.7", path = "../..", default-features = false }
thiserror ="1.0"
log = "0.4"

[features]
default = ["pyroscope/default"]
frame-pointer = ["pprof/frame-pointer"]
frame-pointer = ["pprof2/frame-pointer"]

[target.aarch64-apple-darwin.dependencies]
pprof = { version = "0.12", features = ["frame-pointer"] }
pprof2 = { version = "0.13", features = ["frame-pointer"] }


14 changes: 7 additions & 7 deletions pyroscope_backends/pyroscope_pprofrs/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use pprof::{ProfilerGuard, ProfilerGuardBuilder};
use pprof2::{ProfilerGuard, ProfilerGuardBuilder};
use pyroscope::{
backend::{
Backend, BackendConfig, BackendImpl, BackendUninitialized, Report, Rule, Ruleset,
Expand Down Expand Up @@ -259,8 +259,8 @@ impl From<StackBufferWrapper> for StackBuffer {
}
}

impl From<(pprof::Report, &BackendConfig)> for StackBufferWrapper {
fn from(arg: (pprof::Report, &BackendConfig)) -> Self {
impl From<(pprof2::Report, &BackendConfig)> for StackBufferWrapper {
fn from(arg: (pprof2::Report, &BackendConfig)) -> Self {
let (report, config) = arg;
//convert report to stackbuffer
let buffer_data: HashMap<StackTrace, usize> = report
Expand All @@ -285,8 +285,8 @@ impl From<StackTraceWrapper> for StackTrace {
}
}

impl From<(pprof::Frames, &BackendConfig)> for StackTraceWrapper {
fn from(arg: (pprof::Frames, &BackendConfig)) -> Self {
impl From<(pprof2::Frames, &BackendConfig)> for StackTraceWrapper {
fn from(arg: (pprof2::Frames, &BackendConfig)) -> Self {
let (frames, config) = arg;
StackTraceWrapper(StackTrace::new(
config,
Expand All @@ -311,8 +311,8 @@ impl From<StackFrameWrapper> for StackFrame {
}
}

impl From<pprof::Symbol> for StackFrameWrapper {
fn from(symbol: pprof::Symbol) -> Self {
impl From<pprof2::Symbol> for StackFrameWrapper {
fn from(symbol: pprof2::Symbol) -> Self {
StackFrameWrapper(StackFrame::new(
None,
Some(symbol.name()),
Expand Down
Loading