diff options
author | ManikandanC <Manikandan.Chockalingam@in.bosch.com> | 2017-05-22 10:57:21 +0530 |
---|---|---|
committer | Christoph Lipka <clipka@users.noreply.github.com> | 2018-12-10 15:40:58 +0100 |
commit | b2ce65d9947849160e04e751075c7fe4b5dcd158 (patch) | |
tree | 17bd0227f0d26d3557deecb83b026284975019a1 /include/dlt/dlt_user_macros.h | |
parent | ea836f6de185f32c14404950f5cfb2ebf084e1ca (diff) | |
download | DLT-daemon-b2ce65d9947849160e04e751075c7fe4b5dcd158.tar.gz |
Dynamic allocation of msg buffer
It is possible to change the default buffer size for log message creation via
environment variable:
export DLT_LOG_MSG_BUF_LEN=<value>
Instead of using a static buffer with size of 1390 bytes, the buffer is
allocated dynamically with the specified value.The max size is restricted to approx 65k.
Signed-off-by: Christoph Lipka <clipka@de.adit-jv.com>
Signed-off-by: ManikandanC <Manikandan.Chockalingam@in.bosch.com>
Diffstat (limited to 'include/dlt/dlt_user_macros.h')
-rw-r--r-- | include/dlt/dlt_user_macros.h | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/include/dlt/dlt_user_macros.h b/include/dlt/dlt_user_macros.h index d50b335..e1b1267 100644 --- a/include/dlt/dlt_user_macros.h +++ b/include/dlt/dlt_user_macros.h @@ -187,16 +187,13 @@ #else #define DLT_LOG(CONTEXT,LOGLEVEL,ARGS...) \ do { \ - if(dlt_user_is_logLevel_enabled(&CONTEXT,LOGLEVEL)==DLT_RETURN_TRUE) \ + DltContextData log_local; \ + int dlt_local; \ + dlt_local = dlt_user_log_write_start(&CONTEXT,&log_local,LOGLEVEL); \ + if (dlt_local == DLT_RETURN_TRUE) \ { \ - DltContextData log_local; \ - int dlt_local; \ - dlt_local = dlt_user_log_write_start(&CONTEXT,&log_local,LOGLEVEL); \ - if (dlt_local > 0) \ - { \ - ARGS; \ - (void)dlt_user_log_write_finish(&log_local); \ - } \ + ARGS; \ + (void)dlt_user_log_write_finish(&log_local); \ } \ } while(0) #endif @@ -219,16 +216,13 @@ #else #define DLT_LOG_ID(CONTEXT,LOGLEVEL,MSGID,ARGS...) \ do { \ - if(dlt_user_is_logLevel_enabled(&CONTEXT,LOGLEVEL)==DLT_RETURN_TRUE) \ + DltContextData log_local; \ + int dlt_local; \ + dlt_local = dlt_user_log_write_start_id(&CONTEXT,&log_local,LOGLEVEL,MSGID); \ + if (dlt_local == DLT_RETURN_TRUE) \ { \ - DltContextData log_local; \ - int dlt_local; \ - dlt_local = dlt_user_log_write_start_id(&CONTEXT,&log_local,LOGLEVEL,MSGID); \ - if (dlt_local > 0) \ - { \ - ARGS; \ - (void)dlt_user_log_write_finish(&log_local); \ - } \ + ARGS; \ + (void)dlt_user_log_write_finish(&log_local); \ } \ } while(0) #endif |