aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-02-17 00:04:43 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-02-17 19:34:28 +0100
commit4096d12ee006ab5aab4f6c62f89011b5c240778e (patch)
tree0b632f1782602c16187e149676103a36830c9619
parent5cd45e16ef243b8f22edf2ec4b6794a235817578 (diff)
bsc: Print the talloc allocation report on SIGUSR1
-rw-r--r--src/bsc.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/bsc.c b/src/bsc.c
index 50745b0..ce0b9c3 100644
--- a/src/bsc.c
+++ b/src/bsc.c
@@ -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);
}
+