Skip to content

Commit e50df5d

Browse files
committed
fix: renaming
1 parent a5be341 commit e50df5d

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

README.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

33
`pprof` is a cpu profiler that can be easily integrated into a rust program.
44

5-
[![Actions Status](https://github.com/tikv/pprof-rs/workflows/build/badge.svg)](https://github.com/tikv/pprof-rs/actions)
6-
[![Crates.io](https://img.shields.io/crates/v/pprof.svg)](https://crates.io/crates/pprof)
7-
[![Dependency Status](https://deps.rs/repo/github/tikv/pprof-rs/status.svg)](https://deps.rs/repo/github/tikv/pprof-rs)
8-
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Ftikv%2Fpprof-rs.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Ftikv%2Fpprof-rs?ref=badge_shield)
5+
[![Actions Status](https://github.com/EmbarkStudios/pprof-rs/workflows/build/badge.svg)](https://github.com/EmbarkStudios/pprof-rs/actions)
6+
[![Crates.io](https://img.shields.io/crates/v/pprof.svg)](https://crates.io/crates/pprof2)
7+
[![Dependency Status](https://deps.rs/repo/github/EmbarkStudios/pprof-rs/status.svg)](https://deps.rs/repo/github/EmbarkStudios/pprof-rs)
8+
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FEmbarkStudios%2Fpprof-rs.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2FEmbarkStudios%2Fpprof-rs?ref=badge_shield)
99

1010
## Usage
1111

1212
First, get a guard to start profiling. Profiling will continue until this guard was dropped.
1313

1414
```rust
15-
let guard = pprof::ProfilerGuardBuilder::default().frequency(1000).blocklist(&["libc", "libgcc", "pthread", "vdso"]).build().unwrap();
15+
let guard = pprof2::ProfilerGuardBuilder::default().frequency(1000).blocklist(&["libc", "libgcc", "pthread", "vdso"]).build().unwrap();
1616
```
1717

1818
During the profiling time, you can get a report with the guard.
@@ -26,8 +26,8 @@ if let Ok(report) = guard.report().build() {
2626
`Debug` was implemented for `Report`. It will print a human-readable stack counter report. Here is an example:
2727

2828
```
29-
FRAME: backtrace::backtrace::trace::h3e91a3123a3049a5 -> FRAME: pprof::profiler::perf_signal_handler::h7b995c4ab2e66493 -> FRAME: Unknown -> FRAME: prime_number::is_prime_number::h70653a2633b88023 -> FRAME: prime_number::main::h47f1058543990c8b -> FRAME: std::rt::lang_start::{{closure}}::h4262e250f8024b06 -> FRAME: std::rt::lang_start_internal::{{closure}}::h812f70926ebbddd0 -> std::panicking::try::do_call::h3210e2ce6a68897b -> FRAME: __rust_maybe_catch_panic -> FRAME: std::panicking::try::h28c2e2ec1c3871ce -> std::panic::catch_unwind::h05e542185e35aabf -> std::rt::lang_start_internal::hd7efcfd33686f472 -> FRAME: main -> FRAME: __libc_start_main -> FRAME: _start -> FRAME: Unknown -> THREAD: prime_number 1217
30-
FRAME: backtrace::backtrace::trace::h3e91a3123a3049a5 -> FRAME: pprof::profiler::perf_signal_handler::h7b995c4ab2e66493 -> FRAME: Unknown -> FRAME: alloc::alloc::box_free::h82cea48ed688e081 -> FRAME: prime_number::main::h47f1058543990c8b -> FRAME: std::rt::lang_start::{{closure}}::h4262e250f8024b06 -> FRAME: std::rt::lang_start_internal::{{closure}}::h812f70926ebbddd0 -> std::panicking::try::do_call::h3210e2ce6a68897b -> FRAME: __rust_maybe_catch_panic -> FRAME: std::panicking::try::h28c2e2ec1c3871ce -> std::panic::catch_unwind::h05e542185e35aabf -> std::rt::lang_start_internal::hd7efcfd33686f472 -> FRAME: main -> FRAME: __libc_start_main -> FRAME: _start -> FRAME: Unknown -> THREAD: prime_number 1
29+
FRAME: backtrace::backtrace::trace::h3e91a3123a3049a5 -> FRAME: pprof2::profiler::perf_signal_handler::h7b995c4ab2e66493 -> FRAME: Unknown -> FRAME: prime_number::is_prime_number::h70653a2633b88023 -> FRAME: prime_number::main::h47f1058543990c8b -> FRAME: std::rt::lang_start::{{closure}}::h4262e250f8024b06 -> FRAME: std::rt::lang_start_internal::{{closure}}::h812f70926ebbddd0 -> std::panicking::try::do_call::h3210e2ce6a68897b -> FRAME: __rust_maybe_catch_panic -> FRAME: std::panicking::try::h28c2e2ec1c3871ce -> std::panic::catch_unwind::h05e542185e35aabf -> std::rt::lang_start_internal::hd7efcfd33686f472 -> FRAME: main -> FRAME: __libc_start_main -> FRAME: _start -> FRAME: Unknown -> THREAD: prime_number 1217
30+
FRAME: backtrace::backtrace::trace::h3e91a3123a3049a5 -> FRAME: pprof2::profiler::perf_signal_handler::h7b995c4ab2e66493 -> FRAME: Unknown -> FRAME: alloc::alloc::box_free::h82cea48ed688e081 -> FRAME: prime_number::main::h47f1058543990c8b -> FRAME: std::rt::lang_start::{{closure}}::h4262e250f8024b06 -> FRAME: std::rt::lang_start_internal::{{closure}}::h812f70926ebbddd0 -> std::panicking::try::do_call::h3210e2ce6a68897b -> FRAME: __rust_maybe_catch_panic -> FRAME: std::panicking::try::h28c2e2ec1c3871ce -> std::panic::catch_unwind::h05e542185e35aabf -> std::rt::lang_start_internal::hd7efcfd33686f472 -> FRAME: main -> FRAME: __libc_start_main -> FRAME: _start -> FRAME: Unknown -> THREAD: prime_number 1
3131
FRAME: backtrace::backtrace::trace::h3e91a3123a3049a5 -> FRAME: pprof::profiler::perf_signal_handler::h7b995c4ab2e66493 -> FRAME: Unknown -> FRAME: prime_number::main::h47f1058543990c8b -> FRAME: std::rt::lang_start::{{closure}}::h4262e250f8024b06 -> FRAME: std::rt::lang_start_internal::{{closure}}::h812f70926ebbddd0 -> std::panicking::try::do_call::h3210e2ce6a68897b -> FRAME: __rust_maybe_catch_panic -> FRAME: std::panicking::try::h28c2e2ec1c3871ce -> std::panic::catch_unwind::h05e542185e35aabf -> std::rt::lang_start_internal::hd7efcfd33686f472 -> FRAME: main -> FRAME: __libc_start_main -> FRAME: _start -> FRAME: Unknown -> THREAD: prime_number 1
3232
```
3333

@@ -43,7 +43,7 @@ FRAME: backtrace::backtrace::trace::h3e91a3123a3049a5 -> FRAME: pprof::profiler:
4343
## Flamegraph
4444

4545
```toml
46-
pprof = { version = "0.13", features = ["flamegraph"] }
46+
pprof2 = { version = "0.13", features = ["flamegraph"] }
4747
```
4848

4949
If `flamegraph` feature is enabled, you can generate flamegraph from the report. `Report` struct has a method `flamegraph` which can generate flamegraph and write it into a `Write`.
@@ -60,7 +60,7 @@ Additionally, custom flamegraph options can be specified.
6060
```rust
6161
if let Ok(report) = guard.report().build() {
6262
let file = File::create("flamegraph.svg").unwrap();
63-
let mut options = pprof::flamegraph::Options::default();
63+
let mut options = pprof2::flamegraph::Options::default();
6464
options.image_width = Some(2500);
6565
report.flamegraph_with_options(file, &mut options).unwrap();
6666
};
@@ -77,7 +77,7 @@ Before the report was generated, `frame_post_processor` was provided as an inter
7777
For example:
7878

7979
```rust
80-
fn frames_post_processor() -> impl Fn(&mut pprof::Frames) {
80+
fn frames_post_processor() -> impl Fn(&mut pprof2::Frames) {
8181
let thread_rename = [
8282
(Regex::new(r"^grpc-server-\d*$").unwrap(), "grpc-server"),
8383
(Regex::new(r"^cop-high\d*$").unwrap(), "cop-high"),
@@ -151,7 +151,7 @@ Then `pprof` will generate a svg file according to the profile.
151151
With `criterion` feature enabled, a criterion custom profiler is provided in `pprof-rs`.
152152

153153
```rust
154-
use pprof::criterion::{PProfProfiler, Output};
154+
use pprof2::criterion::{PProfProfiler, Output};
155155

156156
criterion_group!{
157157
name = benches;
@@ -218,7 +218,7 @@ Unfortunately, there is no 100% robust stack tracing method. [Some related resea
218218
This can be resolved by adding a blocklist:
219219

220220
```rust
221-
let guard = pprof::ProfilerGuardBuilder::default().frequency(1000).blocklist(&["libc", "libgcc", "pthread", "vdso"]).build().unwrap();
221+
let guard = pprof2::ProfilerGuardBuilder::default().frequency(1000).blocklist(&["libc", "libgcc", "pthread", "vdso"]).build().unwrap();
222222
```
223223

224224
The `vdso` should also be added to the blocklist, because in some distribution (e.g. ubuntu 18.04), the dwarf information in vdso is incorrect.

src/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
//! A sample usage is:
1010
//!
1111
//! ```rust
12-
//! let guard = pprof::ProfilerGuard::new(100).unwrap();
12+
//! let guard = pprof2::ProfilerGuard::new(100).unwrap();
1313
//! ```
1414
//!
1515
//! Then you can read report from the guard:
1616
//!
1717
//! ```rust
18-
//! # let guard = pprof::ProfilerGuard::new(100).unwrap();
18+
//! # let guard = pprof2::ProfilerGuard::new(100).unwrap();
1919
//!if let Ok(report) = guard.report().build() {
2020
//! println!("report: {:?}", &report);
2121
//!};
@@ -24,7 +24,7 @@
2424
//! More configuration can be passed through `ProfilerGuardBuilder`:
2525
//!
2626
//! ```rust
27-
//! let guard = pprof::ProfilerGuardBuilder::default().frequency(1000).blocklist(&["libc", "libgcc", "pthread", "vdso"]).build().unwrap();
27+
//! let guard = pprof2::ProfilerGuardBuilder::default().frequency(1000).blocklist(&["libc", "libgcc", "pthread", "vdso"]).build().unwrap();
2828
//! ```
2929
//!
3030
//! The frequency means the sampler frequency, and the `blocklist` means the
@@ -37,7 +37,7 @@
3737
//! so it's also suggested to skip it.
3838
//!
3939
//! You can find more details in
40-
//! [README.md](https://github.com/tikv/pprof-rs/blob/master/README.md)
40+
//! [README.md](https://github.com/EmbarkStudios/pprof-rs/blob/master/README.md)
4141
4242
/// Define the MAX supported stack depth. TODO: make this variable mutable.
4343
pub const MAX_DEPTH: usize = 128;

src/report.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ impl<'a> ReportBuilder<'a> {
151151
/// This will generate Report in a human-readable format:
152152
///
153153
/// ```shell
154-
/// FRAME: pprof::profiler::perf_signal_handler::h7b995c4ab2e66493 -> FRAME: Unknown -> FRAME: {func1} ->
154+
/// FRAME: pprof2::profiler::perf_signal_handler::h7b995c4ab2e66493 -> FRAME: Unknown -> FRAME: {func1} ->
155155
/// FRAME: {func2} -> FRAME: {func3} -> THREAD: {thread_name} {count}
156156
/// ```
157157
impl Debug for Report {

0 commit comments

Comments
 (0)