tikv / pprof-rs

A Rust CPU profiler implemented with the help of backtrace-rs
Apache License 2.0
1.26k stars 94 forks source link

Correct required-features for profile_proto example #206

Closed hi-rustin closed 1 year ago

hi-rustin commented 1 year ago

Before:

➜  pprof-rs git:(master) ✗ cargo run --example profile_proto --features="protobuf"                            
    Blocking waiting for file lock on build directory
   Compiling pprof v0.11.1 (/Users/hi-rustin/vsc/pprof-rs)
error[E0432]: unresolved import `pprof::protos`
 --> examples/profile_proto.rs:3:12
  |
3 | use pprof::protos::Message;
  |            ^^^^^^ could not find `protos` in `pprof`

error[E0599]: no method named `pprof` found for struct `pprof::Report` in the current scope
   --> examples/profile_proto.rs:104:30
    |
104 |         let profile = report.pprof().unwrap();
    |                              ^^^^^ method not found in `pprof::Report`

Some errors have detailed explanations: E0432, E0599.
For more information about an error, try `rustc --explain E0432`.
error: could not compile `pprof` due to 2 previous errors

After:

➜  pprof-rs git:(master) ✗ cargo run --example profile_proto                                                  
error: target `profile_proto` in package `pprof` requires the features: `protobuf`, `prost-codec`
Consider enabling them by passing, e.g., `--features="protobuf prost-codec"