Project

General

Profile

Actions

Bug #2586

closed

fix timer duration calculations

Added by msuraev over 6 years ago. Updated almost 5 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
10/20/2017
Due date:
% Done:

100%

Spec Reference:

Description

The code in gprs_ns.c uses nsvc_timer_elapsed_ms() which relies on osmo_gettimeofday() wrapper around gettimeofday() which is affected by discontinuous jumps in the system time (e.g., if the system administrator manually changes the system time).

It's better to use monotonic clock via clock_gettime(CLOCK_MONOTONIC, ..) but this would requre replacing "struct timeval" with "struct timespec" for timer_started in "struct gprs_nsvc". I'm not aware of any external users for this field but nevertheless we should properly change API/ABI version when doing so.

On a related note: we should carefully check all the uses of osmo_gettimeofday() for elapsed time calculations and replace it with monotonic clock.


Related issues

Related to OsmoPCU - Bug #2407: N3101 not implemented in OsmoPCUClosedmsuraev07/29/2017

Actions
Related to libosmocore - Feature #3309: osmo_timer_* should use monotonic clockNew05/30/2018

Actions
Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)