diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2024-08-11 17:07:58 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2024-08-11 17:07:58 -0700 |
commit | 744d33af780d233e2cd95c20d4ec0a8c11968460 (patch) | |
tree | f0e72cb5e1e98e7b28ddeba0ac5147fc43d8f1a4 /src | |
parent | 5d9c93071dd22fe6ab5a4ab125804609598bf1ac (diff) |
libvmon: remove pointless test on proc->stores
proc->stores is always allocated as part of vmon_proc_t, so this
can't possibly be NULL. IIRC an earlier form of libvmon
allocated the stores array lazily once needed.
Diffstat (limited to 'src')
-rw-r--r-- | src/libvmon/vmon.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libvmon/vmon.c b/src/libvmon/vmon.c index 05c2b3a..bb2cf3e 100644 --- a/src/libvmon/vmon.c +++ b/src/libvmon/vmon.c @@ -491,7 +491,8 @@ static int proc_follow_threads(vmon_t *vmon, vmon_proc_t *proc, vmon_proc_follow if (proc->is_thread) /* bypass following the threads of threads */ return SAMPLE_UNCHANGED; - if (!proc->stores || !proc->stores[VMON_STORE_PROC_STAT] || (((vmon_proc_stat_t *)proc->stores[VMON_STORE_PROC_STAT])->num_threads <= 1 && list_empty(&proc->threads))) + if (!proc->stores[VMON_STORE_PROC_STAT] || + (((vmon_proc_stat_t *)proc->stores[VMON_STORE_PROC_STAT])->num_threads <= 1 && list_empty(&proc->threads))) /* bypass following of threads if we either can't determine the number from the proc stat sample or if the sample says there's 1 or less (and an empty threads list, handling stale exited threads) */ /* XXX I'm not sure if this is always the right thing to do, there may be some situations where one could play games with clone() directly * and escape the monitoring library with a lone thread having had the main thread exit, leaving the count at 1 while having a process |