Change in osmo-bts[master]: [VAMOS] trx_sched_init_ts(): assign names to per-timeslot counters

2021-06-06 Thread fixeria
fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/24592 )


Change subject: [VAMOS] trx_sched_init_ts(): assign names to per-timeslot 
counters
..

[VAMOS] trx_sched_init_ts(): assign names to per-timeslot counters

Thanks to [1], it's now possible to associate a human-readable
name with a rate counter group.  Before this API, we had to use
weird index values for each timeslot, and with introduction
of the shadow timeslots the situation got even worse.

In change [2] I introduced rate_ctr_group_set_name_fmt() to
allow passing a format string - use it in this patch.

Change-Id: Ie872ab37661fa5d44f219f59c7daaa1033113289
Depends: [1] I0dc510783dd9ae8436dae8005a7b3330e80d36f3
Depends: [2] I6e813476cfb6a0ad275c4a51e9f065eeca8cb406
---
M src/common/scheduler.c
1 file changed, 4 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/92/24592/1

diff --git a/src/common/scheduler.c b/src/common/scheduler.c
index 3ab94a2..a946bbf 100644
--- a/src/common/scheduler.c
+++ b/src/common/scheduler.c
@@ -622,6 +622,10 @@
l1ts->ctrs = rate_ctr_group_alloc(ts->trx,
  &l1sched_ts_ctrg_desc,
  rate_ctr_idx);
+   rate_ctr_group_set_name_fmt(l1ts->ctrs, "bts%u-trx%u-ts%u%s",
+   ts->trx->bts->nr, ts->trx->nr, ts->nr,
+   ts->vamos.is_shadow ? "-shadow" : "");
+
INIT_LLIST_HEAD(&l1ts->dl_prims);

for (i = 0; i < ARRAY_SIZE(l1ts->chan_state); i++) {

--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/24592
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ie872ab37661fa5d44f219f59c7daaa1033113289
Gerrit-Change-Number: 24592
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-MessageType: newchange


Change in osmo-bts[master]: [VAMOS] trx_sched_init_ts(): assign names to per-timeslot counters

2021-06-07 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/24592 )

Change subject: [VAMOS] trx_sched_init_ts(): assign names to per-timeslot 
counters
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/24592
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ie872ab37661fa5d44f219f59c7daaa1033113289
Gerrit-Change-Number: 24592
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Mon, 07 Jun 2021 09:18:14 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bts[master]: [VAMOS] trx_sched_init_ts(): assign names to per-timeslot counters

2021-06-07 Thread fixeria
Hello Jenkins Builder, pespin,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-bts/+/24592

to look at the new patch set (#2).

Change subject: [VAMOS] trx_sched_init_ts(): assign names to per-timeslot 
counters
..

[VAMOS] trx_sched_init_ts(): assign names to per-timeslot counters

Thanks to [1], it's now possible to associate a human-readable
name with a rate counter group.  Before this API, we had to use
weird index values for each timeslot, and with introduction
of the shadow timeslots the situation got even worse.

In change [2] I introduced osmo_talloc_replace_string_fmt() to
allow using a format string on the fly - use it in this patch.

Change-Id: Ie872ab37661fa5d44f219f59c7daaa1033113289
Depends: [1] I0dc510783dd9ae8436dae8005a7b3330e80d36f3
Depends: [2] I6b84fa052a98c531fc558e5dc1298fec00c1
---
M TODO-RELEASE
M src/common/scheduler.c
2 files changed, 7 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/92/24592/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/24592
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ie872ab37661fa5d44f219f59c7daaa1033113289
Gerrit-Change-Number: 24592
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-MessageType: newpatchset


Change in osmo-bts[master]: [VAMOS] trx_sched_init_ts(): assign names to per-timeslot counters

2021-06-07 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/24592 )

Change subject: [VAMOS] trx_sched_init_ts(): assign names to per-timeslot 
counters
..


Patch Set 2:

(1 comment)

https://gerrit.osmocom.org/c/osmo-bts/+/24592/2/src/common/scheduler.c
File src/common/scheduler.c:

https://gerrit.osmocom.org/c/osmo-bts/+/24592/2/src/common/scheduler.c@625
PS2, Line 625:  osmo_talloc_replace_string_fmt(l1ts->ctrs, &l1ts->ctrs->name,
isn't there an API to set the field? Why aren't you simply using 
talloc_snprintf or alike and passing it to the proper API?



--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/24592
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ie872ab37661fa5d44f219f59c7daaa1033113289
Gerrit-Change-Number: 24592
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Mon, 07 Jun 2021 14:50:46 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-bts[master]: [VAMOS] trx_sched_init_ts(): assign names to per-timeslot counters

2021-06-07 Thread fixeria
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/24592 )

Change subject: [VAMOS] trx_sched_init_ts(): assign names to per-timeslot 
counters
..


Patch Set 2:

(1 comment)

https://gerrit.osmocom.org/c/osmo-bts/+/24592/2/src/common/scheduler.c
File src/common/scheduler.c:

https://gerrit.osmocom.org/c/osmo-bts/+/24592/2/src/common/scheduler.c@625
PS2, Line 625:  osmo_talloc_replace_string_fmt(l1ts->ctrs, &l1ts->ctrs->name,
> isn't there an API to set the field?

There is rate_ctr_group_set_name() which accepts a constant string. I need a 
format string. That's why I introduced rate_ctr_group_set_name_fmt(). Then I 
was recommended to introduce a generic function for that, and this is what I 
did.

> Why aren't you simply using talloc_snprintf or alike and passing it to the 
> proper API?

Again, because your API _duplicates_ the given string using talloc_strdup(), so 
I would need to allocate a string, pass it to rate_ctr_group_set_name() and 
then free() it. This looks ugly to me.



--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/24592
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ie872ab37661fa5d44f219f59c7daaa1033113289
Gerrit-Change-Number: 24592
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Mon, 07 Jun 2021 14:59:39 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin 
Gerrit-MessageType: comment


Change in osmo-bts[master]: [VAMOS] trx_sched_init_ts(): assign names to per-timeslot counters

2021-06-07 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/24592 )

Change subject: [VAMOS] trx_sched_init_ts(): assign names to per-timeslot 
counters
..


Patch Set 2:

Given that's done seldomly afaict, I'd welcome an extra alloc+free from time to 
time using APIs rather than acessing struct fields and causing potential ABI 
breakages in the future.

We are even using that osmo_main_ctx thing allocating buffers in lots of places 
where a simple stack alloc would suffice, only for coding comodity...


--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/24592
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ie872ab37661fa5d44f219f59c7daaa1033113289
Gerrit-Change-Number: 24592
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Mon, 07 Jun 2021 15:18:46 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-bts[master]: [VAMOS] trx_sched_init_ts(): assign names to per-timeslot counters

2021-06-09 Thread fixeria
Hello Jenkins Builder, pespin,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-bts/+/24592

to look at the new patch set (#3).

Change subject: [VAMOS] trx_sched_init_ts(): assign names to per-timeslot 
counters
..

[VAMOS] trx_sched_init_ts(): assign names to per-timeslot counters

Thanks to [1], it's now possible to associate a human-readable
name with a rate counter group.  Before this API, we had to use
weird index values for each timeslot, and with introduction
of the shadow timeslots the situation got even worse.

Change-Id: Ie872ab37661fa5d44f219f59c7daaa1033113289
Depends: [1] I0dc510783dd9ae8436dae8005a7b3330e80d36f3
Related: SYS#4895, OS#4941
---
M TODO-RELEASE
M src/common/scheduler.c
2 files changed, 7 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/92/24592/3
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/24592
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ie872ab37661fa5d44f219f59c7daaa1033113289
Gerrit-Change-Number: 24592
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-MessageType: newpatchset


Change in osmo-bts[master]: [VAMOS] trx_sched_init_ts(): assign names to per-timeslot counters

2021-06-10 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/24592 )

Change subject: [VAMOS] trx_sched_init_ts(): assign names to per-timeslot 
counters
..


Patch Set 3: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/24592
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ie872ab37661fa5d44f219f59c7daaa1033113289
Gerrit-Change-Number: 24592
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 10 Jun 2021 10:13:22 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bts[master]: [VAMOS] trx_sched_init_ts(): assign names to per-timeslot counters

2021-06-10 Thread dexter
dexter has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/24592 )

Change subject: [VAMOS] trx_sched_init_ts(): assign names to per-timeslot 
counters
..


Patch Set 3: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/24592
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ie872ab37661fa5d44f219f59c7daaa1033113289
Gerrit-Change-Number: 24592
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 10 Jun 2021 10:29:37 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bts[master]: [VAMOS] trx_sched_init_ts(): assign names to per-timeslot counters

2021-06-10 Thread fixeria
fixeria has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/24592 )

Change subject: [VAMOS] trx_sched_init_ts(): assign names to per-timeslot 
counters
..

[VAMOS] trx_sched_init_ts(): assign names to per-timeslot counters

Thanks to [1], it's now possible to associate a human-readable
name with a rate counter group.  Before this API, we had to use
weird index values for each timeslot, and with introduction
of the shadow timeslots the situation got even worse.

Change-Id: Ie872ab37661fa5d44f219f59c7daaa1033113289
Depends: [1] I0dc510783dd9ae8436dae8005a7b3330e80d36f3
Related: SYS#4895, OS#4941
---
M TODO-RELEASE
M src/common/scheduler.c
2 files changed, 7 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  dexter: Looks good to me, approved



diff --git a/TODO-RELEASE b/TODO-RELEASE
index 82f25d6..aa0b2fd 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -3,3 +3,4 @@
 update libosmo-abis dependency to > 1.1.1 for osmo_rtp_socket_set_priority()
 update libosmo-abis dependency to > 1.1.1 for new e1_input vty commands for 
DSCP + priority
 update libosmocore dependency to > 1.5.1-73-g524b4f80 for 
osmo_bts_features_desc()
+update libosmocore dependency to > 1.5.1-133-g09f075fa for name in (struct 
rate_ctr_group)
diff --git a/src/common/scheduler.c b/src/common/scheduler.c
index 3ab94a2..0e1f495 100644
--- a/src/common/scheduler.c
+++ b/src/common/scheduler.c
@@ -611,6 +611,7 @@
 {
struct l1sched_ts *l1ts;
unsigned int i;
+   char name[128];

l1ts = talloc_zero(ts->trx, struct l1sched_ts);
OSMO_ASSERT(l1ts != NULL);
@@ -622,6 +623,11 @@
l1ts->ctrs = rate_ctr_group_alloc(ts->trx,
  &l1sched_ts_ctrg_desc,
  rate_ctr_idx);
+   snprintf(name, sizeof(name), "bts%u-trx%u-ts%u%s",
+ts->trx->bts->nr, ts->trx->nr, ts->nr,
+ts->vamos.is_shadow ? "-shadow" : "");
+   rate_ctr_group_set_name(l1ts->ctrs, name);
+
INIT_LLIST_HEAD(&l1ts->dl_prims);

for (i = 0; i < ARRAY_SIZE(l1ts->chan_state); i++) {

--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/24592
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ie872ab37661fa5d44f219f59c7daaa1033113289
Gerrit-Change-Number: 24592
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter 
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged