refactor: Remove LOG_LOCK_OVERHEAD reporting

master
Sean McBride 3 years ago
parent cce8c1981e
commit 51b3f74b5e

@ -59,7 +59,6 @@ BINARY_NAME=sledgert
# CFLAGS += -DLOG_ADMISSIONS_CONTROL # CFLAGS += -DLOG_ADMISSIONS_CONTROL
# CFLAGS += -DLOG_CONTEXT_SWITCHES # CFLAGS += -DLOG_CONTEXT_SWITCHES
# CFLAGS += -DLOG_HTTP_PARSER # CFLAGS += -DLOG_HTTP_PARSER
# CFLAGS += -DLOG_LOCK_OVERHEAD
# CFLAGS += -DLOG_TENANT_LOADING # CFLAGS += -DLOG_TENANT_LOADING
# CFLAGS += -DLOG_PREEMPTION # CFLAGS += -DLOG_PREEMPTION
# CFLAGS += -DLOG_SANDBOX_ALLOCATION # CFLAGS += -DLOG_SANDBOX_ALLOCATION

@ -28,8 +28,6 @@ current_sandbox_sleep()
struct sandbox *sleeping_sandbox = current_sandbox_get(); struct sandbox *sleeping_sandbox = current_sandbox_get();
assert(sleeping_sandbox != NULL); assert(sleeping_sandbox != NULL);
generic_thread_dump_lock_overhead();
switch (sleeping_sandbox->state) { switch (sleeping_sandbox->state) {
case SANDBOX_RUNNING_SYS: { case SANDBOX_RUNNING_SYS: {
sandbox_sleep(sleeping_sandbox); sandbox_sleep(sleeping_sandbox);
@ -54,8 +52,6 @@ current_sandbox_exit()
struct sandbox *exiting_sandbox = current_sandbox_get(); struct sandbox *exiting_sandbox = current_sandbox_get();
assert(exiting_sandbox != NULL); assert(exiting_sandbox != NULL);
generic_thread_dump_lock_overhead();
switch (exiting_sandbox->state) { switch (exiting_sandbox->state) {
case SANDBOX_RETURNED: case SANDBOX_RETURNED:
sandbox_exit_success(exiting_sandbox); sandbox_exit_success(exiting_sandbox);
@ -107,7 +103,6 @@ current_sandbox_wasm_trap_handler(int trapno)
debuglog("%s", error_message); debuglog("%s", error_message);
worker_thread_epoll_remove_sandbox(sandbox); worker_thread_epoll_remove_sandbox(sandbox);
generic_thread_dump_lock_overhead();
current_sandbox_exit(); current_sandbox_exit();
assert(0); assert(0);
} }
@ -155,7 +150,6 @@ current_sandbox_init()
err: err:
debuglog("%s", error_message); debuglog("%s", error_message);
worker_thread_epoll_remove_sandbox(sandbox); worker_thread_epoll_remove_sandbox(sandbox);
generic_thread_dump_lock_overhead();
current_sandbox_exit(); current_sandbox_exit();
return NULL; return NULL;
} }
@ -179,7 +173,6 @@ done:
sandbox_set_as_returned(sandbox, SANDBOX_RUNNING_SYS); sandbox_set_as_returned(sandbox, SANDBOX_RUNNING_SYS);
/* Cleanup connection and exit sandbox */ /* Cleanup connection and exit sandbox */
generic_thread_dump_lock_overhead();
current_sandbox_exit(); current_sandbox_exit();
assert(0); assert(0);
err: err:

@ -28,13 +28,9 @@ generic_thread_initialize()
void void
generic_thread_dump_lock_overhead() generic_thread_dump_lock_overhead()
{ {
#ifndef NDEBUG
#ifdef LOG_LOCK_OVERHEAD
uint64_t duration = __getcycles() - generic_thread_start_timestamp; uint64_t duration = __getcycles() - generic_thread_start_timestamp;
debuglog("Locks consumed %lu / %lu cycles, or %f%%\n", generic_thread_lock_duration, duration, debuglog("Locks consumed %lu / %lu cycles, or %f%%\n", generic_thread_lock_duration, duration,
(double)generic_thread_lock_duration / duration * 100); (double)generic_thread_lock_duration / duration * 100);
debuglog("Longest Held Lock was %lu cycles, or %f quantums\n", generic_thread_lock_longest, debuglog("Longest Held Lock was %lu cycles, or %f quantums\n", generic_thread_lock_longest,
(double)generic_thread_lock_longest / ((uint64_t)runtime_processor_speed_MHz * runtime_quantum_us)); (double)generic_thread_lock_longest / ((uint64_t)runtime_processor_speed_MHz * runtime_quantum_us));
#endif
#endif
} }

@ -396,7 +396,6 @@ listener_thread_main(void *dummy)
on_client_socket_epoll_event(&epoll_events[i]); on_client_socket_epoll_event(&epoll_events[i]);
} }
} }
generic_thread_dump_lock_overhead();
} }
panic("Listener thread unexpectedly broke loop\n"); panic("Listener thread unexpectedly broke loop\n");

@ -287,12 +287,6 @@ log_compiletime_config()
pretty_print_key_disabled("Log HTTP Parser"); pretty_print_key_disabled("Log HTTP Parser");
#endif #endif
#ifdef LOG_LOCK_OVERHEAD
pretty_print_key_enabled("Log Lock Overhead");
#else
pretty_print_key_disabled("Log Lock Overhead");
#endif
#ifdef LOG_TENANT_LOADING #ifdef LOG_TENANT_LOADING
pretty_print_key_enabled("Log Tenant Loading"); pretty_print_key_enabled("Log Tenant Loading");
#else #else

Loading…
Cancel
Save