summaryrefslogtreecommitdiff
path: root/src/lib/dlt_user.c
diff options
context:
space:
mode:
authorBui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>2020-07-03 16:15:59 +0700
committerSaya Sugiura <39760799+ssugiura@users.noreply.github.com>2021-01-06 09:27:28 +0900
commitb76a9ce272a9f4447e7cdff45bf6634b3ce4c4b9 (patch)
tree4188e0fe9248c63a4aa981b7f4e1befc68bd2feb /src/lib/dlt_user.c
parent88fe2fda4aadde540f860ef1255781eb3674454e (diff)
downloadDLT-daemon-b76a9ce272a9f4447e7cdff45bf6634b3ce4c4b9.tar.gz
libdlt: disable injection msg via env var
In order to disable injection message at dlt user, set DLT_DISABLE_INJECTION_MSG_AT_USER to any value. When injection message is disabled, libdlt won't poll any data from receiver. It means libdlt will ignore all data/messages from dlt-daemon. By default, variable is unset so that dlt users are able to handle data/messages from dlt-daemon. Signed-off-by: Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>
Diffstat (limited to 'src/lib/dlt_user.c')
-rw-r--r--src/lib/dlt_user.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/lib/dlt_user.c b/src/lib/dlt_user.c
index ec05cd2..f768065 100644
--- a/src/lib/dlt_user.c
+++ b/src/lib/dlt_user.c
@@ -784,6 +784,12 @@ DltReturnValue dlt_init_common(void)
}
}
+ dlt_user.disable_injection_msg = 0;
+ if (getenv(DLT_USER_ENV_DISABLE_INJECTION_MSG)) {
+ dlt_log(LOG_WARNING, "Injection message is disabled\n");
+ dlt_user.disable_injection_msg = 1;
+ }
+
if (dlt_buffer_init_dynamic(&(dlt_user.startup_buffer),
buffer_min,
buffer_max,
@@ -3573,9 +3579,10 @@ void dlt_user_housekeeperthread_function(__attribute__((unused)) void *ptr)
while (1) {
/* Check for new messages from DLT daemon */
- if (dlt_user_log_check_user_message() < DLT_RETURN_OK)
- /* Critical error */
- dlt_log(LOG_CRIT, "Housekeeper thread encountered error condition\n");
+ if (!dlt_user.disable_injection_msg)
+ if (dlt_user_log_check_user_message() < DLT_RETURN_OK)
+ /* Critical error */
+ dlt_log(LOG_CRIT, "Housekeeper thread encountered error condition\n");
/* Reattach to daemon if neccesary */
dlt_user_log_reattach_to_daemon();