Attention is currently required from: laforge, pespin.
neels has posted comments on this change by neels. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37882?usp=email )
Change subject: ctrl, hnbgw: access rate counter groups by given ID instead of index
......................................................................
Patch Set 4:
(1 comment)
Patchset:
PS2:
> I see this was resolved but there was no fedbac? I also couldn't see ant changes in the code?
you are missing the use of array indexes in this API verifying rate counters via the ctrl interface.
In addition to handling single objects, we also support handling N object instances at once in the counter validation API.
For example, for MSC tests, we always have msc.0, msc.1, msc.2 in sequence.
The API is such that you fetch all the (interesting) counters for all three instances at once. You get back an array of counter sets, the first array entry is for msc.0, the second for msc.1, etc.
This array is then a cache; the test increments the expected values in the array, and then verifies it again with results fetched later.
Crucially, the array index so far serves as the ID used on the CTRL interface.
This was the result of first using the counter API in tests, and being annoyed by the repetetive bloat needed for multiple objects.
Our ttcn test that I am trying to fix here already follows this logic of asking for hnb.0, and looking at the first entry of the returned array. -- turns out hnb.0 doesn't work reliably, and we need to use the name instead.
We could keep the indexed-array stuff for index-able objects only, and force single-object access for by-name access, but that would probably introduce code duplication of the CTRL functions for counters. Callers then also need code dup for fetching N objects at once.
Hence, the mapping from index to name: it allows using the same logic, the same API and the same CTRL code, just for names instead of indexes.
Define a list of names once, then continue using array indexes.
This also reduces repetition of name strings in ttcn code, cleaner.
It also allows iterating the counters of instances.
I do not want to remove this layer of abstraction for by-name counters, because it is powerful.
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37882?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I70e74e7554482df67aa1d90bc04314124dea444f
Gerrit-Change-Number: 37882
Gerrit-PatchSet: 4
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 04 Sep 2024 02:55:24 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Attention is currently required from: laforge, pespin.
neels has posted comments on this change by neels. ( https://gerrit.osmocom.org/c/libosmocore/+/37881?usp=email )
Change subject: rate_ctr,CTRL[1/2]: GET using rate_ctr_group_set_name()
......................................................................
Patch Set 5:
(2 comments)
Patchset:
PS2:
> (the "problem" being that we already have a 'name' used for counter groups in this API... […]
actually i already use 'name' for naming in this patch version.
File src/core/rate_ctr.c:
https://gerrit.osmocom.org/c/libosmocore/+/37881/comment/faf07fba_8fc33d91?… :
PS2, Line 284: osmo_quote_str(name, -1));
> it is semantically tied, one without the other leaves a loophole... […]
Done
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/37881?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I841a12f76e6fcb2bd7aecb5f4b1707d9ec927137
Gerrit-Change-Number: 37881
Gerrit-PatchSet: 5
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 04 Sep 2024 02:24:41 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: neels <nhofmeyr(a)sysmocom.de>
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Attention is currently required from: laforge, pespin.
Jenkins Builder has posted comments on this change by neels. ( https://gerrit.osmocom.org/c/libosmocore/+/37881?usp=email )
Change subject: rate_ctr,CTRL[1/2]: GET using rate_ctr_group_set_name()
......................................................................
Patch Set 5:
(1 comment)
File src/core/rate_ctr.c:
Robot Comment from checkpatch (run ID jenkins-gerrit-lint-18289):
https://gerrit.osmocom.org/c/libosmocore/+/37881/comment/97ff9599_a06f4f35?… :
PS5, Line 422: llist_for_each_entry (ctrg, &rate_ctr_groups, list) {
space prohibited between function name and open parenthesis '('
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/37881?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I841a12f76e6fcb2bd7aecb5f4b1707d9ec927137
Gerrit-Change-Number: 37881
Gerrit-PatchSet: 5
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 04 Sep 2024 02:24:21 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Attention is currently required from: laforge, pespin.
Hello Jenkins Builder, pespin,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmocore/+/37881?usp=email
to look at the new patch set (#5).
The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder
Change subject: rate_ctr,CTRL[1/2]: GET using rate_ctr_group_set_name()
......................................................................
rate_ctr,CTRL[1/2]: GET using rate_ctr_group_set_name()
In CTRL, add keyword "by_id" to use the given name for group instance
lookup. IOW, in addition to currently:
GET 123 rate_ctr.abs.hnb.0.iuh:established
also implement:
GET 123 rate_ctr.abs.hnb.by_id.001-01-L2342-R0-S55-C1.iuh:established
Some objects always have fixed indexes, because they come from the
config file (think "bts.0" or "msc.0").
However, some object IDs are created dynamically, which makes it
"impossible" to verify them in tests. In osmo-hnbgw, the same hNodeB may
show up as hnb.0, hnb.1, etc.
We do already have the rate_ctr_group_set_name() API which allows
tagging an identifier on a rate counter group. For above example,
osmo-hnbgw sets rate_ctr_group_set_name(cell_id_str).
When merging this patch, magically all rate_ctr_groups in all osmo
programs will become accessible by their given rate_ctr_group_set_name()
IDs. See the following patch for identifier validation.
Related: OS#6545
Change-Id: I841a12f76e6fcb2bd7aecb5f4b1707d9ec927137
---
M include/osmocom/core/rate_ctr.h
M src/core/libosmocore.map
M src/core/rate_ctr.c
M src/ctrl/control_if.c
4 files changed, 59 insertions(+), 15 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/81/37881/5
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/37881?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I841a12f76e6fcb2bd7aecb5f4b1707d9ec927137
Gerrit-Change-Number: 37881
Gerrit-PatchSet: 5
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/38020?usp=email )
Change subject: rate_ctr,CTRL[2/2]: log ctrg inst names invalid for CTRL
......................................................................
rate_ctr,CTRL[2/2]: log ctrg inst names invalid for CTRL
After the previous patch, magically all rate_ctr_groups in all osmo
programs will become accessible by their given rate_ctr_group_set_name()
IDs.
This also means that the strings passed to rate_ctr_group_set_name() now
are required to be a valid identifier, to not mix up the CTRL interface
syntax.
So far, only log an error, to figure out if we need mangling.
Related: OS#6545
Change-Id: Ic721219649e20960c7af5765ee4d3b641fef5081
---
M src/core/rate_ctr.c
1 file changed, 6 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/20/38020/1
diff --git a/src/core/rate_ctr.c b/src/core/rate_ctr.c
index 8b4c42c..f9713d4 100644
--- a/src/core/rate_ctr.c
+++ b/src/core/rate_ctr.c
@@ -279,6 +279,12 @@
*/
void rate_ctr_group_set_name(struct rate_ctr_group *grp, const char *name)
{
+ /* The name is exposed on the CTRL interface as identifier, see control_if.c get_rate_ctr(). If we see this
+ * error showing up in our applications, we will know that we'll have to fix the code to sanitize this string
+ * one way or another (not decided yet whether here or in the calling application). */
+ if (name && !osmo_identifier_valid(name))
+ LOGP(DLGLOBAL, LOGL_ERROR, "The application is setting an invalid rate counter group name: %s\n",
+ osmo_quote_str(name, -1));
osmo_talloc_replace_string(grp, &grp->name, name);
}
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/38020?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ic721219649e20960c7af5765ee4d3b641fef5081
Gerrit-Change-Number: 38020
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Attention is currently required from: laforge, pespin.
neels has posted comments on this change by neels. ( https://gerrit.osmocom.org/c/libosmocore/+/37881?usp=email )
Change subject: CTRL: get rate_ctr_group by the id from rate_ctr_group_set_name()
......................................................................
Patch Set 4:
(1 comment)
File src/core/rate_ctr.c:
https://gerrit.osmocom.org/c/libosmocore/+/37881/comment/b7230034_00d784ca?… :
PS2, Line 284: osmo_quote_str(name, -1));
> this should probably be a separate commit. […]
it is semantically tied, one without the other leaves a loophole... but ok
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/37881?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I841a12f76e6fcb2bd7aecb5f4b1707d9ec927137
Gerrit-Change-Number: 37881
Gerrit-PatchSet: 4
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 04 Sep 2024 02:14:31 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Attention is currently required from: laforge, pespin.
neels has posted comments on this change by neels. ( https://gerrit.osmocom.org/c/libosmocore/+/37881?usp=email )
Change subject: CTRL: get rate_ctr_group by the id from rate_ctr_group_set_name()
......................................................................
Patch Set 4:
(1 comment)
Patchset:
PS2:
> hey, i didn't resolve this! It seems gerrit is currently freak resolving things when we just post a […]
(the "problem" being that we already have a 'name' used for counter groups in this API... i was trying to avoid confusion with the ctrg->name. naming is hard.)
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/37881?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I841a12f76e6fcb2bd7aecb5f4b1707d9ec927137
Gerrit-Change-Number: 37881
Gerrit-PatchSet: 4
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 04 Sep 2024 02:12:51 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: neels <nhofmeyr(a)sysmocom.de>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>