summaryrefslogtreecommitdiff
path: root/cbits/hook.c
diff options
context:
space:
mode:
Diffstat (limited to 'cbits/hook.c')
-rw-r--r--cbits/hook.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/cbits/hook.c b/cbits/hook.c
index 22aa259..697b64f 100644
--- a/cbits/hook.c
+++ b/cbits/hook.c
@@ -137,6 +137,7 @@ static void hook_callback(const struct GCDetails_ *details) {
// mutex is locked from here
if (logging_enabled) {
+ fprintf(stderr, "<hook_callback> gc\n");
if (detlog_length == detlog_capacity) {
detlog_capacity = detlog_capacity == 0 ? 128 : 2 * detlog_capacity;
detlog = realloc(detlog, detlog_capacity * sizeof(detlog[0]));
@@ -152,6 +153,8 @@ static void hook_callback(const struct GCDetails_ *details) {
dst->timestamp_nsec = now.tv_nsec;
shadow_copy(dst, details);
detlog_length++;
+ } else {
+ fprintf(stderr, "<hook_callback> gc but not enabled\n");
}
if (hook_c_delegate) hook_c_delegate(details);
@@ -187,6 +190,8 @@ void copy_log_to_buffer(size_t space_available, char *buffer, size_t *unit_size,
return;
}
+ fprintf(stderr, "<copy_log_to_buffer> length = %zu\n", detlog_length);
+
if (detlog_length == 0) {
*num_stored = 0;
goto unlock_return;
@@ -194,6 +199,8 @@ void copy_log_to_buffer(size_t space_available, char *buffer, size_t *unit_size,
const size_t n = min_sz(space_available / sizeof(detlog[0]), detlog_length);
+ fprintf(stderr, "<copy_log_to_buffer> n = %zu\n", n);
+
// First copy over the fitting items
memcpy(buffer, detlog, n * sizeof(detlog[0]));
*unit_size = sizeof(detlog[0]);