Skip to content

Conversation

@nsavoire
Copy link
Collaborator

What does this PR do?

Add crash tracker and reporter to ddprof.

Crash tracker installs signal handlers to catch crashes in the profiler.
Upon crash, it forks and execs another instance of ddprof passing it --report-crash argument as well as crashed thread tid as --pid and then waits for this other process to finish before re-raising the signal.

Other ddprof process does a ptrace attach on its parent, unwind crashed thread and reports the crash through libdatadog crash tracker.

@nsavoire nsavoire marked this pull request as ready for review May 29, 2024 13:39
nsavoire added 3 commits May 29, 2024 14:09
* Make process_symbolization available
* Remove `pprof` argurment (deduce address format from symbolizer)
* Avoid passing a null pointer for symbolizer in unit tests
@nsavoire nsavoire force-pushed the nsavoire/crash_reporter branch from 41caed9 to 17c1fc0 Compare May 29, 2024 14:09
@nsavoire nsavoire force-pushed the nsavoire/crash_reporter branch 2 times, most recently from a830cbb to cf6b57c Compare May 29, 2024 19:33
nsavoire added 2 commits May 29, 2024 19:38
Crash tracker installs signal handlers to catch crashes.
Upon crash, it forks and execs another instance of ddprof passing it
`--report-crash` argument as well as crashed thread tid as `--pid` and
then waits for this other process to finish before re-raising the signal.

Other ddprof process does a ptrace attach on its parent, unwind crashed
thread and reports the crash through libdatadog crash tracker.
* Add `--report-crash` option
* Install crash tracker upon profiler startup
@nsavoire nsavoire force-pushed the nsavoire/crash_reporter branch from cf6b57c to cd0d3df Compare May 29, 2024 19:38
@pr-commenter
Copy link

pr-commenter bot commented May 29, 2024

Benchmark results for collatz

Parameters

Baseline Candidate
config baseline candidate
profiler-version ddprof 0.17.1+8518e4fe.34733158 ddprof 0.17.1+cd0d3df9.35395387

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 1 metrics, 0 unstable metrics.

See unchanged results
scenario Δ mean execution_time
scenario:ddprof -S bench-collatz --preset cpu_only collatz_runner.sh same

@pr-commenter
Copy link

pr-commenter bot commented May 29, 2024

Benchmark results for BadBoggleSolver_run

Parameters

Baseline Candidate
config baseline candidate
profiler-version ddprof 0.17.1+8518e4fe.34733158 ddprof 0.17.1+cd0d3df9.35395387

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 1 metrics, 0 unstable metrics.

See unchanged results
scenario Δ mean execution_time
scenario:ddprof -S bench-bad-boggle-solver BadBoggleSolver_run work 1000 same

Copy link
Collaborator

@r1viollet r1viollet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
Looking forward to trying this out

int regno, void *arg) {
(void)dwfl;
return memory_read(addr, result, regno, arg);
auto *us = static_cast<UnwindState *>(arg);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why would we not have 2 separate unwinding configurations ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants