From 463deef8c209dd7eb023ac70bf41fa9893ad35ed Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Sat, 23 Sep 2017 19:30:07 +0330 Subject: VTY: implement talloc context introspection command This change introduces a new command, which could be used to inspect the application's talloc context directly from VTY. To enable this feature, an application need to provide it's context via the 'vty_app_info' struct, and register the VTY command by calling the osmo_talloc_vty_add_cmds(). The new command is a sub-command of 'show': show talloc-context [filter] Currently the following contexts may be inspected: - application - a context provided by an application; - null - all contexts, if NULL-context tracking is enabled. A report depth is defined by the next parameter, and could be: - full - full tree report, as the talloc_report_full() does; - brief - brief tree report, as the talloc_report() does; - DEPTH - user defined maximal report depth. Also, there are two optional report filters: - regexp - print only contexts, matching a regular expression; - tree - print a specific context, pointed by specified address. The command output is formatted the same way as in case of calling the talloc_report() or talloc_report_full(). Change-Id: I43fc42880b22294d83c565ae600ac65e4f38b30d --- include/osmocom/vty/misc.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/osmocom/vty') diff --git a/include/osmocom/vty/misc.h b/include/osmocom/vty/misc.h index 545955c4..335558d8 100644 --- a/include/osmocom/vty/misc.h +++ b/include/osmocom/vty/misc.h @@ -28,6 +28,7 @@ struct osmo_fsm_inst; void vty_out_fsm(struct vty *vty, struct osmo_fsm *fsm); void vty_out_fsm_inst(struct vty *vty, struct osmo_fsm_inst *fsmi); void osmo_fsm_vty_add_cmds(void); +void osmo_talloc_vty_add_cmds(void); int osmo_vty_write_config_file(const char *filename); -- cgit v1.2.3