X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=util-vserver%2Fkernel%2Fcvirt_def.h;h=9fabb31c7a1a2063f0d850ebb897765cd3b46dcb;hb=5b39edfee423f5f3cbe8fa223dcfdc9e8d66e286;hp=c3528907da1f473d60c78e64c67af232cc929c6b;hpb=3eb170c53025d9108c8eb7c105bea5f803f79b67;p=util-vserver.git diff --git a/util-vserver/kernel/cvirt_def.h b/util-vserver/kernel/cvirt_def.h index c352890..9fabb31 100644 --- a/util-vserver/kernel/cvirt_def.h +++ b/util-vserver/kernel/cvirt_def.h @@ -23,10 +23,10 @@ struct _vx_syslog { wait_queue_head_t log_wait; spinlock_t logbuf_lock; /* lock for the log buffer */ - unsigned long log_start; /* next char to be read by syslog() */ - unsigned long con_start; /* next char to be sent to consoles */ - unsigned long log_end; /* most-recently-written-char + 1 */ - unsigned long logged_chars; /* #chars since last read+clear operation */ + unsigned long log_start; /* next char to be read by syslog() */ + unsigned long con_start; /* next char to be sent to consoles */ + unsigned long log_end; /* most-recently-written-char + 1 */ + unsigned long logged_chars; /* #chars since last read+clear operation */ char log_buf[1024]; }; @@ -35,7 +35,7 @@ struct _vx_syslog { /* context sub struct */ struct _vx_cvirt { - int max_threads; /* maximum allowed threads */ +// int max_threads; /* maximum allowed threads */ atomic_t nr_threads; /* number of current threads */ atomic_t nr_running; /* number of running threads */ atomic_t nr_uninterruptible; /* number of uninterruptible threads */ @@ -61,6 +61,24 @@ struct _vx_cvirt { struct _vx_syslog syslog; }; + +#ifdef CONFIG_VSERVER_DEBUG + +static inline void __dump_vx_cvirt(struct _vx_cvirt *cvirt) +{ + printk("\t_vx_cvirt:\n"); + printk("\t threads: %4d, %4d, %4d, %4d\n", + atomic_read(&cvirt->nr_threads), + atomic_read(&cvirt->nr_running), + atomic_read(&cvirt->nr_uninterruptible), + atomic_read(&cvirt->nr_onhold)); + /* add rest here */ + printk("\t total_forks = %d\n", atomic_read(&cvirt->total_forks)); +} + +#endif + + struct _vx_sock_acc { atomic_t count; atomic_t total; @@ -69,9 +87,29 @@ struct _vx_sock_acc { /* context sub struct */ struct _vx_cacct { - unsigned long total_forks; - struct _vx_sock_acc sock[5][3]; }; +#ifdef CONFIG_VSERVER_DEBUG + +static inline void __dump_vx_cacct(struct _vx_cacct *cacct) +{ + int i,j; + + printk("\t_vx_cacct:"); + for (i=0; i<5; i++) { + struct _vx_sock_acc *ptr = cacct->sock[i]; + + printk("\t [%d] =", i); + for (j=0; j<3; j++) { + printk(" [%d] = %8d, %8d", j, + atomic_read(&ptr[j].count), + atomic_read(&ptr[j].total)); + } + printk("\n"); + } +} + +#endif + #endif /* _VX_CVIRT_DEF_H */