Change in libosmocore[master]: stop printing group description in vty_out_rate_ctr_group_fmt()

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/.

Stefan Sperling gerrit-no-reply at lists.osmocom.org
Mon Oct 29 13:48:47 UTC 2018


Stefan Sperling has submitted this change and it was merged. ( https://gerrit.osmocom.org/11467 )

Change subject: stop printing group description in vty_out_rate_ctr_group_fmt()
......................................................................

stop printing group description in vty_out_rate_ctr_group_fmt()

When vty_out_rate_ctr_group_fmt() prints the description of a
counter group, it assumes this description should appear at
the beginning of a line. However, the caller might be printing
counters in an indented context. So just let the caller worry
about printing the group title if necessary (there is currently
only one known caller, which is updated in this commit).

Note that printing of the group title was an undocumented feature.

Change-Id: I2c55cb54e8b7a7c8c6cf72f22287083767ed0201
Related: OS#2660
---
M src/vty/stats_vty.c
M src/vty/utils.c
2 files changed, 1 insertion(+), 3 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/vty/stats_vty.c b/src/vty/stats_vty.c
index 5ded7a4..62153f3 100644
--- a/src/vty/stats_vty.c
+++ b/src/vty/stats_vty.c
@@ -533,6 +533,7 @@
 static int rate_ctr_group_handler(struct rate_ctr_group *ctrg, void *sctx_)
 {
 	struct vty *vty = sctx_;
+	vty_out(vty, "%s:%s", ctrg->desc->group_description, VTY_NEWLINE);
 	vty_out_rate_ctr_group_fmt(vty, "%25n: %10c (%S/s %M/m %H/h %D/d) %d", ctrg);
 	return 0;
 }
diff --git a/src/vty/utils.c b/src/vty/utils.c
index 0d663c6..0358d9b 100644
--- a/src/vty/utils.c
+++ b/src/vty/utils.c
@@ -214,9 +214,6 @@
 				struct rate_ctr_group *ctrg)
 {
 	struct vty_out_context vctx = {vty, fmt};
-
-	vty_out(vty, "%s:%s", ctrg->desc->group_description, VTY_NEWLINE);
-
 	rate_ctr_for_each_counter(ctrg, rate_ctr_handler_fmt, &vctx);
 }
 

-- 
To view, visit https://gerrit.osmocom.org/11467
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I2c55cb54e8b7a7c8c6cf72f22287083767ed0201
Gerrit-Change-Number: 11467
Gerrit-PatchSet: 2
Gerrit-Owner: Stefan Sperling <ssperling at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Stefan Sperling <ssperling at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181029/34d734ce/attachment.htm>


More information about the gerrit-log mailing list