X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=util-vserver%2Fkernel%2Fcvirt.h;h=a8a242e02c99503e1169eaa34131a6c6022e010a;hb=6557b6f84f9d2dbf04eab2f72e46cd171fecece5;hp=da8c1850adc934885baa2ebe1390f940b0b3da9c;hpb=a5606aace6e9ef811af10ff21e704f81bae09bc3;p=util-vserver.git diff --git a/util-vserver/kernel/cvirt.h b/util-vserver/kernel/cvirt.h index da8c185..a8a242e 100644 --- a/util-vserver/kernel/cvirt.h +++ b/util-vserver/kernel/cvirt.h @@ -20,9 +20,9 @@ struct _vx_cvirt { unsigned long total_forks; unsigned int bias_cswtch; - long bias_jiffies; - long bias_idle; + struct timespec bias_idle; struct timespec bias_tp; + uint64_t bias_jiffies; struct new_utsname utsname; @@ -42,16 +42,18 @@ static inline long vx_sock_total(struct _vx_cvirt *cvirt, int type, int pos) } +extern uint64_t vx_idle_jiffies(void); + static inline void vx_info_init_cvirt(struct _vx_cvirt *cvirt) { int i,j; + uint64_t idle_jiffies = vx_idle_jiffies(); cvirt->nr_threads = 1; // new->virt.bias_cswtch = kstat.context_swtch; - cvirt->bias_jiffies = jiffies; - /* new->virt.bias_idle = init_tasks[0]->times.tms_utime + - init_tasks[0]->times.tms_stime; - */ + cvirt->bias_jiffies = get_jiffies_64(); + + jiffies_to_timespec(idle_jiffies, &cvirt->bias_idle); do_posix_clock_monotonic_gettime(&cvirt->bias_tp); down_read(&uts_sem); @@ -99,7 +101,7 @@ static inline int vx_info_proc_cvirt(struct _vx_cvirt *cvirt, char *buffer) struct timespec; -void vx_vsi_uptime(struct timespec *uptime); +void vx_vsi_uptime(struct timespec *uptime, struct timespec *idle); #endif /* __KERNEL__ */