Hi Neels,
If you submitted a patch for it I would probably +vote it.
Not yet.
I guess it would actually be a whole bunch of patches, a common part in libosmocore and using it in each osmo* program?
Probably, it would be a whole bunch of patches for osmo* programs only. I was wondering about modifying libosmovty to enable a new VTY command in all projects, like Harald did in osmo-fsm implementation. But in case of FSM, all state machines are being registered before use, so libosmovty "knows" about them.
What is impossible in case of talloc contexts right now. Of course, we can write a new function and register every root talloc context using it. What about that?
Regarding to the commands to add, I think
show ctx all - Show list of all registered talloc contexts. show ctx NAME - Find specified context and call talloc_report_full.
With best regards, Vadim Yanitskiy.
2017-06-01 4:34 GMT+07:00 Neels Hofmeyr nhofmeyr@sysmocom.de:
re "what do you guys think about having a special VTY command to get a talloc report?"
If you submitted a patch for it I would probably +vote it. I guess it would actually be a whole bunch of patches, a common part in libosmocore and using it in each osmo* program?
~N
Great news,
Of course, we can write a new function and register every root talloc context using it. What about that?
I just found, that talloc context may be specified in vty_app_info structure:
/*! Information an application registers with the VTY */ struct vty_app_info { /*! \brief name of the application */ const char *name; /*! \brief version string of the application */ const char *version; /*! \brief copyright string of the application */ const char *copyright; /*! \brief \ref talloc context */ void *tall_ctx; // ... }
But almost all osmo* applications don't set this pointer.
With best regards, Vadim Yanitskiy.
Hi Vadim,
On Thu, Jun 01, 2017 at 02:48:17PM +0700, Vadim Yanitskiy wrote:
Great news,
Of course, we can write a new function and register every root talloc context using it. What about that?
I just found, that talloc context may be specified in vty_app_info structure:
I think in general it would be good if applications have to either register their "root" talloc contexts with libosmocore, or even have to obtain their root talloc contexts through a wrapper.
This way we could then make sure to iterate all of the talloc context from within generic code in libosmovty.