pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/25973 )

Change subject: add time_cc API: cumlative counter for time, reported as 
rate_ctr
......................................................................


Patch Set 1:

{ struct timespec last; struct timer_list timer; }

1- Last channel is allocated:
* clock_gettime(last); timer_schedule(cb_func);

2- cb_func triggers:
* clock_gettime(now), osmo_stat_item_add(st, now - last); last = now; 
timer_schedule(cb_func);

3- A channel is freed:
* if (time_is_pending(timer)) { clock_gettime(now), osmo_stat_item_add(st, now 
- last); timer_stop(timer); }

"counting" is not even needed, the timer_is_pending() is enough to see if it is 
counting or not. Is there a problem with this approach? AFAIU this would track 
time even if its under granularity of the timer.


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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Icdd36f27cb54b2e1b940c9e6404ba9dd3692a310
Gerrit-Change-Number: 25973
Gerrit-PatchSet: 1
Gerrit-Owner: neels <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: laforge <[email protected]>
Gerrit-CC: pespin <[email protected]>
Gerrit-Comment-Date: Tue, 02 Nov 2021 16:45:21 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

Reply via email to