Change in libosmocore[master]: stat_item: make value ids item specific

osmith gerrit-no-reply at
Tue Apr 6 10:00:28 UTC 2021

Hello Jenkins Builder, 

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

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

Change subject: stat_item: make value ids item specific

stat_item: make value ids item specific

Fix counting of values missed because of FIFO overflow in
osmo_stat_item_get_next(), by assigning a new item value id effectively
as item->value[n + 1].id = item->value[n].id + 1, instead of increasing
a global_value_id that is shared between all items and groups. With
global_value_id, the count of values missed was wrong for one item, as
soon as a new value was added to another item.

This partially reverts b27b352e ("stats: Use a global index for stat
item values") from 2015, right after stats was added to libosmocore. It
was supposed to make multiple readers (reporters) possible, which could
read independently from stat_item (and later added comments explain it
like that). But this remained unused, stats has implemented multiple
reporters by reading all stat_items once and sending the same data to
all enabled reporters. The patch caused last_value_index in struct
osmo_stat_item to always remain at -1.

Replace this unused last_value_index with stats_next_id, so stats can
store the item-specific next_id in the struct again. It appears that
stats is the only direct user of osmo_stat_item, but if there are
others, they can bring their own item-specific next_id: functions in
stat_item.c still accept a next_id argument.

Related: OS#5088
Change-Id: Ie65dcdf52c8fc3d916e20d7f0455f6223be6b64f
M include/osmocom/core/stat_item.h
M src/stat_item.c
M src/stats.c
M tests/stats/stats_test.c
4 files changed, 44 insertions(+), 44 deletions(-)

  git pull ssh:// refs/changes/08/23508/2
To view, visit
To unsubscribe, or for help writing mail filters, visit

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ie65dcdf52c8fc3d916e20d7f0455f6223be6b64f
Gerrit-Change-Number: 23508
Gerrit-PatchSet: 2
Gerrit-Owner: osmith <osmith at>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: daniel <dwillmann at>
Gerrit-CC: pespin <pespin at>
Gerrit-MessageType: newpatchset
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the gerrit-log mailing list