[MERGED] osmo-trx[master]: osmo-trx: Set up talloc ctx

2018-02-22 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: osmo-trx: Set up talloc ctx
..


osmo-trx: Set up talloc ctx

Change-Id: I67f1980fc615ab74371cbe1c4f83e987381299bc
---
M Transceiver52M/osmo-trx.cpp
1 file changed, 14 insertions(+), 0 deletions(-)

Approvals:
  Vadim Yanitskiy: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/Transceiver52M/osmo-trx.cpp b/Transceiver52M/osmo-trx.cpp
index 0562dcd..069d195 100644
--- a/Transceiver52M/osmo-trx.cpp
+++ b/Transceiver52M/osmo-trx.cpp
@@ -37,7 +37,9 @@
 #include 
 
 extern "C" {
+#include 
 #include 
+#include 
 #include "convolve.h"
 #include "convert.h"
 }
@@ -89,6 +91,8 @@
 };
 
 volatile bool gshutdown = false;
+
+static void *tall_trx_ctx;
 
 /* Setup configuration values
  * Don't query the existence of the Log.Level because it's a
@@ -247,6 +251,14 @@
case SIGTERM:
fprintf(stdout, "shutting down\n");
gshutdown = true;
+   break;
+   case SIGABRT:
+   case SIGUSR1:
+   talloc_report(tall_trx_ctx, stderr);
+   talloc_report_full(tall_trx_ctx, stderr);
+   break;
+   case SIGUSR2:
+   talloc_report_full(tall_trx_ctx, stderr);
break;
default:
break;
@@ -486,6 +498,8 @@
RadioDevice::InterfaceType iface = RadioDevice::NORMAL;
struct trx_config config;
 
+   tall_trx_ctx = talloc_named_const(NULL, 0, "OsmoTRX");
+   msgb_talloc_ctx_init(tall_trx_ctx, 0);
setup_signal_handlers();
 
 #ifdef HAVE_SSE3

-- 
To view, visit https://gerrit.osmocom.org/6647
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I67f1980fc615ab74371cbe1c4f83e987381299bc
Gerrit-PatchSet: 5
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 


osmo-trx[master]: osmo-trx: Set up talloc ctx

2018-02-22 Thread Harald Welte

Patch Set 5: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/6647
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I67f1980fc615ab74371cbe1c4f83e987381299bc
Gerrit-PatchSet: 5
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-HasComments: No


osmo-trx[master]: osmo-trx: Set up talloc ctx

2018-02-21 Thread Vadim Yanitskiy

Patch Set 1: Code-Review+1

-- 
To view, visit https://gerrit.osmocom.org/6647
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I67f1980fc615ab74371cbe1c4f83e987381299bc
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-HasComments: No


[PATCH] osmo-trx[master]: osmo-trx: Set up talloc ctx

2018-02-21 Thread Pau Espin Pedrol

Review at  https://gerrit.osmocom.org/6647

osmo-trx: Set up talloc ctx

Change-Id: I67f1980fc615ab74371cbe1c4f83e987381299bc
---
M Transceiver52M/osmo-trx.cpp
1 file changed, 14 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/47/6647/1

diff --git a/Transceiver52M/osmo-trx.cpp b/Transceiver52M/osmo-trx.cpp
index 07fa5fe..40269e1 100644
--- a/Transceiver52M/osmo-trx.cpp
+++ b/Transceiver52M/osmo-trx.cpp
@@ -37,7 +37,9 @@
 #include 
 
 extern "C" {
+#include 
 #include 
+#include 
 #include "convolve.h"
 #include "convert.h"
 }
@@ -89,6 +91,8 @@
 };
 
 volatile bool gshutdown = false;
+
+static void *tall_trx_ctx;
 
 /* Setup configuration values
  * Don't query the existence of the Log.Level because it's a
@@ -247,6 +251,14 @@
case SIGTERM:
fprintf(stdout, "SIGINT received, shutting down\n");
gshutdown = true;
+   break;
+   case SIGABRT:
+   case SIGUSR1:
+   talloc_report(tall_trx_ctx, stderr);
+   talloc_report_full(tall_trx_ctx, stderr);
+   break;
+   case SIGUSR2:
+   talloc_report_full(tall_trx_ctx, stderr);
break;
default:
break;
@@ -486,6 +498,8 @@
RadioDevice::InterfaceType iface = RadioDevice::NORMAL;
struct trx_config config;
 
+   tall_trx_ctx = talloc_named_const(NULL, 0, "OsmoTRX");
+   msgb_talloc_ctx_init(tall_trx_ctx, 0);
setup_signal_handlers();
 
 #ifdef HAVE_SSE3

-- 
To view, visit https://gerrit.osmocom.org/6647
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I67f1980fc615ab74371cbe1c4f83e987381299bc
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol