Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: tikv/pprof-rs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: GreptimeTeam/pprof-rs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
  • 2 commits
  • 5 files changed
  • 2 contributors

Commits on Jan 31, 2024

  1. fix: use T aligned pointer in TempFdArray

    Signed-off-by: Shanin Roman <shanin1000@yandex.ru>
    Erigara committed Jan 31, 2024
    Copy the full SHA
    5f624c2 View commit details

Commits on Nov 5, 2024

  1. fix: example test

    discord9 committed Nov 5, 2024
    Copy the full SHA
    1bd1e21 View commit details
Showing with 232 additions and 90 deletions.
  1. +115 −30 Cargo.lock
  2. +5 −1 Cargo.toml
  3. +4 −0 src/addr_validate.rs
  4. +63 −22 src/collector.rs
  5. +45 −37 src/report.rs
145 changes: 115 additions & 30 deletions Cargo.lock

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

6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ prost-codec = ["prost", "prost-derive", "prost-build", "sha2", "_protobuf"]
protobuf-codec = ["protobuf", "protobuf-codegen-pure", "_protobuf"]

[dependencies]
backtrace = { version = "0.3" }
backtrace = { version = "0.3.74" }
once_cell = "1.9"
libc = "^0.2.66"
log = "0.4"
@@ -58,6 +58,10 @@ protobuf-codegen-pure = { version = "2.0", optional = true }
name = "flamegraph"
required-features = ["flamegraph"]

[[example]]
name = "backtrace_while_sampling"
required-features = ["flamegraph"]

[[example]]
name = "profile_proto_with_prost"
required-features = ["protobuf", "prost-codec"]
4 changes: 4 additions & 0 deletions src/addr_validate.rs
Original file line number Diff line number Diff line change
@@ -69,6 +69,10 @@ fn open_pipe() -> nix::Result<()> {
// `write()` will return an error the error number should be `EFAULT` in most
// cases, but we regard all errors (except EINTR) as a failure of validation
pub fn validate(addr: *const libc::c_void) -> bool {
// if the address is null, we regard it as invalid since `slice::from_raw_parts` now checks for null
if addr.is_null() {
return false;
}
const CHECK_LENGTH: usize = 2 * size_of::<*const libc::c_void>() / size_of::<u8>();

// read data in the pipe
Loading