From 5102647b9623ac019af7da65e22ac800df7e3f70 Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Fri, 30 Apr 2021 18:53:31 -0400 Subject: [PATCH] chore: Disable preemption logging --- runtime/Makefile | 2 +- runtime/src/software_interrupt.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/runtime/Makefile b/runtime/Makefile index de75c06..e69fce6 100644 --- a/runtime/Makefile +++ b/runtime/Makefile @@ -57,7 +57,7 @@ BINARY_NAME=sledgert # CFLAGS += -DLOG_CONTEXT_SWITCHES # CFLAGS += -DLOG_ADMISSIONS_CONTROL # CFLAGS += -DLOG_REQUEST_ALLOCATION -CFLAGS += -DLOG_PREEMPTION +# CFLAGS += -DLOG_PREEMPTION # CFLAGS += -DLOG_MODULE_LOADING # This dumps per module *.csv files containing the cycle a sandbox has been in RUNNING when each diff --git a/runtime/src/software_interrupt.c b/runtime/src/software_interrupt.c index 6fe86c4..8c66dae 100644 --- a/runtime/src/software_interrupt.c +++ b/runtime/src/software_interrupt.c @@ -57,8 +57,10 @@ sigalrm_propagate_workers(siginfo_t *signal_info) /* Signal was sent directly by the kernel, so forward to other threads */ if (signal_info->si_code == SI_KERNEL) { software_interrupt_SIGALRM_kernel_count++; +#ifdef LOG_PREEMPTION + debuglog("Kernel SIGALRM: %d!\n", software_interrupt_SIGALRM_kernel_count); +#endif for (int i = 0; i < runtime_worker_threads_count; i++) { - debuglog("Kernel SIGALRM: %d!\n", software_interrupt_SIGALRM_kernel_count); if (pthread_self() == runtime_worker_threads[i]) continue; /* All threads should have been initialized */ @@ -78,7 +80,9 @@ sigalrm_propagate_workers(siginfo_t *signal_info) } } else { software_interrupt_SIGALRM_thread_count++; +#ifdef LOG_PREEMPTION debuglog("Thread SIGALRM: %d!\n", software_interrupt_SIGALRM_thread_count); +#endif /* Signal forwarded from another thread. Just confirm it resulted from pthread_kill */ assert(signal_info->si_code == SI_TKILL); }