libosmocore[master]: VTY: implement talloc context introspection command

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Mon Sep 25 13:32:50 UTC 2017


Patch Set 1:

(5 comments)

Hi Maxim,

Thanks for review!

> Also, example output of 'sh talloc-context ..'
> in commit message would be nice.

The output is the same as in case of calling the talloc_report()
or talloc_report_full(). Not sure, should we add an output example.

https://gerrit.osmocom.org/#/c/4018/1/src/vty/talloc_ctx_vty.c
File src/vty/talloc_ctx_vty.c:

Line 48: 
> I think it's big enough to warrant doxygen header with explanation of what 
Would be done in the next revision.


Line 50: 	int max_depth, int is_ref, void *data)
> If it's 'int' than it means that it could be negative. Please either explai
Because a negative value could be used to get a report with unlimited length. This is actually how does the talloc_report_full() work.


Line 63: 		if (p->filter == WALK_FILTER_REGEXP) {
> So you explicitly check for 2 possible enum values and implicitly for 3rd o
Ok, I'll do that. Thanks!


Line 139: 	params = talloc_zero(tall_vty_ctx, struct walk_cb_params);
> Will this allocation be included in the report too?
No, because an independent talloc context is used as parent.


Line 229: 	talloc_free(params);
> The params are always alloced/freed in the same function. Do we have to use
I think that exactly dynamic allocation is better here, because:

  - No need to keep the memory allocated until / after the command is used;
  - No need to set default values for all params (thanks to talloc);


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I43fc42880b22294d83c565ae600ac65e4f38b30d
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-HasComments: Yes



More information about the gerrit-log mailing list