From ecec9fbdcf2f0ace3c552a996191d74cabf05abf Mon Sep 17 00:00:00 2001 From: lyuxiaosu Date: Wed, 28 Jul 2021 13:21:27 -0500 Subject: [PATCH] 1. recover to w mode to fopen the perf log file. 2. enrich comments --- runtime/src/main.c | 2 +- runtime/src/worker_thread.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/runtime/src/main.c b/runtime/src/main.c index 6cb8cf2..e2101ce 100644 --- a/runtime/src/main.c +++ b/runtime/src/main.c @@ -222,7 +222,7 @@ runtime_configure() char *runtime_sandbox_perf_log_path = getenv("SLEDGE_SANDBOX_PERF_LOG"); if (runtime_sandbox_perf_log_path != NULL) { printf("\tSandbox Performance Log: %s\n", runtime_sandbox_perf_log_path); - runtime_sandbox_perf_log = fopen(runtime_sandbox_perf_log_path, "a+"); + runtime_sandbox_perf_log = fopen(runtime_sandbox_perf_log_path, "w"); if (runtime_sandbox_perf_log == NULL) { perror("sandbox perf log"); } fprintf(runtime_sandbox_perf_log, "id,function,state,deadline,actual,queued,initializing,runnable," "running,blocked,returned,memory\n"); diff --git a/runtime/src/worker_thread.c b/runtime/src/worker_thread.c index cd1c48d..4e5ea9a 100644 --- a/runtime/src/worker_thread.c +++ b/runtime/src/worker_thread.c @@ -54,8 +54,9 @@ worker_thread_main(void *argument) scheduler_runqueue_initialize(); - /* Initialize memory logging */ - mem_log_init2(1024*1024*1024, runtime_sandbox_perf_log); + /* Initialize memory logging, set 100M memory for logging */ + //mem_log_init2(1024*1024*1024, runtime_sandbox_perf_log); + mem_log_init2(1024, runtime_sandbox_perf_log); /* Initialize Completion Queue */ local_completion_queue_initialize();