![]() |
![]() |
![]() |
Libgtop Reference Manual | ![]() |
---|---|---|---|---|
#include <glibtop/proctime.h> #define GLIBTOP_PROC_TIME_START_TIME #define GLIBTOP_PROC_TIME_RTIME #define GLIBTOP_PROC_TIME_UTIME #define GLIBTOP_PROC_TIME_STIME #define GLIBTOP_PROC_TIME_CUTIME #define GLIBTOP_PROC_TIME_CSTIME #define GLIBTOP_PROC_TIME_TIMEOUT #define GLIBTOP_PROC_TIME_IT_REAL_VALUE #define GLIBTOP_PROC_TIME_FREQUENCY #define GLIBTOP_PROC_TIME_XCPU_UTIME #define GLIBTOP_PROC_TIME_XCPU_STIME #define GLIBTOP_MAX_PROC_TIME glibtop_proc_time; void glibtop_get_proc_time (glibtop_proc_time *buf, pid_t pid); #define glibtop_get_proc_time_r void glibtop_get_proc_time_l (glibtop *server, glibtop_proc_time *buf, pid_t pid); void glibtop_get_proc_time_p (glibtop *server, glibtop_proc_time *buf, pid_t pid); void glibtop_get_proc_time_s (glibtop *server, glibtop_proc_time *buf, pid_t pid);
typedef struct { guint64 flags; guint64 start_time; /* start time of process -- * seconds since 1-1-70 */ guint64 rtime; /* real time accumulated by process */ guint64 utime; /* user-mode CPU time accumulated by process */ guint64 stime; /* kernel-mode CPU time accumulated by process */ guint64 cutime; /* cumulative utime of process and * reaped children */ guint64 cstime; /* cumulative stime of process and * reaped children */ guint64 timeout; /* The time (in jiffies) of the process's * next timeout */ guint64 it_real_value; /* The time (in jiffies) before the * next SIGALRM is sent to the process * due to an interval timer. */ guint64 frequency; /* Tick frequency. */ guint64 xcpu_utime [GLIBTOP_NCPU]; /* utime and stime for all CPUs on */ guint64 xcpu_stime [GLIBTOP_NCPU]; /* SMP machines. */ } glibtop_proc_time;
void glibtop_get_proc_time (glibtop_proc_time *buf, pid_t pid);
Please note that under Linux, start_time value may be strange.
Linux kernel defines INITIAL_JIFFIES which implies a time
shift. Because INITIAL_JIFFIES is not user-space defined,
we cannot use it to compute accurate code
{start_time}. On Linux2.6,
INITIAL_JIFFIES is 300 so start_time is
always 3s different from real start time of the given process. You
may also get shift results if your system clock is not synchronised
with your hardware clock. See man hwclock.
buf : |
|
pid : |
Process id to get the user and tty information |
void glibtop_get_proc_time_l (glibtop *server, glibtop_proc_time *buf, pid_t pid);
server : |
|
buf : |
|
pid : |
void glibtop_get_proc_time_p (glibtop *server, glibtop_proc_time *buf, pid_t pid);
server : |
|
buf : |
|
pid : |
void glibtop_get_proc_time_s (glibtop *server, glibtop_proc_time *buf, pid_t pid);
server : |
|
buf : |
|
pid : |