From 69f151633de0cf0d8d8258ea1fd41898db42c5dc Mon Sep 17 00:00:00 2001 From: Lukasz Kostyra Date: Mon, 27 Jul 2020 19:12:23 +0200 Subject: [PATCH] Don't look up pid/tid on YAGL_LOG_FUNC_SET YAGL_LOG_FUNC_SET looks into cur_ts global variable to read current PID/TID. Unforutnately on multithreaded app scenarios, this can cause a segmentation failure so was temporarily removed. Change-Id: I253c9e38545b98d47dcdcd485966c5a838145ffb Signed-off-by: Lukasz Kostyra --- hw/yagl/yagl_log.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/yagl/yagl_log.h b/hw/yagl/yagl_log.h index 8a8a7a5..4479108 100644 --- a/hw/yagl/yagl_log.h +++ b/hw/yagl/yagl_log.h @@ -123,10 +123,12 @@ bool yagl_log_is_enabled_for_func_tracing(void); } \ } while(0) +// TODO _yagl_log_current_pid/tid must be restored to proper form +// PID/TID must be read in a different way than via global cur_ts #define YAGL_LOG_FUNC_SET(func) \ const char* _yagl_log_current_func = #func; \ - yagl_pid _yagl_log_current_pid = (cur_ts ? cur_ts->ps->id : 0); \ - yagl_tid _yagl_log_current_tid = (cur_ts ? cur_ts->id : 0) + yagl_pid _yagl_log_current_pid = 0; \ + yagl_tid _yagl_log_current_tid = 0 #define YAGL_LOG_FUNC_ENTER(func, format, ...) \ YAGL_LOG_FUNC_SET(func); \ -- 2.7.4