platform/core/system/dlog.git
6 years agodlogutil --dumpfile: print error reason on failure 59/140259/6
Michal Bloch [Mon, 24 Jul 2017 08:16:20 +0000 (10:16 +0200)]
dlogutil --dumpfile: print error reason on failure

Change-Id: I999971b0bcbe23b160d158230de143f092a1e7dd
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agodlog binary file header format: standarize 11/141011/4
Michal Bloch [Thu, 27 Jul 2017 10:44:50 +0000 (12:44 +0200)]
dlog binary file header format: standarize

Made sure both dlogutil and dlog_logger use the same format of this file.

Change-Id: Idd27f733454ba48a38c62927704ee64cf78c64a9
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agoExit dlogutil on any --dumpfile failure 41/139841/10
Michal Bloch [Mon, 24 Jul 2017 08:12:07 +0000 (10:12 +0200)]
Exit dlogutil on any --dumpfile failure

Change-Id: I046871b0bcbe23b160d158230de143f092a1e7dd
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agodlogutil: free resources on exit 72/140572/9
Michal Bloch [Mon, 24 Jul 2017 13:30:40 +0000 (15:30 +0200)]
dlogutil: free resources on exit

Change-Id: I9756272b5614e352dc611ae362022c2bab5f3aee
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agoUtil flushing fix 67/139167/2
Michal Bloch [Wed, 12 Jul 2017 13:55:12 +0000 (15:55 +0200)]
Util flushing fix

When the sorting buffer is empty, only flush as many logs as needed
to make room for incoming ones. Previously the entire buffer would be
flushed, which was both a performance problem (the program would hang
and not read data while flushing) and a reduction of sort quality (as
recent logs were flushed as well).

Change-Id: I1b10c7286ab28e70438b82d60d69fad6c4f38df3
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agoMerge "Refactor vector operations into functions" into tizen
Rafal Pietruch [Thu, 27 Jul 2017 14:44:18 +0000 (14:44 +0000)]
Merge "Refactor vector operations into functions" into tizen

6 years agoMerge "dlogutil: refactor some globals into locals" into tizen
Rafal Pietruch [Thu, 27 Jul 2017 14:43:36 +0000 (14:43 +0000)]
Merge "dlogutil: refactor some globals into locals" into tizen

6 years agoRefactor vector operations into functions 34/140834/1
Michal Bloch [Wed, 26 Jul 2017 11:15:44 +0000 (13:15 +0200)]
Refactor vector operations into functions

Change-Id: I604bfdda6a8eeaf60dd5e0f58dfd01f86a77790b
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agodlogutil: refactor some globals into locals 11/140611/2
Michal Bloch [Tue, 25 Jul 2017 12:19:45 +0000 (14:19 +0200)]
dlogutil: refactor some globals into locals

Change-Id: Ida805b499e63c65d01c34fc338d73b60e2a4936a
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
6 years agoMerge "Fixes to binary log files" into tizen
Karol Lewandowski [Thu, 20 Jul 2017 12:46:31 +0000 (12:46 +0000)]
Merge "Fixes to binary log files" into tizen

6 years agoFixes to binary log files 36/139136/2
Michal Bloch [Fri, 14 Jul 2017 12:21:51 +0000 (14:21 +0200)]
Fixes to binary log files

 * fixed missing header in some circumstances
 * dlogutil no longer hangs whe reading those
 * made sure both the daemon and dlogutil use the same magic check constant

Change-Id: If4ae5e5fb255d6cab681a5e7785106925f19045c
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agoUse internal version of sd-daemon and drop libsystemd dependency 62/138962/2
Karol Lewandowski [Fri, 14 Jul 2017 10:42:10 +0000 (12:42 +0200)]
Use internal version of sd-daemon and drop libsystemd dependency

Needed due to external request for systemd to be able to log directly to dlog.
This change avoids creation of cyclic dependency that would be created in
that case.

Change-Id: I9c779f263e92f4f84b825d20e263296400fcbf05

7 years agoImport sd-daemon from systemd 61/138961/2
Karol Lewandowski [Fri, 14 Jul 2017 10:36:34 +0000 (12:36 +0200)]
Import sd-daemon from systemd

This commit import sd-daemon.[ch] directly from systemd,
commit 09812eb764b440651f3ff4cb5d37bd343f800560.

Change-Id: I9e4ea41da2218ba9ba8b02dceac41ed3ad3dda20

7 years agoMerge "send/recv pipe fd refactored" into tizen
Rafal Pietruch [Tue, 4 Jul 2017 10:32:30 +0000 (10:32 +0000)]
Merge "send/recv pipe fd refactored" into tizen

7 years agoMerge "logconfig: Simplify log_config_set API" into tizen
Rafal Pietruch [Tue, 4 Jul 2017 10:32:09 +0000 (10:32 +0000)]
Merge "logconfig: Simplify log_config_set API" into tizen

7 years agosend/recv pipe fd refactored 89/135489/3
Rafal Pietruch [Thu, 22 Jun 2017 11:58:04 +0000 (13:58 +0200)]
send/recv pipe fd refactored

 * send_pipe function moved to logcommon
 * close pipe fd outside send_pipe function
 * fd set/clear flags moved to logcommon
 * send/recv pipe common code extracted

Change-Id: Iba1e5e403c9759dc80631dcb7e82556cb540cb28

7 years agoPut testing programs in a package. 61/129961/9
Michal Bloch [Thu, 11 May 2017 08:57:50 +0000 (10:57 +0200)]
Put testing programs in a package.

 * testing binaries are now compiled
 * test_pipe.sh renamed to dlog_test_pipe
 * testing environment is now isolated

Change-Id: I4e63ffa741feb61882505af5fe87e8f902072c9d
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agologconfig: Simplify log_config_set API 73/129973/5
Karol Lewandowski [Fri, 9 Jun 2017 11:48:49 +0000 (13:48 +0200)]
logconfig: Simplify log_config_set API

Previously, logconfig provided push() function which only did
append new entry and set() which only did overwrite existing
entry.

This commit leaves only set() in public API, which does both
add & replace.  Original functions are hidden and available
for internal purpose only (modify, add).

Change-Id: Id5c735d3b2b9ca4f7a2dafd2879823fd42d3f56e

7 years agologutil: [bugfix] uninitialized reading offset 78/131978/4
Rafal Pietruch [Wed, 31 May 2017 08:36:50 +0000 (10:36 +0200)]
logutil: [bugfix] uninitialized reading offset

when creating struct fd_info for PIPE backend
the index field was not initialized causing
unpredictable behavior
thus the new function for the struct creation
was extracted to properly initialize the struct
anytime it is needed

Also:
* issue with possible allocation of 0 bytes was fixed
* strcmp used in case of strncmp where it makes no difference

Change-Id: Id791d3366b363da9a74a5eed6d2942219a3577c1

7 years agoMerge "Fix debug mode logic inversion" into tizen
Karol Lewandowski [Tue, 30 May 2017 08:18:58 +0000 (08:18 +0000)]
Merge "Fix debug mode logic inversion" into tizen

7 years agologger: fix -Werror=maybe-uninitialized 52/131152/2
Slava Barinov [Thu, 25 May 2017 12:54:37 +0000 (15:54 +0300)]
logger: fix -Werror=maybe-uninitialized

src/shared/logconfig.c:94:59: error: 'val' may be used uninitialized in this function [-Werror=maybe-uninitialized]

Change-Id: I581aee106c4d82dc8f5aa452be602e8b78fd87a2
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
7 years agoMerge "logger: introduce backend global config" into tizen
Karol Lewandowski [Fri, 26 May 2017 15:16:27 +0000 (15:16 +0000)]
Merge "logger: introduce backend global config" into tizen

7 years agoAdd dlogsend, a tool for sending dlog logs. 88/129988/14
Michal Bloch [Thu, 18 May 2017 15:27:46 +0000 (17:27 +0200)]
Add dlogsend, a tool for sending dlog logs.

Change-Id: I0de32470e04190e91d3eb8ac6dff7b0e7e3b8c50
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agoFix debug mode logic inversion 31/131331/2
Michal Bloch [Fri, 26 May 2017 10:21:11 +0000 (12:21 +0200)]
Fix debug mode logic inversion

If the debugmode file exists, access() returns 0 -> disabled debugmode.
Should be the other way around (disable debugmode if debugmode file does *not* exist).

Got accidentally broken in c1a7326e3ebf0f93e78c5d317ea7debe2fea207d

Change-Id: If9daeba158735759e2a8518ee25bfc722c147060
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agologger: introduce backend global config 64/131164/2
Rafal Pietruch [Thu, 25 May 2017 13:35:57 +0000 (15:35 +0200)]
logger: introduce backend global config

config is read once creation logger structures
when creating readers the config will not be read again
a backend and android logger devices are stored in global data
to access when are needed to create specific readers actions

Change-Id: I91a5bc2ef3dd4c86ea44b8314e3b1747739acc1b

7 years agoMerge changes Idd9c0d26,Iccb7ac50 into tizen
Karol Lewandowski [Thu, 25 May 2017 12:22:46 +0000 (12:22 +0000)]
Merge changes Idd9c0d26,Iccb7ac50 into tizen

* changes:
  logger: add readers waiting on pipe event
  logger: move writer/sock fd to fd_entity struct

7 years agoConform to Tizen coding rule. 17/129917/3
Michal Bloch [Thu, 18 May 2017 11:55:01 +0000 (13:55 +0200)]
Conform to Tizen coding rule.

Change-Id: I4ddd7c32b43f00f2095e0c6a40a9135781a93228
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agologger: add readers waiting on pipe event 23/130523/6
Rafal Pietruch [Tue, 23 May 2017 13:47:22 +0000 (15:47 +0200)]
logger: add readers waiting on pipe event

when printing logs using dlogutil there was lag
because of default 600ms timeout on epoll_wait
when no new logs were handled dlogutil waited
600ms every time a pipe it was connected with a server
become full

current solution resolves this problem by
adding readers waiting on pipe to the main epoll loop

Change-Id: Idd9c0d26e05b3341c6eef7085c661ffd7683358e

7 years agologger: move writer/sock fd to fd_entity struct 42/130742/4
Rafal Pietruch [Tue, 23 May 2017 13:45:20 +0000 (15:45 +0200)]
logger: move writer/sock fd to fd_entity struct

writers and sockets fds are registered in epoll loop
their fds are placed in the common fd_entity struct.
adding/removing fds to logger's epoll are redesigned
to reflect this pattern

free logger extra readers possible memory leak bugfix
and style minor changes

Change-Id: Iccb7ac50658494451290fa98ad170247a141099e

7 years agologger: use reader callback in case of reader type 72/129972/4
Rafal Pietruch [Wed, 17 May 2017 11:10:30 +0000 (13:10 +0200)]
logger: use reader callback in case of reader type

Change-Id: Ia894f31cacd0e2d8c831396c8a6c5309e44bb711

7 years agologger: use separate FD for file reader, bugfix 71/129971/2
Rafal Pietruch [Wed, 17 May 2017 10:45:25 +0000 (12:45 +0200)]
logger: use separate FD for file reader, bugfix

the buf_id field is not used for keeping file descriptor
new reader field read_fd is added to store this data
the buf_id specifies which buffer is used for reading
if buf_id is BUF_ID_INVALID the read_fd keeps file descriptor then

the read_fd is closed when reader_free is called
- resource leak bugfix

Change-Id: Ic321c48e6ef0d9f8946c72451d5b61bcbdabb1ff

7 years agologger: separate add reader to buffer function 41/129841/2
Rafal Pietruch [Mon, 15 May 2017 10:11:34 +0000 (12:11 +0200)]
logger: separate add reader to buffer function

Change-Id: I2d9a90bfdddea3ada81c543f31ba9b6d486b583b

7 years agologger: unify service reader functions 49/129649/7
Rafal Pietruch [Tue, 16 May 2017 15:21:11 +0000 (17:21 +0200)]
logger: unify service reader functions

Change-Id: Iab6f056e641261ef353b7fe804ce635d1ff4ef64

7 years agologger: use callbacks in case of entity type enum 91/129491/8
Rafal Pietruch [Tue, 16 May 2017 13:58:16 +0000 (15:58 +0200)]
logger: use callbacks in case of entity type enum

Change-Id: Ibbc0447ebcb57e3d4a05c0ba09a8fe41ea2bd747

7 years agologger: unify writer creation 90/129490/3
Rafal Pietruch [Tue, 16 May 2017 11:39:54 +0000 (13:39 +0200)]
logger: unify writer creation

Change-Id: Icc97d331efddc52c4df8f1be09cbd8d3ca7e8883

7 years agoMerge "packaging: Remove unused manifest file" into tizen
Rafal Pietruch [Wed, 17 May 2017 10:47:18 +0000 (10:47 +0000)]
Merge "packaging: Remove unused manifest file" into tizen

7 years agopackaging: Remove unused manifest file 99/129499/1
Karol Lewandowski [Tue, 16 May 2017 14:23:53 +0000 (16:23 +0200)]
packaging: Remove unused manifest file

Commit 29550842a ("[4.0] kmsg-backend removed") removed extended kmsg
support, but missed manifest file for kmsg backend package.

This commit removes this now-unused manifest file.

Change-Id: I16b8db8aea4132bfebbda6891f89f5f0c8976039

7 years agoMerge "Remove needless ad-hoc epoll" into tizen
Karol Lewandowski [Tue, 16 May 2017 13:57:07 +0000 (13:57 +0000)]
Merge "Remove needless ad-hoc epoll" into tizen

7 years agoFix dlogutil -d under Android Logger backend 59/127759/3
Michal Bloch [Fri, 28 Apr 2017 13:12:35 +0000 (15:12 +0200)]
Fix dlogutil -d under Android Logger backend

Util would keep reading as long as any data was in the buffer,
so if data came faster than it was processed then it would be
working indefinitely.

Now, it learns how many logs are present right at the start
by sending a get length request and only reads that many.

Change-Id: Idcfc7b10776ff93c85f16b335dad36d12bf5cd8e
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agoFix uninitialized variables. 79/127479/8
Michal Bloch [Wed, 26 Apr 2017 18:47:18 +0000 (20:47 +0200)]
Fix uninitialized variables.

Change-Id: I59455794f050aff9b92334243cee797ac745831d
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agoMerge "logger: redundant function argument removed" into tizen
Karol Lewandowski [Tue, 16 May 2017 11:08:52 +0000 (11:08 +0000)]
Merge "logger: redundant function argument removed" into tizen

7 years agoRemove needless ad-hoc epoll 50/128850/2
Michal Bloch [Thu, 11 May 2017 13:45:15 +0000 (15:45 +0200)]
Remove needless ad-hoc epoll

Previously, handling a reader caused an ad-hoc epoll fd to be created
just for the duration of the handling function. This is very wasteful
and the daemon would become sluggish.

The epoll was originally put in place because the pipes used to be
blocking. When pipes became nonblocking it was left alone on the
grounds that it's more efficient not to attempt doing writes that
the pipe is not ready to accept. While true, this is completely
subverted by recreating the epoll fd on every function call.

Change-Id: I9a886ca6613bb6786e01a2a7b5508c075d5b231d
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agoFix dlogutil -d on Pipe backend. 62/127762/2
Michal Bloch [Fri, 28 Apr 2017 19:23:48 +0000 (21:23 +0200)]
Fix dlogutil -d on Pipe backend.

Dumping readers now only receive logs that were present in the buffer
when the reader was created.

Change-Id: I3c3102c33633604d87d70c7c8b2b0ec1bf3c703c
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agologger: redundant function argument removed 84/129184/1
Rafal Pietruch [Mon, 15 May 2017 09:21:31 +0000 (11:21 +0200)]
logger: redundant function argument removed

buffer_append function gets log_buffer pointer
every log_buffer has its readers list pointer
so there is no need to include it in arguments

Change-Id: Id44f1091441a6fe3bee405297a094c362e883d6a

7 years agoMerge "Sort config entries alpha-numerically." into tizen accepted/tizen/4.0/unified/20170816.013150 accepted/tizen/unified/20170428.033057 submit/tizen-tizen-tizen/20170427.133758 submit/tizen/20170427.134121 submit/tizen_4.0/20170811.094300 tizen_4.0.m1_release
Karol Lewandowski [Thu, 27 Apr 2017 13:29:57 +0000 (13:29 +0000)]
Merge "Sort config entries alpha-numerically." into tizen

7 years agoSort config entries alpha-numerically. 60/126660/6
Michal Bloch [Fri, 21 Apr 2017 18:27:28 +0000 (20:27 +0200)]
Sort config entries alpha-numerically.

Change-Id: I4b64324243d15bd9b04787df383856de81e55686
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agoFix EAGAIN properly. 87/126687/2
Michal Bloch [Mon, 24 Apr 2017 16:58:40 +0000 (18:58 +0200)]
Fix EAGAIN properly.

The previous patch already produces the correct behaviour;
this just ensures correctness in case calling code changes.

Change-Id: Ibc514ac31dcb02462d5b6755d1765652a342dfa5
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agologger: handle EAGAIN properly for nonblocking fds 72/126672/2
Karol Lewandowski [Mon, 24 Apr 2017 14:18:08 +0000 (16:18 +0200)]
logger: handle EAGAIN properly for nonblocking fds

Reading non-blocking /dev/log_* returns -EINVAL when there is no
data available.  This commit fixes the service_reader_file() to
handle this situation gracefully.

Change-Id: I488361adeb11ea59719d645051e5a3f3173b6525

7 years agoSplit change_flags into set and clear. 78/125978/5
Michal Bloch [Wed, 12 Apr 2017 19:44:57 +0000 (21:44 +0200)]
Split change_flags into set and clear.

Change-Id: I02878434720f92f83a5c3682b305654e60ca7be1
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agoadded syslog message parser 30/120830/22
Rafal Pietruch [Fri, 24 Mar 2017 08:34:44 +0000 (09:34 +0100)]
added syslog message parser

Change-Id: I7a6d986f8504e1d979779a061e8b0da29e4dfaff

7 years agoadded syslog logging buffer to dlog 78/118478/26
Rafal Pietruch [Fri, 24 Mar 2017 08:33:18 +0000 (09:33 +0100)]
added syslog logging buffer to dlog

dlog will handle syslog messages from /dev/log
it will create /dev/log as symbolic link to /run/dlog/dev-log socket
the functionality is turn on
 * when dlog_dev-log.socket systemd unit is installed (separate pkg provided)
 * or when syslog_force config flag is set on
systemd-journald syslog socket should be disabled then
to not cause any conflicts

Change-Id: I7bc1c3e3dd64a4741e749b19c3161797013071d9

7 years agoSplit socket creation into bind and listen parts 77/125977/4
Michal Bloch [Wed, 12 Apr 2017 20:18:57 +0000 (22:18 +0200)]
Split socket creation into bind and listen parts

Change-Id: I09df695ec42ba6d8ad037bffc34c5d9c8f6a89ee
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agologger: create log files after dropping privileges 31/122831/10
Rafal Pietruch [Mon, 3 Apr 2017 12:42:34 +0000 (14:42 +0200)]
logger: create log files after dropping privileges

fixes /var/log/dlog/* files ownership from root to log:log

Change-Id: I5971db8b876a8072309fcb260ab0e38a229adcd1

7 years agologger: list macros replaced by list struct 17/120917/22
Rafal Pietruch [Fri, 24 Mar 2017 15:42:21 +0000 (16:42 +0100)]
logger: list macros replaced by list struct

generic list implemented using void pointers to list entities
replaces macros for type-specific list manipulation

Change-Id: I48969427267864d6429ed50450c12f1b74a5c5f7

7 years agologger: enable specific buffers according to config 69/121969/11
Rafal Pietruch [Wed, 29 Mar 2017 14:09:14 +0000 (16:09 +0200)]
logger: enable specific buffers according to config

use buffer enabled flags in case of first_buffer number
check if buffer created when adding reader

Change-Id: Ib316d32e8a8b4287ef2a49a70a0644c2836766cc

7 years agoget config number/boolean helper functions added 68/121968/13
Rafal Pietruch [Wed, 29 Mar 2017 14:06:32 +0000 (16:06 +0200)]
get config number/boolean helper functions added

 * log_config_get_int return given default value on error
 * log_config_get_boolean just calls log_config_get_int
   added to distinguish config parameter type

Change-Id: Iebbc1097ac399d48f016f6919b9b5b4a4ef113b4

7 years agoMerge "Allocation handling:" into tizen
Karol Lewandowski [Fri, 21 Apr 2017 10:47:55 +0000 (03:47 -0700)]
Merge "Allocation handling:" into tizen

7 years agoKMSG parser: standarize return value; tests 66/122466/18
Michal Bloch [Thu, 30 Mar 2017 13:21:12 +0000 (15:21 +0200)]
KMSG parser: standarize return value; tests

Change-Id: I800cb3b450d10a8bc26124bcd08abd669528758a
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agoAllocation handling: 16/120916/15
Rafal Pietruch [Fri, 24 Mar 2017 12:55:04 +0000 (13:55 +0100)]
Allocation handling:

 * catch allocation failures
 * do not deallocate argv and static strings

Change-Id: Ifc6c609d9296f1f56abcce8178e242de36bb96a1

7 years agoExtensible config 39/121339/16
Karol Lewandowski [Thu, 20 Apr 2017 14:35:55 +0000 (16:35 +0200)]
Extensible config

 * reader config now prefix based instead of indexed
 * extra config can now be read from a directory
   (has to be named same as conf file + ".d")

Change-Id: I2bf3d31526d1fc40fbf20a2ad7b4a62282c2423d
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
[ Reworked file and directory read functions. ]
Signed-off-by: Karol Lewandowski <k.lewandowsk@samsung.com>
7 years agologger: helper math functions 70/121970/20
Rafal Pietruch [Tue, 28 Mar 2017 12:39:29 +0000 (14:39 +0200)]
logger: helper math functions

The following math utility functions were added,
currently used for parsing program arguments:
 * min_int
 * max_int
 * clamp_int

Change-Id: I20674f2cb72ca3d29b2f5f109de4a4accd8369de

7 years agotest_pipe script fixed 97/122197/15
Rafal Pietruch [Fri, 10 Feb 2017 10:05:12 +0000 (11:05 +0100)]
test_pipe script fixed

test_pipe.sh script hangs
because -d option is not given to dlogutil,
fixed to run dlogutil in background,
and kill this process when all tests are finished

Change-Id: I93e9383294c2a0078ea5af3f94e6c711b4f34e37

7 years agoConfig for-each loop helper: loop over all entries 29/123429/10
Michal Bloch [Tue, 4 Apr 2017 15:16:22 +0000 (17:16 +0200)]
Config for-each loop helper: loop over all entries

Fixes loglimiter only accepting one entry

Change-Id: Ia82bbc43ee918f64d8946fe00348cfe4a7ece0a7
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agoPipe backend handles oversized logs. 76/125976/3
Michal Bloch [Wed, 12 Apr 2017 19:54:01 +0000 (21:54 +0200)]
Pipe backend handles oversized logs.

Change-Id: Iea2976260333ad6fcf2154625e223c88764b8fd4
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agologger: flush all buffers if program interrupted 39/123939/5
Rafal Pietruch [Wed, 5 Apr 2017 12:11:33 +0000 (14:11 +0200)]
logger: flush all buffers if program interrupted

Change-Id: I0ee063a29827c2706bc1736ac259d788dd7f1d28

7 years agoFixes to device -> file logging 38/123938/5
Michal Bloch [Thu, 6 Apr 2017 17:35:44 +0000 (19:35 +0200)]
Fixes to device -> file logging

 * extension of max log size with a size of prepended header
   ensuring fitting the buffer with the longest possible log

 * fix read() error handling

 * remove needless epoll

 * clarify the starvation preventing loop counter

 * remove unused log size constants (from kmsg)

Change-Id: Ibeeb9e8a74e180e91c7c4c44ffcf8f50f3fa7cb4
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years ago[security] drop System::Privileged smack label 75/125975/1
Rafal Pietruch [Tue, 18 Apr 2017 06:50:58 +0000 (08:50 +0200)]
[security] drop System::Privileged smack label

System::Privileged smack label was added for /dev/kmsg support
which is no longer supported and dlog is unnecessarily running
as System::Privileged (the 'onlycap' management item)
the dlog_logger runs as dlog user and no capability is granted

Change-Id: I7ffa00741bea0f9eeb966aa28e4b5d8fb4d3e8f2

7 years agolicense:change filename from LICENSE.Apache-2.0 to LICENSE.APACHE2.0 23/125623/2
sanghyeok.oh [Tue, 18 Apr 2017 06:45:04 +0000 (15:45 +0900)]
license:change filename from LICENSE.Apache-2.0 to LICENSE.APACHE2.0

Change-Id: I7dc33ec6aaf7d1c56f2a00cc44f02f64bfe28a3a
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
7 years agoMerge "Standarize writer creation" into tizen
Karol Lewandowski [Wed, 5 Apr 2017 09:35:27 +0000 (02:35 -0700)]
Merge "Standarize writer creation" into tizen

7 years agoStandarize writer creation 77/118477/10
Rafal Pietruch [Fri, 10 Mar 2017 17:53:53 +0000 (18:53 +0100)]
Standarize writer creation

Helps extensiblity.

Change-Id: I3d71b0ebe0984f828e32695ffea416b580b391ae
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agosvace:remove fd leak 94/122694/1 accepted/tizen_common accepted/tizen_ivi accepted/tizen_mobile accepted/tizen_tv accepted/tizen_wearable accepted/tizen/common/20170404.142540 accepted/tizen/ivi/20170403.131050 accepted/tizen/mobile/20170403.131039 accepted/tizen/tv/20170403.131035 accepted/tizen/unified/20170403.131057 accepted/tizen/wearable/20170403.131047 submit/tizen/20170403.072619
sanghyeok.oh [Mon, 3 Apr 2017 07:11:01 +0000 (16:11 +0900)]
svace:remove fd leak

Change-Id: I11b1711c59eec97c3f867946618cd37c8f9b4785
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
7 years agoLicense: add license files 43/121543/1 accepted/tizen/common/20170329.171806 accepted/tizen/ivi/20170329.034300 accepted/tizen/mobile/20170329.034245 accepted/tizen/tv/20170329.034252 accepted/tizen/unified/20170329.034305 accepted/tizen/wearable/20170329.034256 submit/tizen/20170328.074336 submit/tizen/20170403.072040
INSUN PYO [Tue, 28 Mar 2017 07:37:02 +0000 (16:37 +0900)]
License: add license files

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

7 years agodoc : fix errata 65/121065/1 accepted/tizen/common/20170327.143119 accepted/tizen/ivi/20170328.055758 accepted/tizen/mobile/20170328.055647 accepted/tizen/tv/20170328.055714 accepted/tizen/unified/20170328.055819 accepted/tizen/wearable/20170328.055738 submit/tizen/20170327.095454
Kichan Kwon [Mon, 27 Mar 2017 06:33:20 +0000 (15:33 +0900)]
doc : fix errata

Change-Id: I8764558eef757069fa0783d6900a91d3b2207ece
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoDocumentation: 71/120671/2
Michal Bloch [Thu, 23 Mar 2017 14:07:07 +0000 (15:07 +0100)]
Documentation:

 * do not generate docs for internals (yet)
 * bring back @since_tizen
 * reformat tables from markdown to html
   (failed to parse in some doxygen versions)

Change-Id: I518177b2c2fb32765a4ac37962a1aeab0257ca83
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
[Rename group name]
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years ago[4.0] logger: replace writer type with callbacks 41/118241/9
Rafal Pietruch [Thu, 9 Mar 2017 08:59:30 +0000 (09:59 +0100)]
[4.0] logger: replace writer type with callbacks

Replaces switching between different writer types
with specific writer function callback:
service_writer_{socket,pipe,kmsg}
to be more easily extensible when adding new writers

Change-Id: I8552121bd50e20ca4872ed5e1536325a7acef279

7 years ago[4.0] kmsg-backend removed 71/115871/11
Rafal Pietruch [Thu, 16 Feb 2017 15:50:02 +0000 (16:50 +0100)]
[4.0] kmsg-backend removed

Change-Id: I9d98e6fdbecfc6fdea7459667d5ae506b3772982

7 years ago[4.0] logger: replace writers fds with single one 28/118228/10
Rafal Pietruch [Thu, 9 Mar 2017 08:29:22 +0000 (09:29 +0100)]
[4.0] logger: replace writers fds with single one

Replaces different fds dependent on writer type,
i.e. socket_fd, device_fd, fd_pipe[2]
with a single working_fd
for writers to be easily extensible

Change-Id: I62ec0faa556f1eaf64e8a74f3b2522a855a64446

7 years agoMerge branch 'tizen_3.0' into tizen 91/119391/4
Michal Bloch [Fri, 17 Mar 2017 16:42:38 +0000 (17:42 +0100)]
Merge branch 'tizen_3.0' into tizen

Change-Id: Icedc0feec813c5d793d169878f81f18ff85b749e
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agoUpdate dlogutil help 93/119393/2
Michal Bloch [Thu, 16 Mar 2017 16:18:43 +0000 (17:18 +0100)]
Update dlogutil help

Change-Id: Ieb239f028d71d0e62017d6fffb9138c017f2a8bc
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agoFix dlogutil -u causing a warning on pipe backend 87/119387/2
Michal Bloch [Thu, 16 Mar 2017 16:14:12 +0000 (17:14 +0100)]
Fix dlogutil -u causing a warning on pipe backend

Change-Id: If031af288f85aa4fa3e35c2a59bb55b8bfc3d7b6
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years ago[4.0] Unduplicate code 12/88212/19
Michal Bloch [Tue, 13 Sep 2016 13:12:33 +0000 (15:12 +0200)]
[4.0] Unduplicate code

Change-Id: I72c9e8fe08f960fa7a2766b91ab2a72e8d2891b6
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years ago[4.0] Documentation 93/100293/16
Michal Bloch [Tue, 15 Nov 2016 11:31:10 +0000 (12:31 +0100)]
[4.0] Documentation

 * fix errors
 * add grouping
 * add a rudimentary main page
 * autogenerate

Change-Id: I45988efcbb9aa12e0ed26dc7b3d2fe9b9a7eba6d
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years ago[4.0] logger: Major initialization refactor 53/95553/19
Karol Lewandowski [Fri, 28 Oct 2016 14:05:03 +0000 (16:05 +0200)]
[4.0] logger: Major initialization refactor

 * redesign data structures to better reflect
 their relationships and make them easier to
 initialise properly

 * shuffle around and split up the functions so
 that they are more concise and conceptually pure

 * improve error handling and cleanup routines
 in case initialisation fails

 * introduce standardized return codes

Change-Id: Icafebabec813c5d793d169878f81c18ff85b749e
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years ago[4.0] logger: Extract password/group db manipulation to separate function 50/94550/22
Karol Lewandowski [Mon, 31 Oct 2016 13:00:28 +0000 (14:00 +0100)]
[4.0] logger: Extract password/group db manipulation to separate function

Change-Id: I843711edff4e6eb0ff0dfa233e1b08727b245396
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years ago[4.0] logger: Always use internal helper functions to manage epoll fds 00/94400/22
Karol Lewandowski [Fri, 28 Oct 2016 13:28:57 +0000 (15:28 +0200)]
[4.0] logger: Always use internal helper functions to manage epoll fds

Change-Id: Ib80d7ea8a331c1b90ee12e67d73f170f0083ef15
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agoMerge branch 'tizen_3.0' into tizen 62/119262/1
Kichan Kwon [Thu, 16 Mar 2017 06:57:33 +0000 (15:57 +0900)]
Merge branch 'tizen_3.0' into tizen

Change-Id: Idbc92058d4601d903f1b9d7959d37156fa95b3b7
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agologprint : introduce "rwtime" log format 27/118127/2 accepted/tizen/3.0/common/20170317.100154 accepted/tizen/3.0/ivi/20170317.090553 accepted/tizen/3.0/mobile/20170317.090509 accepted/tizen/3.0/tv/20170317.090523 accepted/tizen/3.0/wearable/20170317.090537 submit/tizen_3.0/20170316.070304
Kichan Kwon [Thu, 9 Mar 2017 01:39:40 +0000 (10:39 +0900)]
logprint : introduce "rwtime" log format

- To compare time, all logs use receive time
- However, somebody want to check the original time of kernel logs
- Format : RECV_TIME [ORIG_TIME] PRIO/TAG(PID, TID): MSG

Change-Id: I75124561acaba3ee0747fc131830efd9ff8044fc
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoUpdate configs to recv timestamps 52/117852/1 accepted/tizen/3.0/common/20170309.110227 accepted/tizen/3.0/ivi/20170309.085811 accepted/tizen/3.0/mobile/20170309.085515 accepted/tizen/3.0/tv/20170309.085644 accepted/tizen/3.0/wearable/20170309.085728 submit/tizen_3.0/20170308.081726
Michal Bloch [Tue, 7 Mar 2017 16:42:03 +0000 (17:42 +0100)]
Update configs to recv timestamps

Change-Id: I547667a63668456af76404282a63e3004295602c
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agoReception timestamps 00/117600/3
Michal Bloch [Mon, 6 Mar 2017 18:02:02 +0000 (19:02 +0100)]
Reception timestamps

 * collect realtime + monotonic timestamps on reception
 * new format, "recv_realtime": shows realtime reception timestamp
 * dlogutil now sorts by monotonic reception timestamp

Change-Id: I53d2787562d6cc580941b8bf64032dd153f147c4
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agounhandled read() error bugfix 22/116322/3
Rafal Pietruch [Thu, 23 Feb 2017 16:00:48 +0000 (17:00 +0100)]
unhandled read() error bugfix

fix answers foolowing bug report:
repeated lines with the exact same timestamp/message
exactly (100, 300 or 900 times)

Change-Id: I2edc6c80c2023a3f80b5b99d4e1caede047669fc

7 years agodlogutil : block to use "-n" or "-r" without "-f" option 08/115708/1 accepted/tizen/3.0/common/20170223.121304 accepted/tizen/3.0/ivi/20170223.001133 accepted/tizen/3.0/mobile/20170223.001036 accepted/tizen/3.0/tv/20170223.001059 accepted/tizen/3.0/wearable/20170223.001122 submit/tizen_3.0/20170221.060039
Kichan Kwon [Tue, 21 Feb 2017 05:38:33 +0000 (14:38 +0900)]
dlogutil : block to use "-n" or "-r" without "-f" option

- "-n" and "-r" options are related with logged file enabled by "-f"

Change-Id: I4a18cbe7b5326a19f1ce5e91eb0830ec658ca067
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agolibdlog : fix invalid log_fds access 75/115675/3
Kichan Kwon [Tue, 21 Feb 2017 04:50:57 +0000 (13:50 +0900)]
libdlog : fix invalid log_fds access

- If all log device paths are given and failed to get main fd,
 libdlog will try to access log_fds[LOG_ID_MAX]
- No more access log_fds[LOG_ID_MAX]

Change-Id: I97197a5efeecae9713f6564f10327a262b255de2
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoFree config data and close fd before terminated 14/114414/9 accepted/tizen/3.0/common/20170216.151325 accepted/tizen/3.0/ivi/20170216.060630 accepted/tizen/3.0/mobile/20170216.060515 accepted/tizen/3.0/tv/20170216.060533 accepted/tizen/3.0/wearable/20170216.060559 submit/tizen_3.0/20170215.023852
Kichan Kwon [Mon, 13 Feb 2017 08:41:06 +0000 (17:41 +0900)]
Free config data and close fd before terminated

Change-Id: Ib448c1901a4bff6c960bf1a8c26de7a4a350f39c
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agologger : fix '-s' option is not applied 69/114569/1
Kichan Kwon [Tue, 14 Feb 2017 05:27:42 +0000 (14:27 +0900)]
logger : fix '-s' option is not applied

Change-Id: If94afefd0661df937bc9623f3f447d536e524ea2
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoRevert "Fix passive logging issues" 67/114567/1
Kwon [Tue, 14 Feb 2017 05:19:42 +0000 (21:19 -0800)]
Revert "Fix passive logging issues"

This reverts commit e5c03b719438501f9ccca890092b961e73ac164e.

New patch with fixing bug will be uploaded

Change-Id: I1d7e18dda7bcd3bc6bf9b19c1d30a0b3579a3858

7 years agoFix passive logging issues 28/114028/1
Michal Bloch [Wed, 8 Feb 2017 15:22:45 +0000 (16:22 +0100)]
Fix passive logging issues

 * the -s parameter now works
 * filtering actually works

Change-Id: I9c6552b8b8fb7cbaca6afe3bcccf0553b81eb1fe
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agoMerge branch 'tizen_3.0' into tizen 96/110096/1 accepted/tizen/common/20170116.181514 accepted/tizen/ivi/20170117.053411 accepted/tizen/mobile/20170117.053319 accepted/tizen/tv/20170117.053335 accepted/tizen/unified/20170309.033826 accepted/tizen/wearable/20170117.053355 submit/tizen/20170116.043922 submit/tizen_unified/20170308.100409
Kichan Kwon [Fri, 13 Jan 2017 01:58:40 +0000 (10:58 +0900)]
Merge branch 'tizen_3.0' into tizen

Change-Id: I2c91566ccbcca384f4d2d88e6ef7daacaffedad7
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoFix epoll_ctl erroring out 52/110052/1
Michal Bloch [Thu, 12 Jan 2017 14:49:10 +0000 (15:49 +0100)]
Fix epoll_ctl erroring out

Do not call epoll_ctl on FDs representing actual files,
which causes the call to error out with EPERM.

This use of this mechanism was twofold; first, pipes
need to actually be added to epoll (to see if they're
full). The second use was to discover whether a descriptor
represents a file. This information is known a priori,
which removes the need to make calls doomed to fail.

Change-Id: Ic11c211ee88e70899998e794847b79afc0a90d9a
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agoProofread header file 19/108919/3 tizen_3.0_tv accepted/tizen/3.0/common/20170113.182121 accepted/tizen/3.0/ivi/20170113.080411 accepted/tizen/3.0/mobile/20170113.080321 accepted/tizen/3.0/tv/20170113.080338 accepted/tizen/3.0/wearable/20170113.080353 submit/tizen_3.0/20170112.010501
Kichan Kwon [Fri, 6 Jan 2017 07:49:45 +0000 (16:49 +0900)]
Proofread header file

Change-Id: I79da2d948c9932f40a6b599bc38aed0e5867c84e
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoCheck dump file size during initialization 54/107954/3
Kichan Kwon [Mon, 2 Jan 2017 04:51:28 +0000 (13:51 +0900)]
Check dump file size during initialization

- Until now, dump file is rotated after writing rotate_size_kbytes
- If writing less than rotate_size_kbytes and rebooting are repeated,
 dump file size can be infinitely increased
- To prevent this, large dump file should be rotated before logging

- Meanwhile, size conversion macro is defined

Change-Id: Id506421799076075e7307c262242835e4bd6d6ea
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>