From 5d9c93071dd22fe6ab5a4ab125804609598bf1ac Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Sun, 11 Aug 2024 17:05:45 -0700 Subject: libvmon: assert no children store for threads There's no children processes expected for threads, and the sampler assumes this is the case - but let's assert it holds true. --- src/libvmon/vmon.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/libvmon/vmon.c') diff --git a/src/libvmon/vmon.c b/src/libvmon/vmon.c index fa7b62d..05c2b3a 100644 --- a/src/libvmon/vmon.c +++ b/src/libvmon/vmon.c @@ -381,8 +381,11 @@ static int proc_follow_children(vmon_t *vmon, vmon_proc_t *proc, vmon_proc_follo return DTOR_FREE; } - if (proc->is_thread) /* don't follow children of threads */ + if (proc->is_thread) { /* don't follow children of threads */ + assert(!(*store)); + return SAMPLE_UNCHANGED; + } if (!(*store)) { /* implicit ctor on first sample */ *store = calloc(1, sizeof(vmon_proc_follow_children_t)); -- cgit v1.2.3