osmo-hlr: Add talloc context introspection via VTY

This requires libosmocore with Change-Id
I43fc42880b22294d83c565ae600ac65e4f38b30d or later.

Change-Id: Ibc2c333b83f85fa69a364e3e342f12f50dbc2f70
diff --git a/src/hlr.c b/src/hlr.c
index 168e203..f3a6864 100644
--- a/src/hlr.c
+++ b/src/hlr.c
@@ -439,6 +439,7 @@
 
 	hlr_ctx = talloc_named_const(NULL, 1, "OsmoHLR");
 	msgb_talloc_ctx_init(hlr_ctx, 0);
+	vty_info.tall_ctx = hlr_ctx;
 
 	g_hlr = talloc_zero(hlr_ctx, struct hlr);
 
diff --git a/src/hlr_vty.c b/src/hlr_vty.c
index 202f7f7..c10829d 100644
--- a/src/hlr_vty.c
+++ b/src/hlr_vty.c
@@ -24,6 +24,7 @@
 #include <osmocom/vty/vty.h>
 #include <osmocom/vty/command.h>
 #include <osmocom/vty/logging.h>
+#include <osmocom/vty/misc.h>
 
 #include "hlr_vty.h"
 #include "hlr_vty_subscr.h"
@@ -126,6 +127,7 @@
 	g_hlr = hlr;
 
 	logging_vty_add_cmds(cat);
+	osmo_talloc_vty_add_cmds();
 
 	install_element(CONFIG_NODE, &cfg_hlr_cmd);
 	install_node(&hlr_node, config_write_hlr);
diff --git a/tests/test_nodes.vty b/tests/test_nodes.vty
index 69472e6..5afa144 100644
--- a/tests/test_nodes.vty
+++ b/tests/test_nodes.vty
@@ -13,6 +13,9 @@
 ...
   show logging vty
   show alarms
+  show talloc-context (application|all) (full|brief|DEPTH)
+  show talloc-context (application|all) (full|brief|DEPTH) tree ADDRESS
+  show talloc-context (application|all) (full|brief|DEPTH) filter REGEXP
   subscriber (imsi|msisdn|id) IDENT show
 
 OsmoHLR> enable