From 2316a0d0c4a584b565f2cf9d2d1ec38ac4592e97 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Fri, 16 Jan 2009 01:42:29 +0000 Subject: Add support for listing threads --- module/bsnmp-jails.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'module/bsnmp-jails.c') diff --git a/module/bsnmp-jails.c b/module/bsnmp-jails.c index b88cdd7..b6eca88 100644 --- a/module/bsnmp-jails.c +++ b/module/bsnmp-jails.c @@ -168,6 +168,7 @@ struct jaildat { uint32_t cpu_time_total; uint32_t cpu_time_offset; uint32_t n_processes; + uint32_t n_threads; /* Top process information */ uint32_t n_ptops; @@ -903,6 +904,7 @@ process_refresh_all (void) jail->ptops[i].status = PROC_GONE; jail->n_processes = 0; + jail->n_threads = 0; jail->cpu_time_total = jail->cpu_time_offset; } @@ -920,6 +922,7 @@ process_refresh_all (void) continue; jail->n_processes += 1; + jail->n_threads += kp[i].ki_numthreads; /* Find the top level process within jail to account to */ tkp = &kp[i]; @@ -1438,6 +1441,9 @@ op_jailentry (struct snmp_context *ctx, struct snmp_value *value, case LEAF_jailProcesses: value->v.integer = jail->n_processes; return SNMP_ERR_NOERROR; + case LEAF_jailThreads: + value->v.integer = jail->n_threads; + return SNMP_ERR_NOERROR; case LEAF_jailCpuTime: value->v.integer = jail->cpu_time_total; return SNMP_ERR_NOERROR; -- cgit v1.2.3