aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/bsc_hack.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@netfilter.org>2009-12-24 10:51:56 +0100
committerHarald Welte <laforge@netfilter.org>2009-12-24 10:51:56 +0100
commit3cefa9aaa0832b9cf99f3599f7cc1c0499e78cbb (patch)
tree9660ee8150e74ecfe13b0939148874d0f89a5c1d /openbsc/src/bsc_hack.c
parent28f811c87f939fc9d3523f85baa2b62a2629796d (diff)
vty: sub-divide talloc contexts and include them in talloc report
The VTY code makes so many allocations that a full report is simply too long to provide any useful information. So we sub-divide it in multiple contexts, and report only one level deep at SIGURS1. We also introduce SIGUSR2 for the full detailed VTY report.
Diffstat (limited to 'openbsc/src/bsc_hack.c')
-rw-r--r--openbsc/src/bsc_hack.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/openbsc/src/bsc_hack.c b/openbsc/src/bsc_hack.c
index 8792cc36c..3122fae9c 100644
--- a/openbsc/src/bsc_hack.c
+++ b/openbsc/src/bsc_hack.c
@@ -138,6 +138,7 @@ static void handle_options(int argc, char** argv)
}
}
+extern void *tall_vty_ctx;
static void signal_handler(int signal)
{
fprintf(stdout, "signal %u received\n", signal);
@@ -153,8 +154,12 @@ static void signal_handler(int signal)
/* in case of abort, we want to obtain a talloc report
* and then return to the caller, who will abort the process */
case SIGUSR1:
+ talloc_report(tall_vty_ctx, stderr);
talloc_report_full(tall_bsc_ctx, stderr);
break;
+ case SIGUSR2:
+ talloc_report_full(tall_vty_ctx, stderr);
+ break;
default:
break;
}
@@ -219,6 +224,7 @@ int main(int argc, char **argv)
signal(SIGINT, &signal_handler);
signal(SIGABRT, &signal_handler);
signal(SIGUSR1, &signal_handler);
+ signal(SIGUSR2, &signal_handler);
signal(SIGPIPE, SIG_IGN);
while (1) {