提交环形缓冲区相关修改

This commit is contained in:
guo_peixu
2022-06-10 16:13:11 +08:00
parent 08fd550822
commit 65ed1c3a92
3 changed files with 34 additions and 20 deletions

View File

@@ -86,26 +86,26 @@ void call_logger(int log_num, int thread_num)
void *thread_logger(void *arg)
{
int thread_num = (int)(unsigned long long)arg;
printf("thread %d created! \n", thread_num);
call_logger(g_log_num, thread_num);
printf("thread %d finished! \n", thread_num);
return NULL;
int thread_num = (int)(unsigned long long)arg;
printf("thread %d created! \n", thread_num);
call_logger(g_log_num, thread_num);
printf("thread %d finished! \n", thread_num);
return NULL;
}
void sig_int_handler(int sig)
{
printf("ctrl+c recviced!\n");
MESA_destroy_runtime_log_handle(sample_handle);
MESA_destroy_runtime_log_handle(test_handle);
sample_handle = NULL;
test_handle = NULL;
if (g_mode == 2)
{
MESA_handle_runtime_log_destruction();
}
printf("%d thread write %d log using %ld us, avg speed %f /s, %ld -> %ld\n", g_thread_num, g_thread_num * g_log_num, g_end_time - g_start_time, ((float)(g_thread_num * g_log_num) / (float)(g_end_time - g_start_time)) * 1000000, g_start_time, g_end_time);
exit(0);
printf("ctrl+c recviced!\n");
MESA_destroy_runtime_log_handle(sample_handle);
MESA_destroy_runtime_log_handle(test_handle);
sample_handle = NULL;
test_handle = NULL;
if (g_mode == 2)
{
MESA_handle_runtime_log_destruction();
}
printf("%d thread write %d log using %ld us, avg speed %f /s, %ld -> %ld\n", g_thread_num, g_thread_num * g_log_num, g_end_time - g_start_time, ((float)(g_thread_num * g_log_num) / (float)(g_end_time - g_start_time)) * 1000000, g_start_time, g_end_time);
exit(0);
}
void sig_hup_handler(int sig)