Change in libosmocore[master]: vty: add "show uptime"

laforge gerrit-no-reply at lists.osmocom.org
Fri Jul 16 15:56:49 UTC 2021


laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/24924 )

Change subject: vty: add "show uptime"
......................................................................


Patch Set 4:

(2 comments)

https://gerrit.osmocom.org/c/libosmocore/+/24924/4/src/vty/command.c 
File src/vty/command.c:

https://gerrit.osmocom.org/c/libosmocore/+/24924/4/src/vty/command.c@3050 
PS4, Line 3050: 	time_t uptime = now.tv_sec - starttime.tv_sec;
IIRC time_t has a lower range (32bits signed?) than timespec (64bits), so there might be integer underflows here.

The most correct approach would likely be to use timespecsub() after #include <osmocom/core/timer_compat.h> - but I don't think it's super critical.  I'm just surprised we're not using the kind of code we already have to deal with timespec values.


https://gerrit.osmocom.org/c/libosmocore/+/24924/4/src/vty/command.c@3056 
PS4, Line 3056: 	vty_out(vty, "%s has been running for %dd %dh %dm %ds%s", host.app_info->name, d, h, m, s, VTY_NEWLINE);
> maybe we could add a time and date since when it is running. […]
see my previous comments. The process start-up could happen before a proper RTC time/date is set, so we cannot simply store the start-up time/date.



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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ic7d9d5d3c8a9abd06a7e626aed7679f68406040c
Gerrit-Change-Number: 24924
Gerrit-PatchSet: 4
Gerrit-Owner: osmith <osmith at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-Comment-Date: Fri, 16 Jul 2021 15:56:49 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: dexter <pmaier at sysmocom.de>
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210716/75009a7e/attachment.htm>


More information about the gerrit-log mailing list