platform/core/system/dlog.git
6 years agoRemove inplace KMSG parsing 33/173333/6
Michal Bloch [Tue, 20 Mar 2018 13:56:38 +0000 (14:56 +0100)]
Remove inplace KMSG parsing

KMSG messages were parsed in-place, which made the process fragile
and prone to break in case the log format was changed.

Change-Id: Ie3517e172806bd54cdb3164578065cf9ab848426
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agologconfig: Remove dead code 77/173977/3
Karol Lewandowski [Tue, 27 Mar 2018 08:49:19 +0000 (10:49 +0200)]
logconfig: Remove dead code

Remove functions that were created for dlogctrl
utility, removed from codebase in commit 06d8039.

Change-Id: I2ff44899e60abe58c5b7bc33d9eee90c0a1a1464

6 years agologger: inserting logs in ordered way to the buffers 01/172001/15
Adrian Szyndela [Thu, 1 Mar 2018 14:40:58 +0000 (15:40 +0100)]
logger: inserting logs in ordered way to the buffers

This commit introduces new storage for log entries.
It sorts incoming log entries by their time on the fly.

Change-Id: I4f498d67ca03950d0424fbb3fc28b9187e0bfe51

6 years agoMerge "logger: refactor print_out_logs - extracted for single log" into tizen
Michal Bloch [Tue, 27 Mar 2018 09:55:30 +0000 (09:55 +0000)]
Merge "logger: refactor print_out_logs - extracted for single log" into tizen

6 years agologger: refactor print_out_logs - extracted for single log 92/172892/7
Adrian Szyndela [Fri, 16 Mar 2018 13:35:32 +0000 (14:35 +0100)]
logger: refactor print_out_logs - extracted for single log

This patch extracts printing out of a single log entry
from print_out_logs() to a separate function
reader_print_out_single_log().

This is going to be used in further development.

Change-Id: I5ca8290e15bbda1b3512e5ac508b8d94827303eb

6 years agoutil: fix possible buffer overflows 31/173731/2 accepted/tizen/unified/20180327.055752 submit/tizen/20180326.100223
Maciej Slodczyk [Fri, 23 Mar 2018 11:42:49 +0000 (12:42 +0100)]
util: fix possible buffer overflows

Change-Id: I3f6b411fa03e9301f627e19f36c72546b58a7ab0

6 years agoMerge "shared: const correctness" into tizen
Michal Bloch [Tue, 20 Mar 2018 11:01:49 +0000 (11:01 +0000)]
Merge "shared: const correctness" into tizen

6 years agoMerge "Fix cast to enum" into tizen
Michal Bloch [Tue, 20 Mar 2018 11:01:34 +0000 (11:01 +0000)]
Merge "Fix cast to enum" into tizen

6 years agoshared: const correctness 90/172890/3
Michal Bloch [Fri, 16 Mar 2018 12:37:40 +0000 (13:37 +0100)]
shared: const correctness

An unneeded line was preventing a handful of functions from being const.

Change-Id: I34f288f828505f4fd1a133efaaf3cb1f0d7656e1
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agoFix cast to enum 94/172894/2
Michal Bloch [Fri, 16 Mar 2018 13:48:10 +0000 (14:48 +0100)]
Fix cast to enum

Checks against values outside the enum range are legal for the compiler
to optimize out, ergo they have to be done before the cast.

Change-Id: I3059b3a16e6331c3a3a1389f0a4acfbae1d3a16f
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agopackaging: Hardcode udev rules directory location to avoid cyclic dependency 56/172856/5 accepted/tizen/unified/20180317.125909 submit/tizen/20180316.145952
Karol Lewandowski [Fri, 16 Mar 2018 09:03:10 +0000 (10:03 +0100)]
packaging: Hardcode udev rules directory location to avoid cyclic dependency

DLog did build-depend on udev devel package, as it does provide information
where udev rules are located on the system in the form of RPM macros (_udevrulesdir).
udev is part of systemd, which caused libsystemd-devel package to be installed
for the build.

In situations where someone wants to use dlog in a library that is
required by systemd this would create a cyclic build dependency:
systemd -> dlog -> library -> systemd.

Change-Id: Ia8c929ccffe169bfcb08b84ad3d273b4edd38ab5

6 years agopackaging: fix path convention 79/172879/1
Michal Bloch [Fri, 16 Mar 2018 11:37:10 +0000 (12:37 +0100)]
packaging: fix path convention

Be safe and assume path macros do not necessarily end with '/'.

Change-Id: I5302500d92724b86e27ae782aa621456c5bb1ce7
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agoHandle payload sizes correctly 02/172402/2 accepted/tizen/unified/20180315.061335 submit/tizen/20180314.081437
Michal Bloch [Tue, 13 Mar 2018 13:34:04 +0000 (14:34 +0100)]
Handle payload sizes correctly

Change-Id: Ie809ace9b5463025caeefdbbda9d8d237bb318b9
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agoutil: add license to recently added files 92/172192/1
Michal Bloch [Mon, 12 Mar 2018 11:05:50 +0000 (12:05 +0100)]
util: add license to recently added files

Change-Id: Idb96f30717ae0a9e3274a09d903cfcd1e08e029f
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agoMerge "dlogutil: add pid and tid based filtering" into tizen
Karol Lewandowski [Thu, 8 Mar 2018 10:33:23 +0000 (10:33 +0000)]
Merge "dlogutil: add pid and tid based filtering" into tizen

6 years agodlogutil: add pid and tid based filtering 52/170252/15
Maciej Slodczyk [Thu, 15 Feb 2018 12:29:46 +0000 (13:29 +0100)]
dlogutil: add pid and tid based filtering

Add dlogutil command line options to specify pid and tid
list to be passed to daemon and filter log output by.

Change-Id: Icf233d8e01fec32a25ca2ec28791bf4e7642222f
Signed-off-by: Maciej Slodczyk <m.slodczyk2@partner.samsung.com>
6 years agoutil: standarize output destination 00/171400/6
Michal Bloch [Fri, 2 Mar 2018 09:12:14 +0000 (10:12 +0100)]
util: standarize output destination

Errors used to end up either in stdout or stderr without any apparent
pattern. All errors will now end up in stderr, with stdout being used
only for actual logs (or, in case of -g, the size).

Additionally, rename the _E and _D macros to ERR and DBG respectively
since there is a convention in application code that that these are
for sending logs to dlog itself.

Change-Id: Ie53fc55d4ad47a1d7cf28278d5b5392e58d9be1e
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agoutil: fix wrong errno being reported 39/171839/2
Michal Bloch [Wed, 7 Mar 2018 12:53:28 +0000 (13:53 +0100)]
util: fix wrong errno being reported

If an Android Logger ioctl failed, and then the debug message produced due to
this failure also failed, the errno reported would be the one from the debug,
not the one from the ioctl.

Change-Id: Iae1a3a40e20ebc6f4823252a111804a043665e02
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agoutil: don't consider -h an execution failure 38/171838/1
Michal Bloch [Wed, 7 Mar 2018 13:04:40 +0000 (14:04 +0100)]
util: don't consider -h an execution failure

Explicitly requesting help is no longer considered a program execution failure.
Being shown the help due to invalid parameters is still considered a failure.

Change-Id: Iacfbbcd8249926ec9607dee84299ea48c5aa13f3
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agoFix typing error 26/171526/2
lokilee73 [Mon, 5 Mar 2018 09:18:54 +0000 (18:18 +0900)]
Fix typing error

Change-Id: Id541effe76d4aec610f2105a14522531d15cb1d5
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
6 years agoutil: handle epoll fd correctly 04/171204/1
Michal Bloch [Tue, 27 Feb 2018 11:19:04 +0000 (12:19 +0100)]
util: handle epoll fd correctly

Handle creation failure and close after use.

Change-Id: Iafaf888e18183f09ea9990c535cdec1ff9fd4f50
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agoutil: fix premature exit in dump mode 01/171201/1
Michal Bloch [Tue, 27 Feb 2018 09:43:21 +0000 (10:43 +0100)]
util: fix premature exit in dump mode

The program would end when epoll reported no ready file descriptors.
This was incorrect as data could still be awaiting to be put into
the fd when dlogutil read data from a pipe faster than dlog_logger
could feed it. Android Logger relied on this behaviour to exit when
there were no logs to read as there would not be a read() to trigger
the exit through its regular "log_len quota filled" exit path, but is
otherwise unaffected.

Change-Id: I58abc94dba9d161de684a73fe585b3efa764d0f8
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agoutil: workaround an Android Logger driver bug 07/171107/1
Michal Bloch [Mon, 26 Feb 2018 13:35:59 +0000 (14:35 +0100)]
util: workaround an Android Logger driver bug

GET_LOG_LEN always returns as if the connection were using protocol version 2,
even if the connection is actually using version 1. Since read does not suffer
from this problem, there is a mismatch between the total sum accumulated over
multiple reads and value reported by GET_LOG_LEN, which results in more logs
being read than is necessary. The reason it appears to work correctly when no
extra logs are present to make up the difference is that util also ends when
epoll returns zero ready file descriptors, which is an incorrect behaviour as
it can happen even with more data awaiting, for example when dlog_logger daemon
cannot keep up and fills a pipe slower than util can read it.

Change-Id: I3e48cedbc4a73d778316c1ebfeb555aa97e7d8b3
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agoMerge "replace inplace android log entry parsing" into tizen
Michal Bloch [Thu, 22 Feb 2018 13:42:02 +0000 (13:42 +0000)]
Merge "replace inplace android log entry parsing" into tizen

6 years agoreplace inplace android log entry parsing 29/170129/7
Maciej Slodczyk [Tue, 13 Feb 2018 12:25:15 +0000 (13:25 +0100)]
replace inplace android log entry parsing

android_logger_entry was parsed to logger_entry inplace
and caused problems when the latter was extended. Allocate
separate memory for each other so that they don't overlap.

Change-Id: I9ec9c47b9709e3a1c5a6deba5da97a91be6492db
Signed-off-by: Maciej Slodczyk <m.slodczyk2@partner.samsung.com>
6 years agoutil: minor mainloop refactor 56/170256/3
Michal Bloch [Thu, 15 Feb 2018 13:03:49 +0000 (14:03 +0100)]
util: minor mainloop refactor

Change-Id: Ia02b4866857eb0328eb6a22a53fc2986e6046265
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agoutil: getsize now asks the appropriate device 62/166562/27
Michal Bloch [Thu, 8 Feb 2018 14:58:16 +0000 (15:58 +0100)]
util: getsize now asks the appropriate device

Additionally, the GETSIZE request now explicitly uses a 32 bit type
so that the protocol does not leave the width undefined.

Change-Id: I1189f2734c670ee68ca76448b8efc410939df952
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agoutil: unify external request handling 49/168449/17
Michal Bloch [Thu, 8 Feb 2018 14:16:32 +0000 (15:16 +0100)]
util: unify external request handling

Change-Id: I3b970acba37904c9a175185a68c0c0820d44f27b
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agoutil: add buffer ops 61/166561/23
Michal Bloch [Thu, 8 Feb 2018 13:12:09 +0000 (14:12 +0100)]
util: add buffer ops

Change-Id: Id0fee76de71e46565afde89afaf906d3f11a34b7
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agoMerge "Improve filtering capabilities of filterspecs" into tizen
Karol Lewandowski [Fri, 9 Feb 2018 14:07:41 +0000 (14:07 +0000)]
Merge "Improve filtering capabilities of filterspecs" into tizen

6 years agoImprove filtering capabilities of filterspecs 62/168862/4
Radoslaw Bartosiak [Wed, 31 Jan 2018 12:56:06 +0000 (13:56 +0100)]
Improve filtering capabilities of filterspecs

Add tag prefix specifier (prefix*) to show messages
    with tags starting with given prefix
Add equals specifier (=E) to show only given priority messages

Change-Id: I85ad96b13da20f8c11ce28dacbeea179b39f1f1b
Signed-off-by: Radoslaw Bartosiak <r.bartosiak@samsung.com>
6 years agoutil: handle filters correctly 67/169167/8
Michal Bloch [Wed, 7 Feb 2018 19:06:18 +0000 (20:06 +0100)]
util: handle filters correctly

 * for pipe-backend, do not create a filter locally as the daemon
   already does that.
 * do not disable sorting based on filter count as it is orthogonal
   to sorting (it is possible for many processes to share a tag).

Change-Id: I21932344861b3c8d418e39c569ace62e8cb454c0
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agoutil: extract fd_info to subfiles 53/163853/5
Michal Bloch [Wed, 7 Feb 2018 16:09:33 +0000 (17:09 +0100)]
util: extract fd_info to subfiles

Change-Id: I79569ea5bd91cc23a6b9a168f66de337a518a6f1
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agoutil: extract sort_vector to a separate file 80/169580/3
Michal Bloch [Wed, 7 Feb 2018 15:30:00 +0000 (16:30 +0100)]
util: extract sort_vector to a separate file

Change-Id: Id18abbaefc2ca317802944ebebb6a1c150071ca4
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agoMerge "packaging: fix post-script requirements" into tizen
Karol Lewandowski [Thu, 8 Feb 2018 11:26:05 +0000 (11:26 +0000)]
Merge "packaging: fix post-script requirements" into tizen

6 years agoMerge "Fix missing nullptr check after call to malloc" into tizen
Michal Bloch [Thu, 8 Feb 2018 11:09:16 +0000 (11:09 +0000)]
Merge "Fix missing nullptr check after call to malloc" into tizen

6 years agoMerge "shared: add a way to receive control msg reply" into tizen
Michal Bloch [Thu, 8 Feb 2018 10:55:40 +0000 (10:55 +0000)]
Merge "shared: add a way to receive control msg reply" into tizen

6 years agoMerge "Fix variable shadowing." into tizen
Michal Bloch [Thu, 8 Feb 2018 10:55:09 +0000 (10:55 +0000)]
Merge "Fix variable shadowing." into tizen

6 years agoFix missing nullptr check after call to malloc 77/169677/1
Radoslaw Bartosiak [Thu, 8 Feb 2018 07:42:45 +0000 (08:42 +0100)]
Fix missing nullptr check after call to malloc

Change-Id: If4753a68897e2780b162c22bee6a9c2b0b826cb6
Signed-off-by: Radoslaw Bartosiak <r.bartosiak@samsung.com>
6 years agoFix a missing header include 85/169585/1
Michal Bloch [Wed, 7 Feb 2018 17:39:14 +0000 (18:39 +0100)]
Fix a missing header include

`[f]printf` requires `stdio.h`

Change-Id: I80437216477480abcf3511b4b77f5a29aeea2bb9
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agoFix variable shadowing. 79/169579/1
Michal Bloch [Wed, 7 Feb 2018 15:04:31 +0000 (16:04 +0100)]
Fix variable shadowing.

Change-Id: Icb88cd9a624d0f1e85e784d716898b291c3b9608
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agoshared: add a way to receive control msg reply 88/168588/5
Michal Bloch [Mon, 29 Jan 2018 10:26:35 +0000 (11:26 +0100)]
shared: add a way to receive control msg reply

Change-Id: Ice96f49aaf8982c73747c05e351a16abcabec15e
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agopackaging: fix post-script requirements 97/169297/2
Michal Bloch [Mon, 5 Feb 2018 15:39:08 +0000 (16:39 +0100)]
packaging: fix post-script requirements

Change-Id: I4034d0affd64f73de37ceb74c317125bec6765fa
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agoFix a missing header include 54/169154/1
Michal Bloch [Fri, 2 Feb 2018 13:02:49 +0000 (14:02 +0100)]
Fix a missing header include

`int32_t` requires `stdint.h`.

Change-Id: Ibdbadcdd6ead5f3e2c32a8cc46b4ee85edcd337c
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agoRelease 0.7 17/168417/4 accepted/tizen/unified/20180130.144314 submit/tizen/20180126.113307 submit/tizen/20180129.121012
Karol Lewandowski [Fri, 26 Jan 2018 09:05:24 +0000 (10:05 +0100)]
Release 0.7

This release brings numerous changes and incompatibilities, including:

 - incompatible change of dlogutil->dlog_loggger protocol (to be able
   to signal errors),

 - server will now drop privileges automatically to log:log
   (user:group), consequently --no-drop-privileges cmd line option and
   "owner" fields in configs have been dropped,

 - backend configuration files moved to dlog.conf.d, allowing to
   remove hacky %post* scripts.

Additionally:

 - logsend enhancements - send each message multiple times; print stats,

 - new GETSIZE command support in server to get buffer size from util
   added,

 - libdlog code unification (with no functional change),

 - change in util behaviour - it will now warn if specified buffer is
   unavailable,

 - moved configuration options to configure.ac,

 - cleaned up packaging.

Lastly, update autoconf.ac with current contact points and add
AUTHORS, listing known major contributors.

Change-Id: I4d14790d54b0b1adab0398fc5f9b00466ce7bfb1

6 years agologutil: warn when it was not possible to access specified buffer 19/168319/5
Karol Lewandowski [Thu, 25 Jan 2018 13:55:45 +0000 (14:55 +0100)]
logutil: warn when it was not possible to access specified buffer

Additionally, fail if it wasn't to possible to access at least one buffer.

Change-Id: I4ff103b119b57d726f9ed3475d23f180c7236dc5

6 years agoRework per-backend package setup 00/129500/10
Karol Lewandowski [Tue, 23 Jan 2018 15:22:14 +0000 (16:22 +0100)]
Rework per-backend package setup

This commit makes dlog use of the new "dlog.conf.d" extensible
configuration mechanism to select desired backend by installing
appropriate configuration to (/opt/)etc/dlog.conf.d.

Change-Id: I4a0db1ac3a6d708a457edb0b232f9a540cb54378

6 years agoMerge "Pass configuration paths directly from configure" into tizen
Karol Lewandowski [Fri, 26 Jan 2018 10:55:40 +0000 (10:55 +0000)]
Merge "Pass configuration paths directly from configure" into tizen

6 years agoMerge "libdlog: Unify common parts of dlog API" into tizen
Karol Lewandowski [Fri, 26 Jan 2018 10:55:34 +0000 (10:55 +0000)]
Merge "libdlog: Unify common parts of dlog API" into tizen

6 years agoPass configuration paths directly from configure 37/168037/3
Karol Lewandowski [Tue, 23 Jan 2018 15:20:11 +0000 (16:20 +0100)]
Pass configuration paths directly from configure

This change removes duplicated definitions of paths,
that are now defined in just one place - configure.ac.

Change-Id: If759c41ba32b4ed728bbf9f98b46bcdfbac57715

6 years agolibdlog: Unify common parts of dlog API 42/167842/4
Karol Lewandowski [Thu, 25 Jan 2018 14:37:41 +0000 (15:37 +0100)]
libdlog: Unify common parts of dlog API

This commit reworks logic behind (__)dlog_(v)print
family of functions, removing copy paste code.

Change-Id: I76cdb39c6831c325427383f00f027bb4d6fe27bf

6 years agoMerge "util: extract getopt from main" into tizen
Michal Bloch [Wed, 24 Jan 2018 12:19:45 +0000 (12:19 +0000)]
Merge "util: extract getopt from main" into tizen

6 years agoMerge "logsend: send each message multiple times; print statistics" into tizen
Michal Bloch [Wed, 24 Jan 2018 10:39:21 +0000 (10:39 +0000)]
Merge "logsend: send each message multiple times; print statistics" into tizen

6 years agologsend: send each message multiple times; print statistics 90/167990/5
Adrian Szyndela [Tue, 23 Jan 2018 08:33:10 +0000 (09:33 +0100)]
logsend: send each message multiple times; print statistics

This commit adds two simple features:
1. Sending each message multiple times.
This is aimed to help with testing dlog performance;
2. Printing statistics.
Prints time taken by each sending operation.

Change-Id: I1c1dc935ea93e7e1ea9aa5cbbc5c4399c2efb171

6 years agolibdlog: Add missing static for __dlog_fatal_assert 41/167841/1
Karol Lewandowski [Mon, 22 Jan 2018 09:29:03 +0000 (10:29 +0100)]
libdlog: Add missing static for __dlog_fatal_assert

Change-Id: I7d571900947c3c6a456900d8ce3e91d94c981a42

6 years agospec: change uid, gid and permision of /usr/lib/tmpfiles.d/dlog-run.conf 48/167348/2
INSUN PYO [Wed, 17 Jan 2018 07:08:22 +0000 (16:08 +0900)]
spec: change uid, gid and permision of /usr/lib/tmpfiles.d/dlog-run.conf

Signed-off-by: INSUN PYO <insun.pyo@samsung.com>
Change-Id: I7ae8d05b0c03871117bcc790557012b7a4dc0791

6 years agologger: Drop privileges to build-time settings as early as possible 14/167614/4
Karol Lewandowski [Thu, 18 Jan 2018 15:55:21 +0000 (16:55 +0100)]
logger: Drop privileges to build-time settings as early as possible

Change-Id: If8972bcb5e9c7bfbc13c5ff88e45f0acfa4f1546

6 years agologger: Drop ability to specify sockets' owner and group 13/167613/2
Karol Lewandowski [Thu, 18 Jan 2018 15:47:57 +0000 (16:47 +0100)]
logger: Drop ability to specify sockets' owner and group

Server will run with reduced privileges and changing these
will not be possible anymore.

Change-Id: Ie26b888ab6366196f9008133b2efbad0a51344ae

6 years agoRevert "logger: add --no-drop-privileges" and partially "logger: set starting credent... 12/167612/2
Karol Lewandowski [Thu, 18 Jan 2018 15:40:10 +0000 (16:40 +0100)]
Revert "logger: add --no-drop-privileges" and partially "logger: set starting credentials to log:log"

This reverts commit 4ab20e23751ab0da5abbeee8be338844139c05c6.

Additionally, it reverts parts of 0fc4cf8f874c3ace41f9b5de4e0347a8c738ef43,
which added --no-drop-privileges flag.  This is done once to avoid
dlog_server failing to start .

Change-Id: I1050f24b1f001e2667f030e375eaf55a3ec8c714

6 years agologger: Move dlog_logger's user and group definition to one place 11/167611/2
Karol Lewandowski [Thu, 18 Jan 2018 15:36:05 +0000 (16:36 +0100)]
logger: Move dlog_logger's user and group definition to one place

It's now possible to set with which user and group dlog_server will
run using configure's --enable-server-user= and --enable-server-group=
options.

Change-Id: I5f4e1605280c80dfa143856c87a852ebf96a9e7c

6 years agoMove service configuration under control of automake 10/167610/1
Karol Lewandowski [Thu, 18 Jan 2018 11:52:26 +0000 (12:52 +0100)]
Move service configuration under control of automake

This is necessary service configuration and it needs
to be kept together with rest of dlog.  Additionally,
it will be needed in further commits to pre-process
the service files according to ./configure flags/conf.

Change-Id: Ia52d395406135c9a14310e2fad5d9d653e472968

6 years agodlog_logger: service: Drop invalid dloginit.service reference 09/167609/1
Karol Lewandowski [Thu, 18 Jan 2018 11:33:51 +0000 (12:33 +0100)]
dlog_logger: service: Drop invalid dloginit.service reference

dloginit.service was used with kmsg backed, which was removed in commit
29550842a ("[4.0] kmsg-backend removed").

Change-Id: I9905eceb0082a8f1fb3ed5189d7325e745274fa7

6 years agopackaging: Drop duplicate manifest files 08/167608/1
Karol Lewandowski [Thu, 18 Jan 2018 11:25:38 +0000 (12:25 +0100)]
packaging: Drop duplicate manifest files

Change-Id: I930622898dde9566af7e0daed1ff3f4fd548bbf4

6 years agologger: add get size request 82/166082/5
Michal Bloch [Fri, 5 Jan 2018 16:17:48 +0000 (17:17 +0100)]
logger: add get size request

Change-Id: I082213f0b46d24583d3cd0ae9208e32001552246
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agologger: always reply to pipe requests 42/166342/3
Michal Bloch [Fri, 12 Jan 2018 15:49:19 +0000 (16:49 +0100)]
logger: always reply to pipe requests

Even on failure

Change-Id: Ifc69fc0161fa236fbc27eb5e823969d1d2edf0bf
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agoRefactor control messages 41/166341/3
Michal Bloch [Tue, 9 Jan 2018 10:20:02 +0000 (11:20 +0100)]
Refactor control messages

 * remove flags (present implicitly, unused explicitly)
 * add request result

Change-Id: Ib751ddf85e9aec9286dda78cf27cc2aad8fcb8d3
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agoutil: extract getopt from main 80/166080/3
Michal Bloch [Fri, 5 Jan 2018 14:14:37 +0000 (15:14 +0100)]
util: extract getopt from main

Change-Id: I66f219bf5324fc5ade188afe060598379ac82a34
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agoMerge "New pipe input format to reduce redundancy" into tizen
Karol Lewandowski [Fri, 5 Jan 2018 13:26:40 +0000 (13:26 +0000)]
Merge "New pipe input format to reduce redundancy" into tizen

6 years agoNew pipe input format to reduce redundancy 83/162983/10
Michal Bloch [Wed, 6 Dec 2017 15:10:33 +0000 (16:10 +0100)]
New pipe input format to reduce redundancy

The new format does not send (ignored) reception timestamps.

Change-Id: Iaa804253552d080254a5dd1a4c72913e5a9b9d09
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agoAdd Capabilities=cap_syslog=i for dlog_logger 86/164986/2 accepted/tizen/unified/20171226.063446 submit/tizen/20171222.082515
Hyotaek Shim [Fri, 22 Dec 2017 07:13:03 +0000 (16:13 +0900)]
Add Capabilities=cap_syslog=i for dlog_logger

When CONFIG_SECURITY_DMESG_RESTRICT is enabled in the kernel(/dev/kmsg),
CAP_SYSLOG is required for access.

Change-Id: I65d6a682f25020ed34a1d0972551633d1b9f1730
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
6 years agologger: set starting credentials to log:log 80/164080/4
Michal Bloch [Tue, 19 Dec 2017 11:14:34 +0000 (12:14 +0100)]
logger: set starting credentials to log:log

Change-Id: I03094e9f0b90a07c5ded7789ecd061021523d270
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agologger: add --no-drop-privileges 16/164516/3
Michal Bloch [Tue, 19 Dec 2017 10:32:56 +0000 (11:32 +0100)]
logger: add --no-drop-privileges

For use when the daemon is not run as root.

Change-Id: I8060f70105bfce6cc5439c1e2aae6493a53cd339
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agodlogsend: add logging from standard input 04/163604/7
Dawid Kuczma [Tue, 12 Dec 2017 09:44:34 +0000 (10:44 +0100)]
dlogsend: add logging from standard input

Use
dlogsend
dlogsend --
to log from standard input.

Change-Id: If8f1ae86f9a0e67f941a47fc93c18e11b84be247

6 years agoconfig: remove syslog log source 61/162461/2
Michal Bloch [Fri, 1 Dec 2017 10:07:28 +0000 (11:07 +0100)]
config: remove syslog log source

Currently syslog handling is disabled in the daemon,
because it is not needed in Tizen.

Change-Id: Id8b446d9c336622adb29706eb593f08e10105560
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agologger: use named pipes w/ User::App:Shared label 07/160907/3 accepted/tizen/unified/20171130.063200 submit/tizen/20171127.230418
Michal Bloch [Wed, 15 Nov 2017 14:57:36 +0000 (15:57 +0100)]
logger: use named pipes w/ User::App:Shared label

Unnamed pipes use the daemon's label which is `System::Run`,
preventing dlogutil from accessing them when ran without root.

Change-Id: I2f58b6bf0fb1572bfffdf5fe74b9596ee40688d9
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agoutil: remove unused variables 80/158880/1
Michal Bloch [Fri, 3 Nov 2017 15:40:28 +0000 (16:40 +0100)]
util: remove unused variables

Change-Id: Ic1aacc425325374a72fb8199f3b69581f3370118
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agoMerge "Extract log pushing out of the main loop." into tizen
Karol Lewandowski [Fri, 3 Nov 2017 09:58:02 +0000 (09:58 +0000)]
Merge "Extract log pushing out of the main loop." into tizen

6 years agoMerge "fcntl SETFL wrappers return the error value" into tizen
Karol Lewandowski [Fri, 3 Nov 2017 09:57:13 +0000 (09:57 +0000)]
Merge "fcntl SETFL wrappers return the error value" into tizen

6 years agoCoverity fixes. 14/158014/4
INSUN PYO [Fri, 27 Oct 2017 07:44:02 +0000 (16:44 +0900)]
Coverity fixes.

Signed-off-by: INSUN PYO <insun.pyo@samsung.com>
Change-Id: Ie70d8bfb57ee7be291f326b3a5cafb26d9d79907

6 years agoExtract log pushing out of the main loop. 78/158078/1
Michal Bloch [Fri, 27 Oct 2017 15:54:34 +0000 (17:54 +0200)]
Extract log pushing out of the main loop.

Change-Id: Ic9ebb1eee62f08e612ca9b3f70288784e193ad9c
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agofcntl SETFL wrappers return the error value 33/158033/2
Michal Bloch [Fri, 27 Oct 2017 10:22:17 +0000 (12:22 +0200)]
fcntl SETFL wrappers return the error value

Change-Id: I401a22f30707b8cc0643c6d26cb22620ab7b5bd9
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agoMerge changes I99afed7f,Ib0dacc9f into tizen
Karol Lewandowski [Fri, 27 Oct 2017 12:02:35 +0000 (12:02 +0000)]
Merge changes I99afed7f,Ib0dacc9f into tizen

* changes:
  Fix string null termination.
  Replace a magic constant.

6 years agoMerge "logger: type correctness" into tizen
Karol Lewandowski [Fri, 27 Oct 2017 12:01:54 +0000 (12:01 +0000)]
Merge "logger: type correctness" into tizen

6 years agoMerge "Fix a documentation generation warning" into tizen
Karol Lewandowski [Fri, 27 Oct 2017 12:01:36 +0000 (12:01 +0000)]
Merge "Fix a documentation generation warning" into tizen

6 years agoCoverity fixes. 71/157971/2
INSUN PYO [Fri, 27 Oct 2017 04:58:14 +0000 (13:58 +0900)]
Coverity fixes.

Signed-off-by: INSUN PYO <insun.pyo@samsung.com>
Change-Id: I2db14f6046ad3d65bab4a720b19e0577e1e02aed

6 years agologger: type correctness 67/144967/16
Michal Bloch [Wed, 13 Sep 2017 11:59:29 +0000 (13:59 +0200)]
logger: type correctness

Reduce the amount of implicit type conversions for better type safety.

Change-Id: I534cdf16ddef6bf3b8e0b4a4a5d69814dcee9350
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agoFix string null termination. 06/157406/3
Michal Bloch [Tue, 24 Oct 2017 10:16:47 +0000 (12:16 +0200)]
Fix string null termination.

Change-Id: I99afed7f160f4839dd790ea2f989bb491e84223f
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agoReplace a magic constant. 67/157667/1
Michal Bloch [Wed, 25 Oct 2017 13:20:10 +0000 (15:20 +0200)]
Replace a magic constant.

Change-Id: Ib0dacc9f113b34298785d6fee1c1db3fb2ef50d8
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agoFix a documentation generation warning 40/157440/4
Michal Bloch [Tue, 24 Oct 2017 11:17:24 +0000 (13:17 +0200)]
Fix a documentation generation warning

Fixes "end of file while inside a group", accidentally
introduced in 0746fc5da519e290b67e96f75fc4c315fc44bd98

Change-Id: I00321fcff21b0dc24cbf48ef4c9546453269ec45
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agoMerge "logger: simplify signal handling" into tizen
Karol Lewandowski [Tue, 24 Oct 2017 10:23:43 +0000 (10:23 +0000)]
Merge "logger: simplify signal handling" into tizen

6 years agoMerge changes I6a86ce01,I03d9457d,I35d21d71,I39a487e8,I0e5cf156 into tizen
Karol Lewandowski [Tue, 24 Oct 2017 10:19:56 +0000 (10:19 +0000)]
Merge changes I6a86ce01,I03d9457d,I35d21d71,I39a487e8,I0e5cf156 into tizen

* changes:
  util: dynamic growth for the sorting container
  util: use dynamic containers for log source lists
  shared: expand the list interface
  util: change enabled buffer list to bitflags
  util: extract functions out of the main loop

6 years agoCoverity fix 12/155812/1 accepted/tizen/unified/20171019.145646 submit/tizen/20171019.034316
sanghyeok.oh [Mon, 16 Oct 2017 07:59:56 +0000 (16:59 +0900)]
Coverity fix

Change-Id: I872bc5ad2e838a72d5a6de7b68ea664c3d4d7410
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
6 years agoRemove `atoi_check_numeric` in favour of `sscanf` 29/153529/4
Michal Bloch [Thu, 28 Sep 2017 15:30:43 +0000 (17:30 +0200)]
Remove `atoi_check_numeric` in favour of `sscanf`

Let's not reinvent the wheel.

Change-Id: I75874d1c6c9cc0054def2e85525a28fbd2c227e8
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agoCoverity fix 49/154449/2
INSUN PYO [Tue, 10 Oct 2017 08:26:54 +0000 (17:26 +0900)]
Coverity fix

Signed-off-by: INSUN PYO <insun.pyo@samsung.com>
Change-Id: Ie31a0b06a8afb94c46ca59fdb75b0beef7241176

6 years agoutil: dynamic growth for the sorting container 06/150206/5
Michal Bloch [Thu, 14 Sep 2017 11:22:21 +0000 (13:22 +0200)]
util: dynamic growth for the sorting container

 * the sorting container now grows as needed
 * size parameters now set initial size

Change-Id: I6a86ce01702fe11186fd6b77559e38d50ef327ea
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agoutil: use dynamic containers for log source lists 02/153802/3
Michal Bloch [Fri, 29 Sep 2017 10:46:18 +0000 (12:46 +0200)]
util: use dynamic containers for log source lists

Fixes a crash when >16 --dumpfile passed.

Change-Id: I03d9457d66efbceb26fe2e1fb1809458d19f5693
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agoshared: expand the list interface 43/150443/4
Michal Bloch [Fri, 15 Sep 2017 13:20:24 +0000 (15:20 +0200)]
shared: expand the list interface

 * list_clear
 * list_at
 * list_next

Change-Id: I35d21d71e3af007222bee859d482265eb93726c3
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agoutil: change enabled buffer list to bitflags 89/149889/6
Michal Bloch [Wed, 27 Sep 2017 16:42:05 +0000 (18:42 +0200)]
util: change enabled buffer list to bitflags

Fixes a crash when >16 -b options are specified.

Change-Id: I39a487e80d25127515b98a39bfaa20a0f0d88310
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agoutil: extract functions out of the main loop 33/152633/2
Michal Bloch [Tue, 26 Sep 2017 13:38:03 +0000 (15:38 +0200)]
util: extract functions out of the main loop

Change-Id: I0e5cf15678b8886cbec7a65fbf3bbb0c64301d42
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agoFix SVACE issues. 21/152321/3
Michal Bloch [Fri, 22 Sep 2017 15:26:11 +0000 (17:26 +0200)]
Fix SVACE issues.

Change-Id: I0499a41c47fb89b333f2642b31c21272e9f4e993
Signed-off-by: Michal Bloch <m.bloch@samsung.com>