Added boot_time.
* uptime.c: (glibtop_get_uptime_p): Added boot_time.
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
|
2004-05-25 Benoît Dejean <tazforever@dlfp.org>
|
||||||
|
|
||||||
|
* uptime.c: (glibtop_get_uptime_p): Added boot_time.
|
||||||
|
|
||||||
2004-03-09 Bastien Nocera <hadess@hadess.net>
|
2004-03-09 Bastien Nocera <hadess@hadess.net>
|
||||||
|
|
||||||
* procargs.c: (glibtop_get_proc_args_s): fix g_malloc usage on non-Linux
|
* procargs.c: (glibtop_get_proc_args_s): fix g_malloc usage on non-Linux
|
||||||
|
@@ -29,6 +29,8 @@
|
|||||||
|
|
||||||
#include <glibtop_suid.h>
|
#include <glibtop_suid.h>
|
||||||
|
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
static const unsigned long _glibtop_sysdeps_uptime =
|
static const unsigned long _glibtop_sysdeps_uptime =
|
||||||
(1L << GLIBTOP_UPTIME_UPTIME) + (1L << GLIBTOP_UPTIME_IDLETIME);
|
(1L << GLIBTOP_UPTIME_UPTIME) + (1L << GLIBTOP_UPTIME_IDLETIME);
|
||||||
|
|
||||||
@@ -68,6 +70,7 @@ glibtop_get_uptime_p (glibtop *server, glibtop_uptime *buf)
|
|||||||
|
|
||||||
buf->uptime = (double) cpu.total / (double) cpu.frequency;
|
buf->uptime = (double) cpu.total / (double) cpu.frequency;
|
||||||
buf->idletime = (double) cpu.idle / (double) cpu.frequency;
|
buf->idletime = (double) cpu.idle / (double) cpu.frequency;
|
||||||
|
buf->boot_time = (guint64) time(NULL) - (guint64) buf->uptime;
|
||||||
|
|
||||||
buf->flags = _glibtop_sysdeps_uptime;
|
buf->flags = _glibtop_sysdeps_uptime;
|
||||||
}
|
}
|
||||||
|
@@ -1,3 +1,7 @@
|
|||||||
|
2004-05-25 Benoît Dejean <tazforever@dlfp.org>
|
||||||
|
|
||||||
|
* uptime.c: (glibtop_get_uptime_p): Added boot_time.
|
||||||
|
|
||||||
2004-03-09 Bastien Nocera <hadess@hadess.net>
|
2004-03-09 Bastien Nocera <hadess@hadess.net>
|
||||||
|
|
||||||
* open.c: (glibtop_open_p):
|
* open.c: (glibtop_open_p):
|
||||||
|
@@ -56,6 +56,7 @@ glibtop_get_uptime_p (glibtop *server, glibtop_uptime *buf)
|
|||||||
|
|
||||||
buf->uptime = (double) cpu.total / (double) cpu.frequency;
|
buf->uptime = (double) cpu.total / (double) cpu.frequency;
|
||||||
buf->idletime = (double) cpu.idle / (double) cpu.frequency;
|
buf->idletime = (double) cpu.idle / (double) cpu.frequency;
|
||||||
|
buf->boot_time = (guint64) time(NULL) - (guint64) buf->uptime;
|
||||||
|
|
||||||
buf->flags = _glibtop_sysdeps_uptime;
|
buf->flags = _glibtop_sysdeps_uptime;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user