control: Dump flight recorder on signal SIGUSR1
Add a SIGUSR1 handler to dump the flight recorder.
It uses the sdventplus sd_event_add_defer wrapper to do the dump when
the code gets back to the event loop so it doesn't spend the time doing
it inside the signal handler itself.
The flight recorder can now be dumped with:
kill -USR1 $(pidof phosphor-fan-control)
or
systemctl kill -s USR1 phosphor-fan-control@0
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I46e45cb7a5e42ea4d217f63a8e14b6ef02ed8c22
3 files changed