platform/core/system/dlog.git
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>
7 years agoMerge branch 'tizen_3.0' into tizen 54/107854/1
Kichan Kwon [Fri, 30 Dec 2016 07:20:18 +0000 (16:20 +0900)]
Merge branch 'tizen_3.0' into tizen

Change-Id: Ifa9654ff3a252b02de4b289ea5301acb18550a95
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agologger : prevent out of range 91/105891/2 accepted/tizen_3.0.m2_mobile accepted/tizen_3.0.m2_tv accepted/tizen_3.0.m2_wearable tizen_3.0.m2 accepted/tizen/3.0.m2/mobile/20170104.141605 accepted/tizen/3.0.m2/tv/20170104.142056 accepted/tizen/3.0.m2/wearable/20170104.142348 accepted/tizen/3.0/common/20161221.181117 accepted/tizen/3.0/ivi/20161221.010532 accepted/tizen/3.0/mobile/20161221.010820 accepted/tizen/3.0/tv/20161221.010426 accepted/tizen/3.0/wearable/20161221.010544 submit/tizen_3.0.m2/20170104.093751 submit/tizen_3.0/20161220.062924
Kichan Kwon [Tue, 20 Dec 2016 02:44:28 +0000 (11:44 +0900)]
logger : prevent out of range

Change-Id: Id1ba27bd54df2e7975e617fac4c704fc3268e817
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agologger : fix about filtering 95/103495/1 submit/tizen_3.0/20161209.105722
Kichan Kwon [Thu, 8 Dec 2016 12:15:51 +0000 (21:15 +0900)]
logger : fix about filtering

- TAG:PRIO filter will be applied

Change-Id: I96894696eb870ef7a25e78638d58e6c296c6dfb7
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agologger : fix invalid checking 73/102573/2 accepted/tizen/3.0/common/20161207.194610 accepted/tizen/3.0/ivi/20161207.012418 accepted/tizen/3.0/mobile/20161207.012327 accepted/tizen/3.0/tv/20161207.012343 accepted/tizen/3.0/wearable/20161207.012401 submit/tizen_3.0/20161206.084145
Kichan Kwon [Tue, 6 Dec 2016 06:23:13 +0000 (15:23 +0900)]
logger : fix invalid checking

- Return value is changed at the 3e8ab4998beddd0cf61486bb2c3f06ff9f646579
- Therefore, condition statement should be changed

Change-Id: I676823462a0b4b981d103ca42139a2e27eba35e4
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agodlogutil : do not sort when it prints logs about only one buffer or tag 51/100951/2
Kichan Kwon [Wed, 30 Nov 2016 02:16:06 +0000 (11:16 +0900)]
dlogutil : do not sort when it prints logs about only one buffer or tag

- Each dlog buffer is FIFO queue, so dlogutil don't have to sort in this case
- Also, we can assume that logs having same tag are stored in the same buffer

Change-Id: I0db5bc6162903749007f514f9d06c16967bee696
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoFix minor issues. 45/100345/4 accepted/tizen/3.0/ivi/20161205.235127 accepted/tizen/3.0/mobile/20161205.235035 accepted/tizen/3.0/tv/20161205.235050 accepted/tizen/3.0/wearable/20161205.235107 submit/tizen_3.0/20161205.073831
Kichan Kwon [Mon, 28 Nov 2016 01:51:55 +0000 (10:51 +0900)]
Fix minor issues.

- Remove unreachable code
- Add error check code
- No more ignore conf value about buffer size

Change-Id: Icb9cd08edf827625ae0a67130bab094571a2241d
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoUpgrade: adjust upgrade script number 34/101834/2
Sunmin Lee [Fri, 2 Dec 2016 08:08:05 +0000 (17:08 +0900)]
Upgrade: adjust upgrade script number

Change-Id: I425c22266e8b3c5e030600c49a5f10f7e03837b7

7 years agoMerge "logger: Simplify binary log file header writing" into tizen_3.0
Karol Lewandowski [Fri, 25 Nov 2016 15:30:19 +0000 (07:30 -0800)]
Merge "logger: Simplify binary log file header writing" into tizen_3.0

7 years agoMerge changes I274d815f,I4c831e85,I997c4d72,I02ebfd88 into tizen_3.0
Karol Lewandowski [Fri, 25 Nov 2016 15:29:14 +0000 (07:29 -0800)]
Merge changes I274d815f,I4c831e85,I997c4d72,I02ebfd88 into tizen_3.0

* changes:
  logger: Avoid returning EBADF in normal operation
  More useful return values for shared functions
  Catch allocation failures
  logger: refactor writer servicing

7 years agoMerge "logger: fix closing fd 0" into tizen_3.0
Karol Lewandowski [Fri, 25 Nov 2016 15:27:55 +0000 (07:27 -0800)]
Merge "logger: fix closing fd 0" into tizen_3.0

7 years agoMerge "logger: fix socket owner change" into tizen_3.0
Karol Lewandowski [Fri, 25 Nov 2016 15:21:39 +0000 (07:21 -0800)]
Merge "logger: fix socket owner change" into tizen_3.0

7 years agologger: Simplify binary log file header writing 62/97562/2
Karol Lewandowski [Fri, 28 Oct 2016 13:14:01 +0000 (15:14 +0200)]
logger: Simplify binary log file header writing

Additionally, add return code as writing may fail
and handle the return code in invoking functions.

Change-Id: I7c1434fe87b6f6a50ea986307e935efd87775796

7 years agologger: Avoid returning EBADF in normal operation 61/97561/2
Karol Lewandowski [Fri, 28 Oct 2016 14:07:23 +0000 (16:07 +0200)]
logger: Avoid returning EBADF in normal operation

EBADF has been used only to signal that file should be removed from
the list - this commit makes this explicit.

Change-Id: I274d815fd95ab43aa13f14d36286d17672e42e83

7 years agoMore useful return values for shared functions 60/97560/2
Michal Bloch [Fri, 28 Oct 2016 21:01:47 +0000 (23:01 +0200)]
More useful return values for shared functions

Now returning 0/-errno instead of 1/0

Change-Id: I4c831e85c8ec7e93f183f6990839afdb63ce0a63
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agologger: fix closing fd 0 57/97557/2
Michal Bloch [Thu, 3 Nov 2016 16:30:09 +0000 (17:30 +0100)]
logger: fix closing fd 0

An unused fd whose value was always 0 was wrongly closed.

Change-Id: I8a70c0a447abd83f091993113354095ffd6446c1
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agologger: fix socket owner change 56/97556/2
Michal Bloch [Mon, 14 Nov 2016 11:51:52 +0000 (12:51 +0100)]
logger: fix socket owner change

Change-Id: I742f332bcec3d01fefd2cae3f12d4f7f85878422
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agoCatch allocation failures 59/97559/2
Michal Bloch [Wed, 26 Oct 2016 15:38:09 +0000 (17:38 +0200)]
Catch allocation failures

Change-Id: I997c4d72f3ba413246085b60e49ffeaac1753d7b
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agologger: refactor writer servicing 58/97558/2
Michal Bloch [Thu, 27 Oct 2016 18:06:19 +0000 (20:06 +0200)]
logger: refactor writer servicing

 * inflict consistent return values - all writer-related functions now
   return 0 on success and negative errno code on failure.

Change-Id: I02ebfd88fd044ee083675ba9ed88c403530ca786
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agoUpgrade: adjust script number 71/99971/1 accepted/tizen/3.0/common/20161125.101825 accepted/tizen/3.0/ivi/20161125.082112 accepted/tizen/3.0/mobile/20161125.082044 accepted/tizen/3.0/tv/20161125.082101 accepted/tizen/3.0/wearable/20161125.082107 submit/tizen_3.0/20161124.141456
Sunmin Lee [Thu, 24 Nov 2016 13:56:47 +0000 (22:56 +0900)]
Upgrade: adjust script number

Change-Id: Ia90b97ff80de5989fc9017cd72836c5902aef1b0
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
7 years agoRevert "Upgrade: adjust script number" 68/99968/1
Sunmin Lee [Thu, 24 Nov 2016 13:52:35 +0000 (05:52 -0800)]
Revert "Upgrade: adjust script number"

This reverts commit 25acf3aa801bcb858517aea3194cf7aa9c547adf.

Change-Id: Id799dab1c07023e8298ec45037851f2c07a992e0

7 years agoUpgrade: adjust script number 66/99966/1
Sunmin Lee [Thu, 24 Nov 2016 13:41:15 +0000 (22:41 +0900)]
Upgrade: adjust script number

dlog upgrade should be done before 300.pkgmgr.patch.sh

Change-Id: Ib1e69cf18858a1c29f6e925e9785212fb30a3d86
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
7 years agodlogutil : add "-u" option for setting sorting buffer size 53/99553/3 accepted/tizen/3.0/ivi/20161125.080129 accepted/tizen/3.0/mobile/20161125.080011 accepted/tizen/3.0/tv/20161125.080045 accepted/tizen/3.0/wearable/20161125.080100 submit/tizen_3.0/20161124.073750
Kichan Kwon [Wed, 23 Nov 2016 08:39:25 +0000 (17:39 +0900)]
dlogutil : add "-u" option for setting sorting buffer size

- dlogutil -u SIZE
- If "-u" option isn't used, set to the value of conf file

Change-Id: I629c02914d87107a98cac4a83d04560a6a6a0c6f
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agodlogutil : fix memory leak 92/99492/3
Kichan Kwon [Wed, 23 Nov 2016 05:23:05 +0000 (14:23 +0900)]
dlogutil : fix memory leak

- When dlogutil filters specific logs, not printed logs haven't be freed

Change-Id: Ib04b3052d02b03b5816660463c70686a5d082143
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agolibdlog : set initalize value to write function pointer 02/99502/1
Jiwon Kim [Tue, 15 Nov 2016 13:30:19 +0000 (22:30 +0900)]
libdlog : set initalize value to write function pointer

- If log_config_read() is failed (e.g. If '/opt' is unmounted),
  dlog_print function refer to null
- Therefore, it need to set to fallback function

Change-Id: I1002c795a12de062121f656a32414a739b994692
Signed-off-by: Jiwon Kim <jiwon177.kim@samsung.com>
[Remove comment violating Tizen coding rule]
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoFix vulnerability: NULL check 88/98488/2 accepted/tizen/3.0/common/20161121.072915 accepted/tizen/3.0/ivi/20161121.011533 accepted/tizen/3.0/mobile/20161121.011429 accepted/tizen/3.0/tv/20161121.011455 accepted/tizen/3.0/wearable/20161121.011513 submit/tizen_3.0/20161117.111554
Sunmin Lee [Thu, 17 Nov 2016 10:48:37 +0000 (19:48 +0900)]
Fix vulnerability: NULL check

Null checking for the returned value

Change-Id: Ia459629462b9f0e6cf8501f67f973a92c60b3caa

7 years agoFix vulnerability: log_config_set() 52/97352/2 accepted/tizen/3.0/common/20161116.143430 accepted/tizen/3.0/ivi/20161116.020712 accepted/tizen/3.0/ivi/20161116.021822 accepted/tizen/3.0/mobile/20161116.020621 accepted/tizen/3.0/mobile/20161116.021719 accepted/tizen/3.0/tv/20161116.020631 accepted/tizen/3.0/tv/20161116.021736 accepted/tizen/3.0/wearable/20161116.020654 accepted/tizen/3.0/wearable/20161116.021759 submit/tizen_3.0/20161115.003908 submit/tizen_3.0/20161115.023516
Sunmin Lee [Mon, 14 Nov 2016 02:31:29 +0000 (11:31 +0900)]
Fix vulnerability: log_config_set()

This patch forces null termination of e->value string.

Change-Id: I32fba2f23ef2a1b4c725585e2835d2a5530f2d27

7 years agoMerge branch 'tizen' into tizen_3.0 89/97289/1 submit/tizen_3.0/20161113.061836
Kunhoon Baik [Sun, 13 Nov 2016 06:14:54 +0000 (15:14 +0900)]
Merge branch 'tizen' into tizen_3.0

Change-Id: Iaabf10b234499155e98ab354b4c2084afc3e93fd

7 years agolibdlog : control platform debug log by modifying conf file 15/95715/2 accepted/tizen/common/20161114.171339 accepted/tizen/ivi/20161114.010627 accepted/tizen/mobile/20161114.010452 accepted/tizen/tv/20161114.010520 accepted/tizen/wearable/20161114.010601 submit/tizen/20161113.061424
Kichan Kwon [Fri, 4 Nov 2016 09:39:49 +0000 (18:39 +0900)]
libdlog : control platform debug log by modifying conf file

- If debugmode is set to 0, libdlog doesn't write platform debug log
- Debugmode doesn't impact on Public API (dlog_(v)print)
- Normal user can't modify it

Change-Id: Ib1a278412baaa5a2ff64612b786a59adffb7c849
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agodlogutil : print logs when sorting buffer is full 74/97074/2
Kichan Kwon [Fri, 11 Nov 2016 05:52:13 +0000 (14:52 +0900)]
dlogutil : print logs when sorting buffer is full

- When specific app prints huge logs without a break, dlogutil also wait endlessly
- Therefore, we have to empty buffer when it is full

- Meanwhile, if you feel that time to fill buffer is too long, you may reduce buffer size
- However, there is a trade-off about sorting buffer size
  - Having larger buffer guarantees sorting quality
  - Having smaller buffer prints logs fast
- Therefore, we may give user a choice

Change-Id: I23b4ed2582125a430b7e93229f059b9715e23d96
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoMerge branch 'tizen' into tizen_3.0 97/95397/1
Kichan Kwon [Thu, 3 Nov 2016 06:07:45 +0000 (15:07 +0900)]
Merge branch 'tizen' into tizen_3.0

Change-Id: I98d5ebe3e300b509efe05bf78edb567b047dad55
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoRelease up 96/95396/1
Kichan Kwon [Thu, 3 Nov 2016 06:07:27 +0000 (15:07 +0900)]
Release up

Change-Id: I2b1e73073cb787f0fd82e991eadc41e6eac490b2
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoTests: add a unit test for pipe message creation. 85/92985/13 accepted/tizen/3.0/common/20161114.081302 accepted/tizen/3.0/ivi/20161103.044935 accepted/tizen/3.0/mobile/20161103.044834 accepted/tizen/3.0/tv/20161103.044854 accepted/tizen/3.0/wearable/20161103.044914 accepted/tizen/common/20161103.155847 accepted/tizen/ivi/20161103.230602 accepted/tizen/mobile/20161103.230507 accepted/tizen/tv/20161103.230524 accepted/tizen/wearable/20161103.230542 submit/tizen/20161103.010653 submit/tizen_3.0/20161103.010811 submit/tizen_3.0_common/20161110.084657
Michal Bloch [Wed, 19 Oct 2016 16:12:14 +0000 (18:12 +0200)]
Tests: add a unit test for pipe message creation.

Change-Id: Ic95a7abea1d9933a42605c8f192d2093deb8b80c
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agoPipe: move validity check to the dedicated area 32/93532/6
Michal Bloch [Mon, 24 Oct 2016 19:54:13 +0000 (21:54 +0200)]
Pipe: move validity check to the dedicated area

  Ideally, this series of checks (null message, total length, priority bounds)
  would be a separate function shared by all back-ends. This will be done in a
  further commit.

Change-Id: I853c64a32e3ba5e6a72b28b5075f4fca39d6a15f
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agoCheck our privilege. 84/92984/11
Michal Bloch [Wed, 19 Oct 2016 15:40:33 +0000 (17:40 +0200)]
Check our privilege.

Make sure the privilege reset succeeds.

Change-Id: Ic88703c2ac8d69eb1a173526c60363ba319820c6
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agoMerge "Set proper executable bits" into tizen
Karol Lewandowski [Thu, 27 Oct 2016 14:43:57 +0000 (07:43 -0700)]
Merge "Set proper executable bits" into tizen

7 years agoSet proper executable bits 33/93533/4
Michal Bloch [Mon, 24 Oct 2016 20:08:17 +0000 (22:08 +0200)]
Set proper executable bits

 * add to scripts/dlog_upgrade.sh

 * remove from plaintext files; this includes source code,
   configuration, header, image, manifest, service, and other
   miscellaneous (eg. license) files (specifically, all files
   touched by this commit except scripts/dlog_upgrade.sh)

Change-Id: Icc1496147c5e78347dff8af5eade3c6cfe13bffd
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agodlogutil : print logs stored for long time 63/92963/4 accepted/tizen/common/20161025.155023 accepted/tizen/ivi/20161028.151055 accepted/tizen/mobile/20161028.151042 accepted/tizen/tv/20161028.151048 accepted/tizen/wearable/20161028.151052 submit/tizen/20161025.084539 submit/tizen_3.0_common/20161104.104000
Kichan Kwon [Wed, 19 Oct 2016 13:07:21 +0000 (22:07 +0900)]
dlogutil : print logs stored for long time

- If any logs don't be written, some logs stored most currently can't be printed
- When remainder logs haven't printed for long time,
 it will be printed without written time

Change-Id: Id51f0a2a078e74f1f568d863b8abd78711d781d5
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agodlogutil : modify timeout when dlogutil decides to terminate 27/92927/3 accepted/tizen/3.0/ivi/20161028.133954 accepted/tizen/3.0/mobile/20161028.133111 accepted/tizen/3.0/tv/20161028.133415 accepted/tizen/3.0/wearable/20161028.133719 accepted/tizen/common/20161019.145845 accepted/tizen/ivi/20161019.142322 accepted/tizen/mobile/20161019.142236 accepted/tizen/tv/20161019.142253 accepted/tizen/wearable/20161019.142310 submit/tizen/20161019.111037 submit/tizen_3.0/20161028.062323 submit/tizen_3.0/20161028.082423
Kichan Kwon [Wed, 19 Oct 2016 10:42:52 +0000 (19:42 +0900)]
dlogutil : modify timeout when dlogutil decides to terminate

- When "-d" or "-t" option is applied, dlogutil is terminated
 after printing remainder in the buffer.

- However, if the time interval with current log and last log
 is less than timeout, current log can't be printed.

- Therefore, timeout should be zero after decision.

- In addition, to prevent the situation that dlogutil can't decide
 because of continuous logs, waiting timeout also be decreased.

Change-Id: Ia29d083c402263163573c58f33ce976a665e1070
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoDisable to log to console & stdout for syslog 25/92525/2 accepted/tizen/common/20161018.175101 accepted/tizen/ivi/20161018.091532 accepted/tizen/mobile/20161018.091448 accepted/tizen/tv/20161018.091501 accepted/tizen/wearable/20161018.091516 submit/tizen/20161018.022246
Kunhoon Baik [Mon, 17 Oct 2016 08:51:54 +0000 (17:51 +0900)]
Disable to log to console & stdout for syslog

Change-Id: I7ff528856ee35e4f8883edbd18f592038dfc9085

7 years agodlogutil : check elapsed time by comparing both ends 28/92628/3
Kichan Kwon [Mon, 17 Oct 2016 15:37:05 +0000 (00:37 +0900)]
dlogutil : check elapsed time by comparing both ends

- Pipe backend uses clock_gettime and Logger backend uses current_kernel_time
- Because dlogutil uses clock_gettime, it can't check elapsed time at the Logger backend
- Therefore, for portability, dlogutil doesn't record current time

- To prevent underflow, use long variables

Change-Id: I32a11e8518526e24953a5dcd414b8c634ad3d778
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoMerge changes Ib648c1bf,Idb9716c8 into tizen
Karol Lewandowski [Mon, 17 Oct 2016 14:00:20 +0000 (07:00 -0700)]
Merge changes Ib648c1bf,Idb9716c8 into tizen

* changes:
  dlog_logger: Drop redundant User/Group settings
  dloginit: Execute dloginit service with all filesystems mounted

7 years agoMerge "Micro-optimisation" into tizen
Karol Lewandowski [Mon, 17 Oct 2016 13:59:22 +0000 (06:59 -0700)]
Merge "Micro-optimisation" into tizen

7 years agoMerge "Fix device file path" into tizen
Karol Lewandowski [Mon, 17 Oct 2016 13:56:01 +0000 (06:56 -0700)]
Merge "Fix device file path" into tizen

7 years agoFix a deadlock 64/92364/2
Michal Bloch [Fri, 14 Oct 2016 16:31:27 +0000 (18:31 +0200)]
Fix a deadlock

Change-Id: I606ebf58c071be4974be58933799d1aadc214342
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agoFix device file path 47/92247/1
Kichan Kwon [Fri, 14 Oct 2016 06:21:30 +0000 (15:21 +0900)]
Fix device file path

Change-Id: If1dd8abde1bb68f63b04e2fc19ec6be9a529432f
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agodlog_logger: Drop redundant User/Group settings 94/91994/7
Karol Lewandowski [Wed, 12 Oct 2016 11:12:27 +0000 (13:12 +0200)]
dlog_logger: Drop redundant User/Group settings

User and Group default to root for system services.

Additionally, reformat note about TZ variable setting.

Change-Id: Ib648c1bf47169c3da5476e4612e11b5d8826ded3

7 years agodloginit: Execute dloginit service with all filesystems mounted 93/91993/7
Karol Lewandowski [Wed, 12 Oct 2016 11:08:15 +0000 (13:08 +0200)]
dloginit: Execute dloginit service with all filesystems mounted

dloginit needs access to /opt/etc/dlog.conf for it to read
administrator-provided config correctly.

Change-Id: Idb9716c80786a721b54bf5f67a7cc38065feeb59

7 years agoMicro-optimisation 23/92023/4
Michal Bloch [Wed, 12 Oct 2016 14:44:55 +0000 (16:44 +0200)]
Micro-optimisation

Change-Id: I790920282f4d6b4857d3a5b0535e5a9c202c8a70
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agoReport meddling with libdlog internal state 69/91669/10
Michal Bloch [Mon, 10 Oct 2016 16:56:03 +0000 (18:56 +0200)]
Report meddling with libdlog internal state

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