From b2d4629d1776dbdef9924a0ded29e733de150ccc Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Thu, 9 Sep 2021 19:25:41 -0700 Subject: lbvmon: expose clock_gettime(CLOCK_BOOTTIME) Exposed as VMON_SYS_STAT_BOOTTIME, so part of VMON_WANT_SYS_STAT, in units of ticks to normalize with SYS_STAT_CPU* times. This also introduces vmon->ticks_per_sec, which callers can access as well for convenience since vmon_t is all public and this library doesn't aspire to keep anything private. It's initialized via sysconf(_SC_CLK_TCK) @ vmon_init(). --- src/libvmon/defs/sys_stat.def | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/libvmon/defs') diff --git a/src/libvmon/defs/sys_stat.def b/src/libvmon/defs/sys_stat.def index ef8b9a7..9d252f6 100644 --- a/src/libvmon/defs/sys_stat.def +++ b/src/libvmon/defs/sys_stat.def @@ -1,6 +1,10 @@ #include "_begin.def" /* member name, symbolic constant, human label, human description (think UI/help) */ + + /* clock_gettime(CLOCK_BOOTTIME) */ +vmon_datum_ulonglong( boottime, SYS_STAT_BOOTTIME, "BootTime", "Time since boot (ticks)") + /* /proc/stat */ /* a cpu row, this is shown once for the total prefixed with "cpu ", then again for every cpu prefixed with "cpuN ", newlines terminate rows */ -- cgit v1.2.3