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 ++++++ module/jails-tree.def | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'module') 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; diff --git a/module/jails-tree.def b/module/jails-tree.def index 06bb10f..3be0826 100644 --- a/module/jails-tree.def +++ b/module/jails-tree.def @@ -53,7 +53,8 @@ (13 jailOutPackets COUNTER64 GET) (20 jailProcesses INTEGER GET) - (21 jailCpuTime TIMETICKS GET) + (21 jailThreads INTEGER GET) + (25 jailCpuTime TIMETICKS GET) (30 jailDiskSpace COUNTER64 GET) (31 jailDiskFiles COUNTER64 GET) -- cgit v1.2.3