Commit Graph

9 Commits

Author SHA1 Message Date
Vadim Yanitskiy be5e838dbb Use internal <osmocom/core/talloc.h> everywhere
Change-Id: If40e1eefcfa88a2b376becfe057836acdd3a1cc2
2022-04-27 12:42:15 +00:00
Oliver Smith 04bfb7165b treewide: remove FSF address
Remove the paragraph about writing to the Free Software Foundation's
mailing address. The FSF has changed addresses in the past, and may do
so again. In 2021 this is not useful, let's rather have a bit less
boilerplate at the start of source files.

Change-Id: I5050285e75cf120407a1d883e99b3c4bcae8ffd7
2021-12-14 12:44:03 +01:00
Vadim Yanitskiy e6987e96b6 VTY: enable talloc introspection for OTC_GLOBAL
Change-Id: I831722174ecbac7f2d53f2427ba7e2615fa28c8a
2021-12-07 19:46:14 +03:00
Vadim Yanitskiy 8e7c49649e vty: use install_lib_element() and install_lib_element_ve()
See https://lists.osmocom.org/pipermail/openbsc/2020-October/013278.html.

Change-Id: Ic541126ffd4975daf87199abfafb465e2055e44f
Related: SYS#4937
2020-10-06 00:22:22 +07:00
Vadim Yanitskiy 3d81147dea vty/talloc_ctx_vty.c: use REG_NOSUB flag of regcomp()
We don't need to know position of matches: just yes or no.
This change would save some computation power.

Change-Id: Id55ffe64cc1a35dd83f61dbb0f9828aa676696f9
2019-04-11 00:24:55 +00:00
Vadim Yanitskiy bd6968a1ca vty/talloc_ctx_vty.c: allocate walk_cb_params on stack, not heap
There is no need to allocate struct 'walk_cb_params' dynamically.

Change-Id: I96f25f1ddb36b19b12055deaeeb6f58e59180e72
2019-04-11 00:24:55 +00:00
Harald Welte 408a90093b talloc_ctx_vty: Fix help strings (missing \n at end of line)
This was causing build failures in applications using this library
feature:

Documentation error (missing docs):
<command id='show talloc-context (application|all) (full|brief|DEPTH) tree ADDRESS'>
        <param name='ADDRESS' doc='(null)' />

Documentation error (missing docs):
<command id='show talloc-context (application|all) (full|brief|DEPTH) filter REGEXP'>
        <param name='REGEXP' doc='(null)' />

Documentation error (missing docs):
<command id='show talloc-context (application|all) (full|brief|DEPTH) tree ADDRESS'>
        <param name='ADDRESS' doc='(null)' />

Documentation error (missing docs):
<command id='show talloc-context (application|all) (full|brief|DEPTH) filter REGEXP'>
        <param name='REGEXP' doc='(null)' />

Change-Id: I785c852e3313d20eade79746a7cd485d2d5908ea
2018-02-14 00:53:22 +00:00
Harald Welte e08da97570 Fix/Update copyright notices; Add SPDX annotation
Let's fix some erroneous/accidential references to wrong license,
update copyright information where applicable and introduce a
SPDX-License-Identifier to all files.

Change-Id: I39af26c6aaaf5c926966391f6565fc5936be21af
2017-11-13 01:35:12 +09:00
Vadim Yanitskiy 463deef8c2 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 <context> <depth> [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
2017-09-27 11:02:19 +00:00