summaryrefslogtreecommitdiff
path: root/src/libvmon
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2024-08-11 17:05:45 -0700
committerVito Caputo <vcaputo@pengaru.com>2024-08-11 17:05:45 -0700
commit5d9c93071dd22fe6ab5a4ab125804609598bf1ac (patch)
treedf9f56eccdeb6f306bffcfa70c476ee2844349b6 /src/libvmon
parentc4dbf10b5a8d8ed8bfe5a2259db4151d39a9ce00 (diff)
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.
Diffstat (limited to 'src/libvmon')
-rw-r--r--src/libvmon/vmon.c5
1 files changed, 4 insertions, 1 deletions
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));
© All Rights Reserved