summaryrefslogtreecommitdiff
path: root/src/adaptor
diff options
context:
space:
mode:
authorManikandanC <Manikandan.Chockalingam@in.bosch.com>2017-10-06 11:37:31 +0530
committerChristoph Lipka <clipka@users.noreply.github.com>2018-11-30 12:17:59 +0100
commit73180fc762f015935950f697822710af3f5bd23d (patch)
treeffcd8407d8ab55d63544af33ade7efd120381728 /src/adaptor
parent13803189600c724341148af34f33688497d71991 (diff)
downloadDLT-daemon-73180fc762f015935950f697822710af3f5bd23d.tar.gz
Use poll in the dlt-daemon for POSIX compliance
The poll system call is now used in the daemon to enable DLT use in POSIX compliant systems. Also added introduced new unregister_app macro to avoid missing of logs in startup buffer. Signed-off-by: Frederic Berat <fberat@de.adit-jv.com> Signed-off-by: ManikandanC <Manikandan.Chockalingam@in.bosch.com> Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com> Signed-off-by: S. Hameed <shameed@jp.adit-jv.com>
Diffstat (limited to 'src/adaptor')
-rw-r--r--src/adaptor/dlt-adaptor-stdin.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/adaptor/dlt-adaptor-stdin.c b/src/adaptor/dlt-adaptor-stdin.c
index eae7000..aeca49b 100644
--- a/src/adaptor/dlt-adaptor-stdin.c
+++ b/src/adaptor/dlt-adaptor-stdin.c
@@ -92,11 +92,12 @@ int main(int argc, char* argv[])
char version[255];
int timeout = -1;
int verbosity = DLT_LOG_INFO;
+ int bflag = 0;
dlt_set_id(apid, PS_DLT_APP);
dlt_set_id(ctid, PS_DLT_CONTEXT);
- while ((opt = getopt(argc, argv, "a:c:ht:v:")) != -1)
+ while ((opt = getopt(argc, argv, "a:c:bht:v:")) != -1)
{
switch (opt)
{
@@ -110,6 +111,11 @@ int main(int argc, char* argv[])
dlt_set_id(ctid,optarg);
break;
}
+ case 'b':
+ {
+ bflag = 1;
+ break;
+ }
case 't':
{
timeout = atoi(optarg);
@@ -125,6 +131,7 @@ int main(int argc, char* argv[])
printf("Options:\n");
printf(" -a apid - Set application id to apid (default: SINA)\n");
printf(" -c ctid - Set context id to ctid (default: SINC)\n");
+ printf(" -b - Flush buffered logs before unregistering app\n");
printf(" -t timeout - Set timeout when sending messages at exit, in ms (Default: 10000 = 10sec)\n");
printf(" -v verbosity level - Set verbosity level (Default: INFO, values: FATAL ERROR WARN INFO DEBUG VERBOSE)\n");
printf(" -h - This help\n");
@@ -194,7 +201,15 @@ int main(int argc, char* argv[])
}
DLT_UNREGISTER_CONTEXT(mycontext);
- DLT_UNREGISTER_APP();
+
+ if (bflag == 1)
+ {
+ DLT_UNREGISTER_APP_FLUSH_BUFFERED_LOGS();
+ }
+ else
+ {
+ DLT_UNREGISTER_APP();
+ }
return 0;
}