Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
API: Allow sending a
SIGUSR1
signal for requesting reports on demand
The tool currently only produces reports on a clean exit from the analyzed program, which is not always achievable (daemons, programs crashing, etc.), and also using `hu_report()` as an API, which might also not be doable in all scenarios (e.g. no source code for the analyzed program). An "on demand" report requested from "the outside world" has proven very useful in some debugging scenarios. Having a signal that could be sent to the analyzed program (e.g. sent from a shell) and have the `heapusage` tool catch it and produce a report in response is very helpful. This way, install a signal handler for the `SIGUSR1` and `SIGUSR2` user defined signals and, for `SIGUSR1` trigger a report using `log_summary_safe()`, just like the `hu_report()` API does. Leave the `SIGUSR2` available for other future requests. Update `README.md` with this new usage possibility. Signed-off-by: Ricardo Silva <[email protected]>
- Loading branch information