bool report_maps_num;
bool report_ctx_switch;
bool report_delay;
+ bool skip_non_running_procs;
struct procstat *next;
struct procstat_entry_s *instances;
static bool report_maps_num;
static bool report_delay;
static bool report_sys_ctxt_switch;
+static bool skip_non_running_procs;
#if HAVE_THREAD_INFO
static mach_port_t port_host_self;
new->report_maps_num = report_maps_num;
new->report_ctx_switch = report_ctx_switch;
new->report_delay = report_delay;
+ new->skip_non_running_procs = skip_non_running_procs;
#if HAVE_REGEX_H
if (regexp != NULL) {
WARNING("processes plugin: The plugin has been compiled without support "
"for the \"CollectDelayAccounting\" option.");
#endif
+ } else if (strcasecmp(c->key, "SkipNonRunningProcess") == 0) {
+ cf_util_get_boolean(c, &ps->skip_non_running_procs);
} else {
ERROR("processes plugin: Option \"%s\" not allowed here.", c->key);
}
#endif
} else if (strcasecmp(c->key, "CollectSystemContextSwitch") == 0) {
cf_util_get_boolean(c, &report_sys_ctxt_switch);
+ } else if (strcasecmp(c->key, "SkipNonRunningProcess") == 0) {
+ cf_util_get_boolean(c, &skip_non_running_procs);
} else {
ERROR("processes plugin: The `%s' configuration option is not "
"understood and will be ignored.",
/* submit info about specific process (e.g.: memory taken, cpu usage, etc..) */
static void ps_submit_proc_list(procstat_t *ps) {
+ if (ps->skip_non_running_procs && ps->num_lwp == 0) {
+ DEBUG("processes: Skip submit data from a non-running process %s",
+ ps->name);
+ return;
+ }
value_list_t vl = VALUE_LIST_INIT;
value_t values[2];