platform/core/system/dlog.git
7 years agoDocumentation. 37/85537/4 accepted/tizen/common/20160907.154334 accepted/tizen/ivi/20160908.003859 accepted/tizen/mobile/20160908.003754 accepted/tizen/tv/20160908.003811 accepted/tizen/wearable/20160908.003837 submit/tizen/20160907.035120
Michal Bloch [Tue, 23 Aug 2016 14:05:48 +0000 (16:05 +0200)]
Documentation.

Change-Id: Ifd945ead493a5999b837756a3fe62de599262ded
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agoAll backends use new logger and handle /dev/kmsg 29/84629/10
Michal Bloch [Fri, 19 Aug 2016 10:50:31 +0000 (12:50 +0200)]
All backends use new logger and handle /dev/kmsg

 * old daemon did not support /dev/kmsg logging, the new one does.
   Now all backends (not only pipe) use this functionality.
 * makes maintenance easier as there are no longer two separate daemons.
   This simplifies both code and packaging.

Change-Id: I90cd3f22b2d055cbe0e92291ca8b1992133a0939
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agoRefactor: KMSG now uses the same internal format 91/84591/11
Michal Bloch [Thu, 18 Aug 2016 13:45:47 +0000 (15:45 +0200)]
Refactor: KMSG now uses the same internal format

This massively simplifies code because there are no longer two
structures with differing layout but same name, which then allows
to unify a lot of duplicated functions which did the same thing
over different structures.

Change-Id: I585e6535ef15b53625d17fff581a41b434c558af
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agoLogger: minor code fixes 99/86099/1
Michal Bloch [Tue, 30 Aug 2016 12:57:57 +0000 (14:57 +0200)]
Logger: minor code fixes

Change-Id: I48f29b1e935c0dacb82e60afb22fb1158bc21485
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agoConfig: fix typos 29/85929/1
Michal Bloch [Mon, 29 Aug 2016 14:25:55 +0000 (16:25 +0200)]
Config: fix typos

Change-Id: I3ff436b7593b9c895925c48bd40a33352a5fcc94
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agoFix a memleak 02/85302/2
Michal Bloch [Wed, 24 Aug 2016 12:46:02 +0000 (14:46 +0200)]
Fix a memleak

Change-Id: Idba70819901ebfe5ce9076bf5afd2965ce891bc6
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agoPipe: fix typos in logger 12/84812/1
Michal Bloch [Mon, 22 Aug 2016 12:03:57 +0000 (14:03 +0200)]
Pipe: fix typos in logger

Change-Id: I57701b6cf5386fbda2f2c0ecc258cb76e250a635
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agoRemove journal backend 47/84647/2
Kichan Kwon [Sat, 20 Aug 2016 07:55:27 +0000 (16:55 +0900)]
Remove journal backend

- It is substituted to pipe backend

Change-Id: Ica8025cfe5c0a4734782a1dad5a56f2efb2ba646
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoPipe devkmsg file: set standard format 25/84625/1
Michal Bloch [Fri, 19 Aug 2016 12:57:54 +0000 (14:57 +0200)]
Pipe devkmsg file: set standard format

Change-Id: I130235cd6ba78dce943d4f0c817415888e3b17c9
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agodloginit: fix output config 23/84623/2
Michal Bloch [Fri, 19 Aug 2016 12:31:26 +0000 (14:31 +0200)]
dloginit: fix output config

dloginit is supposed to write the real sizes of created buffers
to the config, but it sometimes used to write nulls even on success.

Change-Id: I02d521e43b165bb83fe4e5106ab5244eb1b211d6
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agoFix minor config issue 85/84585/1
Michal Bloch [Fri, 19 Aug 2016 10:13:23 +0000 (12:13 +0200)]
Fix minor config issue

Paths to all buffers need to be defined even if they are not used.

Change-Id: I8b6c34c14417eb41fb7dd4d47ea1e2282fb3a5f7
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agoPipe: fix minor issues 74/84574/1
Michal Bloch [Fri, 19 Aug 2016 09:12:05 +0000 (11:12 +0200)]
Pipe: fix minor issues

 * use thread-safe functions
   (the daemon is single-threaded, this is mostly for code checking tools)
 * prevent mis-expressed starvation
 * fix a slight error in dlogutil format expectation
 * add a label for a conditionally compiled legacy block

Change-Id: Ic243bafe243194b95de27fa78a469e1fbb356d74
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agoPipe: add /dev/kmsg support. 69/84269/5
Michal Bloch [Thu, 18 Aug 2016 19:44:17 +0000 (21:44 +0200)]
Pipe: add /dev/kmsg support.

 * add a -k parameter to dlog_logger configuration which enables /dev/kmsg reading.
 * the -b parameter accepts "kmsg" now.
 * the framework is easy to extend for the devices used by other backends
   (i.e. /dev/kmsg## and /dev/log_*) in the future.

Change-Id: I2d17bcbb0a6455320869c19f1f3885d6baa63fe1
Signed-off-by: Kazimierz Krosman <k.krosman@samsung.com>
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agoPipe: Fix invalid rights 68/84268/2
Michal Bloch [Tue, 16 Aug 2016 16:21:07 +0000 (18:21 +0200)]
Pipe: Fix invalid rights

Change-Id: I81885a7cdf66f9cbab24469e2d78840666d723a9
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agoPipe: Fix rare flushing of seldomly used buffers 67/84267/2
Michal Bloch [Tue, 16 Aug 2016 16:20:26 +0000 (18:20 +0200)]
Pipe: Fix rare flushing of seldomly used buffers

For any given buffer, if all other buffers combined receive messages more often than the time threshold (-t parameter),
the remaining buffer will only flush when the data threshold (-b parameter) is met regardless of time.
Both conditions are supposed to trigger a flush.

Change-Id: I522d2f09e788f9eb731f9e5e1039dcc1a0e64aac
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agoshared : remove timezone in the kerneltime format 74/82574/2
Kichan Kwon [Thu, 4 Aug 2016 08:17:41 +0000 (17:17 +0900)]
shared : remove timezone in the kerneltime format

Change-Id: I21bb01cf0ce46bc5dcbf066df5996d22c952134b
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoSize tunning of dlog logger 14/83414/3 accepted/tizen/common/20160812.140754 accepted/tizen/ivi/20160812.010731 accepted/tizen/mobile/20160812.010740 accepted/tizen/tv/20160812.010727 accepted/tizen/wearable/20160812.010724 submit/tizen/20160811.065739
Kunhoon Baik [Wed, 10 Aug 2016 13:45:38 +0000 (22:45 +0900)]
Size tunning of dlog logger

At Tizen 2.3.1, dlog logger's size of each buffer was under 1M.
At Tizen 3.0, the dlog logger size may be shrinked to 2.3.1 after stablization completion.
(2.3.1 -> System : 512K, Radio : 256K, Main/App : 512K)

This is first trial of reducing log size at Tizen 3.0.

Change-Id: I019e8c650b27d7f97e57bf53f0e0a9f5537d7e5e

7 years agoHawkp is not used as Tizen reference board any more 00/82800/1
Kunhoon Baik [Sat, 6 Aug 2016 02:08:17 +0000 (11:08 +0900)]
Hawkp is not used as Tizen reference board any more

Change-Id: I125f48856c9e5681324929c6cee23ef3758f8be9

7 years agoSet default backend to pipe backend and remove switch about journal backend 53/82353/3 accepted/tizen/common/20160804.174358 accepted/tizen/ivi/20160804.081132 accepted/tizen/mobile/20160804.081203 accepted/tizen/tv/20160804.081048 accepted/tizen/wearable/20160804.081114 submit/tizen/20160803.081834
Kichan Kwon [Wed, 3 Aug 2016 05:05:31 +0000 (14:05 +0900)]
Set default backend to pipe backend and remove switch about journal backend

Change-Id: Ia0e900023999d036f5b7359b3c60bedb31e1ce41
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agodlogutil : set the default format of pipe backend with others 52/82352/1
Kichan Kwon [Wed, 3 Aug 2016 05:00:16 +0000 (14:00 +0900)]
dlogutil : set the default format of pipe backend with others

Change-Id: I80570fc030003074d47683316c3e9b272690cd40
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoKMSG: conform to the new format 93/80893/5 accepted/tizen/ivi/20160804.080943 accepted/tizen/mobile/20160804.080951 accepted/tizen/tv/20160804.080941 accepted/tizen/wearable/20160804.080919 submit/tizen/20160803.053117
Michal Bloch [Wed, 20 Jul 2016 13:50:43 +0000 (15:50 +0200)]
KMSG: conform to the new format

 - To use escape sequence at dlog, log format stored in the kernel buffer is modified
 - Notice : to apply this patch, you MUST use kernel with applied patch "kmsg: allow binary characters"

Change-Id: Ic73e6da895404a7b5bcf520bf13737f10bcfc939
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoMerge "Apply Tizen Coding Rule" into tizen
Karol Lewandowski [Fri, 22 Jul 2016 12:56:02 +0000 (05:56 -0700)]
Merge "Apply Tizen Coding Rule" into tizen

7 years agoMerge "Pipe: safety against minor errors." into tizen
Karol Lewandowski [Fri, 22 Jul 2016 12:55:36 +0000 (05:55 -0700)]
Merge "Pipe: safety against minor errors." into tizen

7 years agoMerge "Pipe: util with --dumpfile exits on invalid file" into tizen
Karol Lewandowski [Fri, 22 Jul 2016 12:51:31 +0000 (05:51 -0700)]
Merge "Pipe: util with --dumpfile exits on invalid file" into tizen

7 years agoMerge "Pipe-backend: do not perform doomed writes" into tizen
Karol Lewandowski [Fri, 22 Jul 2016 12:48:04 +0000 (05:48 -0700)]
Merge "Pipe-backend: do not perform doomed writes" into tizen

7 years agoApply Tizen Coding Rule 64/81164/3
Michal Bloch [Thu, 21 Jul 2016 17:19:58 +0000 (19:19 +0200)]
Apply Tizen Coding Rule

Change-Id: I68ab663b9a6756db15204f0c68b788c2fecab540
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agoPipe: safety against minor errors. 63/81163/3
Michal Bloch [Thu, 21 Jul 2016 16:29:38 +0000 (18:29 +0200)]
Pipe: safety against minor errors.

Change-Id: Ic273a498f9f292af2080c44a4ba481e53d9dac69
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agoPipe: util with --dumpfile exits on invalid file 63/81063/3
Michal Bloch [Thu, 21 Jul 2016 16:05:05 +0000 (18:05 +0200)]
Pipe: util with --dumpfile exits on invalid file

Change-Id: I1aa5bb627413e837904b87b5f3a988d06a4a343d
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agoPipe-backend: do not perform doomed writes 58/81058/4
Michal Bloch [Thu, 21 Jul 2016 13:28:39 +0000 (15:28 +0200)]
Pipe-backend: do not perform doomed writes

If a write is doomed to fail (i.e. when there is no connection to pipe
and the the attempt to reestablish the connection did not succeed either),
do not perform the write.

Change-Id: Ia6525875f34d4efdbe4a596556f3f9675de60cd2
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
7 years agoMerge "Pipe backend: bulk writing to file" into tizen
Karol Lewandowski [Fri, 22 Jul 2016 12:28:13 +0000 (05:28 -0700)]
Merge "Pipe backend: bulk writing to file" into tizen

7 years agoMerge "Pipe: improve scheduling" into tizen
Karol Lewandowski [Fri, 22 Jul 2016 12:27:10 +0000 (05:27 -0700)]
Merge "Pipe: improve scheduling" into tizen

7 years agoSet SmackProcessLabel to System 47/80847/1 accepted/tizen/common/20160721.175753 accepted/tizen/ivi/20160721.090744 accepted/tizen/mobile/20160721.090450 accepted/tizen/tv/20160721.091307 accepted/tizen/wearable/20160721.091016 submit/tizen/20160721.003054
Yunjin Lee [Wed, 20 Jul 2016 11:21:22 +0000 (20:21 +0900)]
Set SmackProcessLabel to System

Change-Id: I5aa9926c8833b6b51b62322a4c88b1b1970b8996
Signed-off-by: Yunjin Lee <yunjin-.lee@samsung.com>
8 years agodlog_logger : dump apps buffer when the backend is kmsg 88/80188/2
Kichan Kwon [Fri, 15 Jul 2016 06:26:46 +0000 (15:26 +0900)]
dlog_logger : dump apps buffer when the backend is kmsg

Change-Id: Ib7a83241e7a72b2bc527f52801a8bae0698d18f4
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
8 years agoPipe backend: bulk writing to file 58/79758/4
Kazimierz Krosman [Tue, 12 Jul 2016 11:46:31 +0000 (13:46 +0200)]
Pipe backend: bulk writing to file

This patch introduce bulk writes to file. Instead of calling write()
for each log, dlog_logger prepares memory blob with logs and then
makes write operation to file.

Change-Id: I4664e547571383b360ad9ad56756517be959eab5

8 years agoPipe: improve scheduling 09/79209/4
Michal Bloch [Fri, 8 Jul 2016 14:20:47 +0000 (16:20 +0200)]
Pipe: improve scheduling

This patch improves scheduling by modifying -t parameter logic.
In this version dlog_logger dumps buffered logs to file after
[t] seconds of not receiving new logs. Logs can be also dumped
by [b] parameter.

Change-Id: Ib48fd437eceb1e06720f4296806c0688f306c620
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
8 years agoApply Tizen coding rule 43/79843/3 accepted/tizen/common/20160714.152718 accepted/tizen/ivi/20160714.053925 accepted/tizen/mobile/20160714.053906 accepted/tizen/tv/20160714.053909 accepted/tizen/wearable/20160714.053917 submit/tizen/20160714.000744
Kichan Kwon [Wed, 13 Jul 2016 07:53:10 +0000 (16:53 +0900)]
Apply Tizen coding rule

Change-Id: I1997e9d87fbb870e4b666f1f52756d585d6f5fc2
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
8 years agoPipe-backend: change dlogutil handling of raw files 29/78229/5
Michal Bloch [Tue, 5 Jul 2016 15:06:53 +0000 (17:06 +0200)]
Pipe-backend: change dlogutil handling of raw files

* no longer handled through stdin. This is due to
  the fact that crash-worker redirects core dumps
  to util's input and touching them corrupts them

* now accepts a "--dumpfile" parameter, which can
  parse a raw file and dump its contents.

Change-Id: I0e73a57194e7fc0137d678bee271ddcbdfd9473b
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
8 years agoPipe improvements: 37/78437/4
Michal Bloch [Tue, 5 Jul 2016 15:04:52 +0000 (17:04 +0200)]
Pipe improvements:

* add safety against malicious programs who could
  forge an invalid log or access a buffer they are
  not eligible to access.
* fix logger not noticing when a connected util
  gets killed through external means.
* fix an issue with file flags.
* fix util dump mode being lagged.

Change-Id: I5fda36d7cb74eef51a905e91ded7f60fac6d0fdd
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
8 years agoFix kmsg logger issue 32/78232/2 accepted/tizen/common/20160707.171704 accepted/tizen/ivi/20160707.043456 accepted/tizen/mobile/20160707.043535 accepted/tizen/tv/20160707.043348 accepted/tizen/wearable/20160707.043503 submit/tizen/20160707.025405
Michal Bloch [Mon, 4 Jul 2016 15:38:37 +0000 (17:38 +0200)]
Fix kmsg logger issue

Change-Id: Iac4dc9b7d9a34b7a08cb1dfc3aad72b1954329bb
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
8 years agoRemove Unused TC Code 59/77959/1
Kunhoon Baik [Sat, 2 Jul 2016 05:17:58 +0000 (14:17 +0900)]
Remove Unused TC Code

TODO : iUTC should be created

Change-Id: Ied40c5f8e6bbf6d1656730b739d1242e52786377

8 years agoApply Tizen coding rule 44/77444/2
Kichan Kwon [Wed, 29 Jun 2016 05:07:03 +0000 (14:07 +0900)]
Apply Tizen coding rule

Change-Id: I4ae4f6019a9afbc4658bafe19f2ecc7770d09721
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
8 years agoImprovements to Pipe backend: 51/73851/12
Michal Bloch [Tue, 14 Jun 2016 15:58:43 +0000 (17:58 +0200)]
Improvements to Pipe backend:

* each buffer now has its own socket, this way
  they can have separate level of access.
* dlogutil now sorts logs received from daemon.
  This is to guarantee time sequence.
* daemon output is now binary, which both
  increases performance and gives the user more
  control (for example, over output formatting).
* improve logger security. Clogged pipes cannot
  freeze the daemon.
* fix some cases of logs being dropped.
* performance tests now have better coverage.
* dlogctrl now provides documentation for config values.

Change-Id: I2718281828459045235360287471352662497757
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
8 years agodlogutil : add "-x" option when the backend is kmsg or logger. 03/75303/4
Kichan Kwon [Fri, 17 Jun 2016 09:23:11 +0000 (18:23 +0900)]
dlogutil : add "-x" option when the backend is kmsg or logger.

- "-x" : don't print logs written before last printed log

Change-Id: I7f1e33c24aa555c64503b1f5bbc9382e668de353
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
8 years agoFix potential defects of source code 72/75172/1 accepted/tizen/common/20160627.191124 accepted/tizen/ivi/20160623.120600 accepted/tizen/mobile/20160623.120509 accepted/tizen/tv/20160623.120528 accepted/tizen/wearable/20160623.120545 submit/tizen/20160622.002614
Sunmin Lee [Fri, 17 Jun 2016 02:28:26 +0000 (11:28 +0900)]
Fix potential defects of source code

Fix potential defects as below:
 logger/logger.c: substitute 'sprintf' with 'snprintf'
 shared/logconfig.c: close file pointer in all exit cases

Change-Id: I6cea5719a134e699de765705a4ead38192344d3c
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
8 years agodlogutil : apply Tizen coding rule 01/75001/1
Kichan Kwon [Thu, 16 Jun 2016 08:40:46 +0000 (17:40 +0900)]
dlogutil : apply Tizen coding rule

Change-Id: Ic26f25baa1ad91244fb735750c3f2802452ff6e8
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
8 years agoAdd lcov comments for coverage measurement 82/74982/1
Kichan Kwon [Thu, 16 Jun 2016 08:00:25 +0000 (17:00 +0900)]
Add lcov comments for coverage measurement

Change-Id: I870fece8561aaa1db0b02cbf830fbe3987849d98
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
8 years agodlogutil : add "-d" option when the backend is journal 92/73892/3 accepted/tizen/common/20160616.151640 accepted/tizen/ivi/20160616.002553 accepted/tizen/mobile/20160616.002528 accepted/tizen/tv/20160616.002517 accepted/tizen/wearable/20160616.002524 submit/tizen/20160615.070756
Kichan Kwon [Fri, 10 Jun 2016 03:15:58 +0000 (12:15 +0900)]
dlogutil : add "-d" option when the backend is journal

- "-d" : print log and exit (non-blocking)

- "-v" is ignored because of crash-worker issue

Change-Id: I81ae7854b1f9bbbc5e107a198f880b2ef577103f
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
8 years agoModify license notice file 88/73888/1
Kichan Kwon [Fri, 10 Jun 2016 02:47:37 +0000 (11:47 +0900)]
Modify license notice file

Change-Id: I7f8878eaba45e9c950b826f7afc4a0162f3f24b9
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
8 years agoAccount for a minor KMSG/AndroidLogger difference. 21/73121/1
Michal Bloch [Mon, 6 Jun 2016 15:01:28 +0000 (17:01 +0200)]
Account for a minor KMSG/AndroidLogger difference.

Change-Id: I41003da02d59305cde44a1ad41c912c50d8a2eec
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
8 years agodlog_logger: move to libdlog package for pipe. 41/72841/1
Michal Bloch [Thu, 2 Jun 2016 14:48:19 +0000 (16:48 +0200)]
dlog_logger: move to libdlog package for pipe.

In the pipe backend, dlog_logger is the crucial
component which is needed for the library to be
able to log. Thus it needs to live in the package
alongside the library.

Change-Id: I3141592653589793238462643383279502884197
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
8 years agoconfigure: Allow exactly one backend to be selected 31/69331/16
Karol Lewandowski [Mon, 30 May 2016 15:15:00 +0000 (17:15 +0200)]
configure: Allow exactly one backend to be selected

Change-Id: Iae4e84b2a7b66727725f3ec11c7db07cb98f5371

8 years agoconfigure: automatically define backend-specific constants 87/69287/17
Karol Lewandowski [Mon, 30 May 2016 15:14:24 +0000 (17:14 +0200)]
configure: automatically define backend-specific constants

This commit moves previously explicitly specified DLOG_BACKEND_*
defines to be defined automatically by configure.

Change-Id: I1ed16036bd2214be75db6fdf3c5d12951e7d12e4

8 years agoAdd tests. 95/68595/26
Michal Bloch [Mon, 30 May 2016 15:13:27 +0000 (17:13 +0200)]
Add tests.

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

8 years agoAdd a pipe-based userspace logging backend. 38/67438/26
Kazimierz Krosman [Mon, 30 May 2016 15:05:54 +0000 (17:05 +0200)]
Add a pipe-based userspace logging backend.

Change-Id: I1dca48f71ecf637c71f651f511ceca8d99ca16d1
Signed-off-by: Kazimierz Krosman <k.krosman@samsung.com>
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
8 years agoRefactor configuration files. 37/67437/22
Michal Bloch [Mon, 30 May 2016 15:02:12 +0000 (17:02 +0200)]
Refactor configuration files.

There is now a single config file containing everything,
instead of spreading the values over multiple files
and hardcoded definitions.

Change-Id: I0173cf5c41688ccfdfaeeff529394908470a7003
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Signed-off-by: Kazimierz Krosman <k.krosman@samsung.com>
8 years agoRefactor: split logutil and libdlog backend handling into separate files. 36/67436/8
Michal Bloch [Mon, 30 May 2016 14:47:28 +0000 (16:47 +0200)]
Refactor: split logutil and libdlog backend handling into separate files.

Change-Id: I511c42eea8e0f624402ff0d456e9ee41317bb3cc
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Signed-off-by: Kazimierz Krosman <k.krosman@samsung.com>
8 years agoshared : set consistent dlogutil format 12/71812/2
Kichan Kwon [Fri, 27 May 2016 07:23:45 +0000 (16:23 +0900)]
shared : set consistent dlogutil format

- TIME PRIORITY TAG PID TID MESSAGE

- If both pid and tid are printed, print 'P' and 'T' to identify these

Change-Id: I59e694feedc8af386440ac00268174fbde994993
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
8 years agoshared : change dlogutil format "dump" to "kerneltime" 08/71808/2
Kichan Kwon [Fri, 27 May 2016 07:07:52 +0000 (16:07 +0900)]
shared : change dlogutil format "dump" to "kerneltime"

- "dump" is exactly overlapped with "threadtime"

- "kerneltime" prints tv_sec

Change-Id: Id1491c98c7f0f88400911e41a08e05f37b254e4a
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
8 years agolibdlog : extend maximum log size when the backend is journal 69/71369/1 accepted/tizen/common/20160526.145955 accepted/tizen/ivi/20160526.094800 accepted/tizen/mobile/20160526.095106 accepted/tizen/tv/20160526.094816 accepted/tizen/wearable/20160526.094959 submit/tizen/20160525.075612
Kichan Kwon [Wed, 25 May 2016 06:56:49 +0000 (15:56 +0900)]
libdlog : extend maximum log size when the backend is journal

- logger and kmsg are already extended

Change-Id: Ia43ea428fbff3d35e478dc39bca1639182b4349a
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
8 years agolibdlog : fix error when the backend is journal 48/71348/1 submit/tizen/20160525.062453
Kichan Kwon [Wed, 25 May 2016 06:22:03 +0000 (15:22 +0900)]
libdlog : fix error when the backend is journal

Change-Id: I162da9e3d691da37ae73625b123d1e10c1297ce9
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
8 years agodlog_logger: prevent multiple statting. 35/67435/4
Kazimierz Krosman [Tue, 24 May 2016 16:19:09 +0000 (18:19 +0200)]
dlog_logger: prevent multiple statting.

Previously, dlog_logger would stat /etc/localtime each time
it wanted to get the timestamp. Now it will only do so once,
increasing performance.

Change-Id: I001b106f35ce1c87c00c514e28301329d784ed7c
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Signed-off-by: Kazimierz Krosman <k.krosman@samsung.com>
8 years agoBuild process: reduce journal backend redundancy. 34/67434/4
Kazimierz Krosman [Tue, 24 May 2016 16:18:33 +0000 (18:18 +0200)]
Build process: reduce journal backend redundancy.

Only link journal libraries when actually using that backend.
Do not use the rules file when using that backend.

change-Id: Ibacabaca31657f39e82fc97379d42f66ae904c7c
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Signed-off-by: Kazimierz Krosman <k.krosman@samsung.com>
8 years agoMerge " Define -1 in the log_id_t" into tizen submit/tizen/20160524.120520
Kichan Kwon [Tue, 24 May 2016 12:03:59 +0000 (05:03 -0700)]
Merge " Define -1 in the log_id_t" into tizen

8 years ago Define -1 in the log_id_t 05/71205/2
Kichan Kwon [Tue, 24 May 2016 11:28:47 +0000 (20:28 +0900)]
 Define -1 in the log_id_t

    - log_id_t is enum type which -1 isn't defined
    - So, if (id < 0) returns false though id is -1

Change-Id: I28bad625b00269e0f3256517b449c7a50efe8a38
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
8 years agoApply Tizen coding rule 39/67239/3
Kichan Kwon [Tue, 26 Apr 2016 04:16:12 +0000 (13:16 +0900)]
Apply Tizen coding rule

Change-Id: I5fa659ddb9902e72321f2841cb753c7e171cd7b5
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
8 years agoExtend maximum log size 28/66828/8
Kichan Kwon [Thu, 21 Apr 2016 09:06:29 +0000 (18:06 +0900)]
Extend maximum log size

- 1024 -> 4076 bytes

! Notice : full log includes tag and priority. So, maximum message size is a little bit small.

Change-Id: I812f79b42b7a470e32a3c9795b8e80784349d248
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
8 years agoModify first release version 99/65099/2 accepted/tizen/common/20160419.142652 accepted/tizen/ivi/20160418.235036 accepted/tizen/mobile/20160418.235000 accepted/tizen/tv/20160418.235022 accepted/tizen/wearable/20160418.235016 submit/tizen/20160418.001756
Kichan Kwon [Thu, 7 Apr 2016 08:06:34 +0000 (17:06 +0900)]
Modify first release version

Change-Id: If617a04afb44fdc875cffc149a48e3f5934ff47e
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
8 years agocommon: apply Tizen Coding Rule 67/64367/1
Taeyoung Kim [Fri, 1 Apr 2016 00:36:54 +0000 (09:36 +0900)]
common: apply Tizen Coding Rule

Change-Id: I5c7ec73a54ed9efa1960f70c5d67bf762350946f
Signed-off-by: Taeyoung Kim <ty317.kim@samsung.com>
8 years agoRevert "Modify default backend" 53/64353/1 accepted/tizen/common/20160401.075458 accepted/tizen/ivi/20160401.023747 accepted/tizen/mobile/20160401.023659 accepted/tizen/tv/20160401.023713 accepted/tizen/wearable/20160401.023732 submit/tizen/20160331.234726
Kunhoon Baik [Thu, 31 Mar 2016 14:15:51 +0000 (07:15 -0700)]
Revert "Modify default backend"

This reverts commit 9cda76d35021217d483bc4d9e2b7678bad9b85ab.

Change-Id: Id8dc2ca28b1bdbee429e21748c67997d8f7a6dca

8 years agoModify default backend 38/64138/1 accepted/tizen/common/20160331.051217 accepted/tizen/ivi/20160330.134240 accepted/tizen/mobile/20160330.134141 accepted/tizen/tv/20160330.134157 accepted/tizen/wearable/20160330.134217 submit/tizen/20160330.112014
Kichan Kwon [Wed, 30 Mar 2016 08:16:13 +0000 (17:16 +0900)]
Modify default backend

- kmsg -> logger

Change-Id: If2b04dd3388d5f0cdf2c7689347c111ad42ca921
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
8 years agoRemove needless files 44/63944/1
Kichan Kwon [Tue, 29 Mar 2016 02:40:35 +0000 (11:40 +0900)]
Remove needless files

- 01-dlog.rules is replaced to packaging/01-dlog.rules.BACKEND
- dlog_logger.conf-(debug, micro).in aren't used anymore
- dlogutil.sh, used when the backend is journal, isn't needed
 because dlogutil can print journal log

Change-Id: Ibae0dabc7e976e5a42cd3b3f802d40b452c79a69
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
8 years agocommon: remove thread unsafe function 97/63497/1 accepted/tizen/common/20160325.135342 accepted/tizen/ivi/20160324.131403 accepted/tizen/mobile/20160324.132553 accepted/tizen/tv/20160324.132448 accepted/tizen/wearable/20160324.132428 submit/tizen/20160324.084910
Taeyoung Kim [Thu, 24 Mar 2016 08:21:59 +0000 (17:21 +0900)]
common: remove thread unsafe function

Signed-off-by: Taeyoung Kim <ty317.kim@samsung.com>
Change-Id: Ib178305e2d8d9729646c68cade35559233fa4037

8 years agoBug fix for "https://review.tizen.org/gerrit/#/c/62539/" 76/63476/1 submit/tizen/20160324.075130
Kunhoon Baik [Thu, 24 Mar 2016 07:36:26 +0000 (16:36 +0900)]
Bug fix for "https://review.tizen.org/gerrit/#/c/62539/"

Change-Id: Ib67fc70e02fc476486027eeab8c2ffe13c8f9001

8 years agoDlog Backend Change 40/62840/3 submit/tizen/20160324.061612
Kunhoon Baik [Sat, 19 Mar 2016 03:43:51 +0000 (12:43 +0900)]
Dlog Backend Change

Emulator -> logger driver
TM1, hawkp -> kmsg

Change-Id: I041a58967088a6a63c439df5479d0af601ae2860
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
8 years agoFix unsafe code 68/63368/1 accepted/tizen/ivi/20160323.141145 accepted/tizen/mobile/20160323.135929 accepted/tizen/tv/20160323.140125 accepted/tizen/wearable/20160323.135905 submit/tizen/20160323.104541
Kichan Kwon [Wed, 23 Mar 2016 10:38:57 +0000 (19:38 +0900)]
Fix unsafe code

Change-Id: Ic0aed80868531e64a668469121da9c97e417753c
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
8 years agoClose config file at the end of the function 49/63249/1
Kichan Kwon [Wed, 23 Mar 2016 02:21:46 +0000 (11:21 +0900)]
Close config file at the end of the function

Change-Id: Id800cc9ab63c0f6556baa65e389cfa11f04e2901
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
8 years agoSubstitute thread unsafed functions 39/62539/3
Kichan Kwon [Wed, 16 Mar 2016 11:42:15 +0000 (20:42 +0900)]
Substitute thread unsafed functions

Change-Id: Ic5a3a50b39ff92ab7fa27c3856e4d9cf01564c81
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
8 years agoMerge "Set the default backend of wearable target to logger" into tizen
Kichan Kwon [Fri, 11 Mar 2016 04:53:41 +0000 (20:53 -0800)]
Merge "Set the default backend of wearable target to logger" into tizen

8 years agoSet the default backend of wearable target to logger 48/61848/1 accepted/tizen/common/20160316.155220 accepted/tizen/ivi/20160313.114346 accepted/tizen/mobile/20160313.113237 accepted/tizen/tv/20160313.113600 accepted/tizen/wearable/20160313.114001 submit/tizen/20160311.045435
Kichan Kwon [Fri, 11 Mar 2016 02:44:49 +0000 (11:44 +0900)]
Set the default backend of wearable target to logger

- To get more speed

- In current, all kinds of released Tizen wearable devices use kernel
 supporting logger

Change-Id: I78e4128a2a003d6e0ce30de9f26fc5a11616ce8b
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
8 years agoSet the default backend of wearable target to logger
Kichan Kwon [Fri, 11 Mar 2016 02:44:49 +0000 (11:44 +0900)]
Set the default backend of wearable target to logger

- To get more speed

- In current, all kinds of released Tizen wearable devices use kernel
 supporting logger

Change-Id: I78e4128a2a003d6e0ce30de9f26fc5a11616ce8b
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
8 years agoRemove compile option about m4 36/61836/1
Kichan Kwon [Fri, 11 Mar 2016 02:08:33 +0000 (11:08 +0900)]
Remove compile option about m4

- dlog.h.m4 is no longer used.

- Related patch : https://review.tizen.org/gerrit/#/c/58843/

Change-Id: I57d9b25c5e931c661973ee09bf96cfa97ed1bda0
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
8 years agoApply Tizen directory path guide 62/61562/1
Kichan Kwon [Wed, 9 Mar 2016 02:02:26 +0000 (11:02 +0900)]
Apply Tizen directory path guide

- But, there is no changed path

- /opt/etc -> TZ_SYS_ETC (/opt/etc)

Change-Id: Ie27e8df2519d991d74b3f94cabc5481e94f35e1a
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
8 years agolibdlog : change the return value when the backend is journal. 55/61355/1 accepted/tizen/common/20160310.065108 accepted/tizen/ivi/20160309.004820 accepted/tizen/mobile/20160309.004726 accepted/tizen/tv/20160309.004744 accepted/tizen/wearable/20160309.004759 submit/tizen/20160308.043916
Kichan Kwon [Mon, 7 Mar 2016 10:45:32 +0000 (19:45 +0900)]
libdlog : change the return value when the backend is journal.

 - Existed : 0(success), ERRNO(fail)
 - Now : written bytes(success), ERRNO(fail)

Change-Id: Icc4e9906079942d727b677c53b909d80b093941e
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
8 years agoRename dlog_debug_mode to debug_mode 16/61116/1 accepted/tizen/common/20160304.204105 accepted/tizen/ivi/20160304.140450 accepted/tizen/mobile/20160304.140342 accepted/tizen/tv/20160304.140412 accepted/tizen/wearable/20160304.140433 submit/tizen/20160304.051343
Kichan Kwon [Fri, 4 Mar 2016 05:09:11 +0000 (14:09 +0900)]
Rename dlog_debug_mode to debug_mode

Change-Id: If9d321f4302024b25940070eee2af733e41d7dcc
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
8 years agoRevert "Rename dlog_debug_mode to debug_mode" 15/61115/1
Kwon [Fri, 4 Mar 2016 05:08:00 +0000 (21:08 -0800)]
Revert "Rename dlog_debug_mode to debug_mode"

This reverts commit 1bfe01e47df578825f51da5b785b7d3380c77d29.

Change-Id: I7f385b987d95bd310edaf4a1589a569dfdfc9162

8 years agoRename dlog_debug_mode to debug_mode 07/61107/2
Kichan Kwon [Fri, 4 Mar 2016 04:45:21 +0000 (13:45 +0900)]
Rename dlog_debug_mode to debug_mode

Change-Id: I31b2b6cfe61b28a14a909655988e892a274f9e69
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
8 years agoDelete TIZEN_ENGINEER_MODE 44/58844/2 accepted/tizen/common/20160302.193230 accepted/tizen/ivi/20160302.002927 accepted/tizen/mobile/20160302.002835 accepted/tizen/tv/20160302.002853 accepted/tizen/wearable/20160302.002912 submit/tizen/20160229.023827
Kichan Kwon [Thu, 4 Feb 2016 02:47:59 +0000 (11:47 +0900)]
Delete TIZEN_ENGINEER_MODE

 - It just turns on DLOG_DEBUG_ENABLE

 - Instead, spec file turns on DLOG_DEBUG_ENABLE directly

 - Accordingly, engineer_mode is renamed to dlog_debug_mode

Change-Id: I4f90a604171f1cb41a5867779e1c209a34f2a55b
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
8 years agoNo longer to use dlog.h.m4 43/58843/2
Kichan Kwon [Thu, 4 Feb 2016 02:37:43 +0000 (11:37 +0900)]
No longer to use dlog.h.m4

Divide existing dlog.h.m4 to below

 - dlog.h : public API

 - dlog-internal.h : macro

Change-Id: I2f310f02323dbd04244493e09ea02916ce4ab663
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
8 years agodlog_logger isn't installed if the current backend is journal. 22/58622/1 accepted/tizen/ivi/20160218.023809 accepted/tizen/mobile/20160203.050652 accepted/tizen/tv/20160203.050711 accepted/tizen/wearable/20160203.050729 submit/tizen/20160202.085236 submit/tizen_common/20160218.142243 submit/tizen_ivi/20160217.000000 submit/tizen_ivi/20160217.000003
Kichan Kwon [Tue, 2 Feb 2016 08:42:34 +0000 (17:42 +0900)]
dlog_logger isn't installed if the current backend is journal.

 dlog_logger dumps logs "from kernel buffer" onto disk,
so systemd-journal which uses user-level buffer doesn't have to use this.

Change-Id: I14d0de6f8e1919b24c4cf839e86f02d9a03906f6
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
8 years agoMakefile : make dlog.h first if other files need it. 36/57736/1 accepted/tizen/mobile/20160122.081014 accepted/tizen/tv/20160122.081152 accepted/tizen/wearable/20160122.081215 submit/tizen/20160122.071002
Kichan Kwon [Fri, 22 Jan 2016 06:54:30 +0000 (15:54 +0900)]
Makefile : make dlog.h first if other files need it.

 dlog.h must be existed to build dlog.

 However, when dlog is built in parallel, error can be occurred

because dlog.h is made by m4(not pre-made) in build time.

 Therefore, making dlog.h is preceded with building dlog.

Change-Id: I0c458a8978c13871fbb49529d5678a063f197782
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
8 years agoPrint error message if read_queued_entry_from_dev returns RQER_PARSE 19/57319/3 accepted/tizen/mobile/20160122.030307 accepted/tizen/tv/20160122.030322 accepted/tizen/wearable/20160122.030346 submit/tizen/20160119.091144
Kichan Kwon [Tue, 19 Jan 2016 02:45:16 +0000 (11:45 +0900)]
Print error message if read_queued_entry_from_dev returns RQER_PARSE

RQER_PARSE is returned when read log has different format with the current backend's.

In current, log format is well converted though the backend is changed.

However, to debug easily, this code is remained.

Change-Id: Ie0055932065054129d0976a31c74cfb1ffec0d08
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
8 years agolibdlog : __write_to_log_logger needs to return negative errors 15/57315/1
Kichan Kwon [Tue, 19 Jan 2016 02:40:44 +0000 (11:40 +0900)]
libdlog : __write_to_log_logger needs to return negative errors

This commit fixes the bug introduced by Tizen 2.3 code sync.

Change-Id: I356ee7b12f3fea69007ba3ef9851262b9b845ca6
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
8 years agodlog_logger : do nothing and exit if the backend is journal 06/57306/3
Kichan Kwon [Tue, 19 Jan 2016 01:48:29 +0000 (10:48 +0900)]
dlog_logger : do nothing and exit if the backend is journal

dlog_logger dumps logs to file, but journald does same activity.

Therefore, dlog_logger doesn't have to run if journal is backend.

Change-Id: Ifb75d6cc7b21e0ddb4ad38217a8975a22fe678c8
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
8 years agoqueued_entry : merge exactly same functions 54/57254/1
Kichan Kwon [Mon, 18 Jan 2016 11:00:35 +0000 (20:00 +0900)]
queued_entry : merge exactly same functions

Change-Id: Ia015d6c3d74cb07083a6f173ad42b3c69054667d
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
8 years agodoc: add macro related part 61/56861/2 accepted/tizen/mobile/20160114.012349 accepted/tizen/tv/20160114.012417 accepted/tizen/wearable/20160114.012435 submit/tizen/20160113.083230
Kichan Kwon [Wed, 13 Jan 2016 08:03:45 +0000 (17:03 +0900)]
doc: add macro related part

Delete needless header file

Change-Id: I8f4146d3306f8544f94928be38d9d7a5ac098a7e
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
8 years agoSet the back-end to logger if the target device is TM1 14/56714/2 accepted/tizen/mobile/20160113.050628 accepted/tizen/tv/20160113.050658 accepted/tizen/wearable/20160113.050720 submit/tizen/20160113.015408
Kichan Kwon [Tue, 12 Jan 2016 08:23:03 +0000 (17:23 +0900)]
Set the back-end to logger if the target device is TM1

* Reasons why other back-ends aren't used are same as follows.

 - TM1 kernel for additional kmsg isn't developed.

 - If journal is used at the TM1, booting speed is markedly slowed.

Change-Id: Ied072e5f089f7456b479ca72a888ceead3dc7aba
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
8 years agoMake dlog provide multiple back-ends 98/56598/3 accepted/tizen/mobile/20160112.223528 accepted/tizen/tv/20160112.223544 accepted/tizen/wearable/20160112.223606 submit/tizen/20160112.074927
Kichan Kwon [Mon, 11 Jan 2016 09:31:13 +0000 (18:31 +0900)]
Make dlog provide multiple back-ends

 - journal (existing)
 - Additional kmsg* (new)
 - logger (existing)

You can choose the back-end at the build time by modifying packaging/dlog.spec as below.

-----------------------------------------------------------
%define backend_journal OFF
%define backend_kmsg    OFF
%define backend_logger  ON
-----------------------------------------------------------

* Additional kmessage based dlog
 The main improvement of our additional kmessage is same as follows.

 - Multiple "kmsg buffers" : existing kmessage provides one in-kernel circular-buffer,
                            so whole logs are written to this. In ours, developers can
                            write logs to appropriate buffer according to the sender
                            (app, system, etc.). This policy corresponds with logger's,
                            so we can easily substitute logger after it will be deprecated.

 - Privilege : existing kmessage buffers has root authority and only privileged can write
              log messages to. In ours, applications of external developers can write to
              the "kmsg buffers", so developers can debug without changing dlog back-end.

! Notice : now, to use additional kmsg, you should use additional kmsg patched kernel.
          For Galaxy Note4, you can find patches at this link.

https://review.tizen.org/gerrit/#/q/status:open+project:platform/kernel/linux-exynos+branch:tizen+topic:%22kmsg+logger%22

Change-Id: I1c912b2b276b5af1ba46e1c8278bf9fb710e27e2
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
8 years agodlog_logger: change smack label of /var/log/dlog 60/56160/1 accepted/tizen/mobile/20160106.003119 accepted/tizen/tv/20160106.003102 accepted/tizen/wearable/20160106.003137 submit/tizen/20160105.054520
Kichan Kwon [Tue, 5 Jan 2016 04:57:46 +0000 (13:57 +0900)]
dlog_logger: change smack label of /var/log/dlog

 - "_" -> "System"

Change-Id: I4b6ee68863a6edd2cfa1d135bc838260a7fba003
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
8 years agoVersion upgrade 46/55946/1 accepted/tizen/mobile/20151230.223758 accepted/tizen/tv/20151230.223820 accepted/tizen/wearable/20151230.223829 submit/tizen/20151230.090339
Kichan Kwon [Wed, 30 Dec 2015 08:58:44 +0000 (17:58 +0900)]
Version upgrade

Change-Id: I4abf216ac832ef1a4bb8c4f541a81168bc8ee51e
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
8 years agologprint : use safe functions 70/55870/1 submit/tizen/20151230.034847
Kichan Kwon [Wed, 30 Dec 2015 02:40:29 +0000 (11:40 +0900)]
logprint : use safe functions

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