9
0
Fork 0

bsc: Print the talloc allocation report on SIGUSR1

This commit is contained in:
Holger Hans Peter Freyther 2011-02-17 00:04:43 +01:00
parent 5cd45e16ef
commit 4096d12ee0
1 changed files with 9 additions and 0 deletions

View File

@ -26,6 +26,7 @@
#include <mtp_pcap.h>
#include <osmocore/talloc.h>
#include <osmocom/vty/vty.h>
#include <sys/types.h>
#include <sys/stat.h>
@ -109,6 +110,12 @@ out:
pthread_mutex_unlock(&exit_mutex);
}
static void sigusr1()
{
talloc_report(tall_vty_ctx, stderr);
talloc_report_full(bsc, stderr);
}
static void sigusr2()
{
struct msc_connection *msc;
@ -181,5 +188,7 @@ void handle_options(int argc, char **argv)
signal(SIGPIPE, SIG_IGN);
signal(SIGINT, sigint);
signal(SIGUSR1, sigusr1);
signal(SIGUSR2, sigusr2);
}