Skip to content

Commit b80063a

Browse files
chore(rs): update pprof dependency, use framehop (#245)
1 parent 15726e6 commit b80063a

File tree

6 files changed

+127
-63
lines changed

6 files changed

+127
-63
lines changed

Cargo.lock

Lines changed: 115 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/basic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
extern crate pyroscope;
22

3-
use pyroscope::{PyroscopeAgent, Result};
3+
use pyroscope::{Result};
44
use pyroscope_pprofrs::{pprof_backend, PprofConfig};
55
use std::hash::{Hash, Hasher};
66
use pyroscope::backend::BackendConfig;

pyroscope_backends/pyroscope_pprofrs/.gitignore

Lines changed: 0 additions & 5 deletions
This file was deleted.

pyroscope_backends/pyroscope_pprofrs/CHANGELOG.md

Lines changed: 0 additions & 17 deletions
This file was deleted.

pyroscope_backends/pyroscope_pprofrs/Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,14 @@ readme = "README.md"
1515

1616

1717
[dependencies]
18-
pprof2 = "0.13"
18+
pprof = { version = "0.15", features = ["framehop", "framehop-unwinder"] }
1919
pyroscope = { version = "0.5.7", path = "../..", default-features = false }
2020
log = "0.4"
2121

2222
[features]
2323
default = ["pyroscope/default"]
24-
frame-pointer = ["pprof2/frame-pointer"]
2524

2625
[target.aarch64-apple-darwin.dependencies]
27-
pprof2 = { version = "0.13", features = ["frame-pointer"] }
26+
pprof = { version = "0.15", features = ["framehop", "framehop-unwinder"] }
2827

2928

pyroscope_backends/pyroscope_pprofrs/src/lib.rs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use pprof2::{ProfilerGuard, ProfilerGuardBuilder};
1+
use pprof::{ProfilerGuard, ProfilerGuardBuilder};
22
use pyroscope::{
33
backend::{
44
Backend, BackendConfig, BackendImpl, BackendUninitialized, Report, Rule, Ruleset,
@@ -82,10 +82,9 @@ impl Backend for Pprof<'_> {
8282
}
8383

8484
fn initialize(&mut self) -> Result<()> {
85-
// Construct a ProfilerGuardBuilder
86-
let profiler = ProfilerGuardBuilder::default().frequency(self.config.sample_rate as i32);
85+
let profiler = ProfilerGuardBuilder::default()
86+
.frequency(self.config.sample_rate as i32);
8787

88-
// Set inner_builder field
8988
*self.inner_builder.lock()? = Some(profiler);
9089

9190
*self.guard.lock()? = Some(
@@ -199,8 +198,8 @@ impl From<StackBufferWrapper> for StackBuffer {
199198
}
200199
}
201200

202-
impl From<(pprof2::Report, &BackendConfig)> for StackBufferWrapper {
203-
fn from(arg: (pprof2::Report, &BackendConfig)) -> Self {
201+
impl From<(pprof::Report, &BackendConfig)> for StackBufferWrapper {
202+
fn from(arg: (pprof::Report, &BackendConfig)) -> Self {
204203
let (report, config) = arg;
205204
//convert report to stackbuffer
206205
let buffer_data: HashMap<StackTrace, usize> = report
@@ -225,8 +224,8 @@ impl From<StackTraceWrapper> for StackTrace {
225224
}
226225
}
227226

228-
impl From<(pprof2::Frames, &BackendConfig)> for StackTraceWrapper {
229-
fn from(arg: (pprof2::Frames, &BackendConfig)) -> Self {
227+
impl From<(pprof::Frames, &BackendConfig)> for StackTraceWrapper {
228+
fn from(arg: (pprof::Frames, &BackendConfig)) -> Self {
230229
let (frames, config) = arg;
231230
StackTraceWrapper(StackTrace::new(
232231
config,
@@ -251,8 +250,8 @@ impl From<StackFrameWrapper> for StackFrame {
251250
}
252251
}
253252

254-
impl From<pprof2::Symbol> for StackFrameWrapper {
255-
fn from(symbol: pprof2::Symbol) -> Self {
253+
impl From<pprof::Symbol> for StackFrameWrapper {
254+
fn from(symbol: pprof::Symbol) -> Self {
256255
StackFrameWrapper(StackFrame::new(
257256
None,
258257
Some(symbol.name()),

0 commit comments

Comments
 (0)