platform/core/system/dlog.git
4 years agoAdd __dlog_sec_print() to keep backward compatibility with existing MCD in-house... 03/217003/5 accepted/tizen/unified/20191107.051421 submit/tizen/20191106.015848
Hyotaek Shim [Tue, 5 Nov 2019 09:47:21 +0000 (18:47 +0900)]
Add __dlog_sec_print() to keep backward compatibility with existing MCD in-house Apps

.#define SECURE_LOG_(id, prio, tag, fmt, arg...) \
({ do { \
      __dlog_sec_print(id, prio, tag, "%s: %s(%d) > [SECURE_LOG] " fmt, __MODULE__, __func__, __LINE__, ##arg); \
} while (0); })

root@localhost:/usr/apps/com.samsung.w-manager-service/bin# ./w-manager-service
appcore: Failed to get application ID - pid(3962)
./w-manager-service: symbol lookup error: ./w-manager-service: undefined symbol: __dlog_sec_print

root@HyotaekShim:/platform/AppStoreWhitelist/20191106# grep -r __dlog_sec_print
000001044261_com.samsung.w-dialer2_100015.txt:__dlog_sec_print
000004264895_com.samsung.tizen.bixby-voice_210200007.txt:__dlog_sec_print
000001913406_com.samsung.w-spotify_300002.txt:__dlog_sec_print
000001902170_com.samsung.w-spotify_300001.txt:__dlog_sec_print
000002736570_com.samsung.w-manager-service_500300013.txt:__dlog_sec_print
000002420102_com.samsung.samsung-pay-app_100400303.txt:__dlog_sec_print
000001915993_com.samsung.w-spotify_300002.txt:__dlog_sec_print
000002750274_com.samsung.w-logs2_100300011.txt:__dlog_sec_print
000002738273_com.samsung.w-contacts2_100200074.txt:__dlog_sec_print
...

Change-Id: Ieda4e759213ab50810540574d98f72bb0491c6c9
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
4 years agoBump version to 6.0.1 29/217029/1 submit/tizen/20191105.163340
Michal Bloch [Tue, 5 Nov 2019 12:21:06 +0000 (13:21 +0100)]
Bump version to 6.0.1

Tizen 5.5 just had a release and forked off.

Change-Id: I452d9ccb456b7a5a28ee00ef1e56987f79b8ccbe
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
4 years agoImprove log_buffer_get_* exceptional conditions 98/216398/1
Mateusz Majewski [Thu, 24 Oct 2019 09:05:10 +0000 (11:05 +0200)]
Improve log_buffer_get_* exceptional conditions

We now handle the case in which the struct lacks the ending '\0'.
This would mean that one could read past the end of the struct while
using the result.

Change-Id: Ie70ffd57181dd351ab94db27550b8f967235648f

4 years agoAdd some missing consts 97/216397/1
Mateusz Majewski [Thu, 24 Oct 2019 08:51:22 +0000 (10:51 +0200)]
Add some missing consts

Change-Id: I22c50dea669bb940dc25871dc47d5ed8afaede6f

4 years agoRename DUMP_{CONTINUOUS,INFINITE} 24/216124/2
Mateusz Majewski [Mon, 21 Oct 2019 06:18:51 +0000 (08:18 +0200)]
Rename DUMP_{CONTINUOUS,INFINITE}

Change-Id: Ibc5746ba2bd82b115f8a41cc6378e301cd47c80b

4 years agoAdd a basic design overview document 96/215496/4
Michal Bloch [Wed, 9 Oct 2019 15:16:25 +0000 (17:16 +0200)]
Add a basic design overview document

Change-Id: Ic70b6025143ca00cd7c7441e254a242defe2feef
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
4 years agoAdd dlogutil_ prefix to logger_entry 26/215626/2
Mateusz Majewski [Fri, 11 Oct 2019 16:26:26 +0000 (18:26 +0200)]
Add dlogutil_ prefix to logger_entry

Change-Id: Ic5caa8139956f1dfff3dc5296a0a67e763a567ae

4 years agoAdd dlogutil_ prefix to write_callback 25/215625/1
Mateusz Majewski [Fri, 11 Oct 2019 16:12:16 +0000 (18:12 +0200)]
Add dlogutil_ prefix to write_callback

Change-Id: I2d1778741a66f1aee13d74e61208c489788009bb

4 years agoAdd dlogutil_ prefix to sorting_order 24/215624/1
Mateusz Majewski [Fri, 11 Oct 2019 16:04:28 +0000 (18:04 +0200)]
Add dlogutil_ prefix to sorting_order

Change-Id: I069c761ff6c6c390d994ac843efbf7d6cc24a6d9

4 years agoMove all pipe backend filtering server-side 09/215109/5
Mateusz Majewski [Tue, 1 Oct 2019 06:43:31 +0000 (08:43 +0200)]
Move all pipe backend filtering server-side

Previously, we used to carry around two filter settings objects in
dlogutil: a filter list, which contained a simple text list of all
filterspecs, and a filter object, which contained info about all other
filters set. The logger backend merged those two together and used
them to filter everything locally, while the pipe backend sent the
filter list to the server and filtered locally on filter object. This
patch does away with the filter list, so that everything is in the
filter object, and enables client to send the filter object. In
particular, this means that the server is able to filter by TID and PID
now.

Change-Id: Ic962da04a5657527f2f80fe20e35caa75d7e2782

4 years agoFix FilterInfo to use pid_t for tid 41/215341/1
Mateusz Majewski [Mon, 7 Oct 2019 06:34:17 +0000 (08:34 +0200)]
Fix FilterInfo to use pid_t for tid

Change-Id: If22062d76d02f62baad5fff5e756adbba56d0caf

4 years agoRefactor filter list a bit 70/214870/1
Mateusz Majewski [Thu, 26 Sep 2019 12:49:25 +0000 (14:49 +0200)]
Refactor filter list a bit

Change-Id: Ic69af18d2b91608708227c3c8c86d1f8dda842d1

4 years agoFix issues found by static analysis. 21/214521/5 accepted/tizen_5.5_unified_mobile_hotfix tizen_5.5_mobile_hotfix accepted/tizen/5.5/unified/20191031.021742 accepted/tizen/5.5/unified/mobile/hotfix/20201027.085839 accepted/tizen/unified/20190927.013321 submit/tizen/20190926.122500 submit/tizen_5.5/20191031.000004 submit/tizen_5.5_mobile_hotfix/20201026.185104 tizen_5.5.m2_release
Michal Bloch [Mon, 23 Sep 2019 15:49:26 +0000 (17:49 +0200)]
Fix issues found by static analysis.

Change-Id: I4d1e87a5e3b8091f5503d105a41764358e5b6840
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
4 years agoReplace strerror with %m 25/214725/4
Michal Bloch [Wed, 25 Sep 2019 14:36:57 +0000 (16:36 +0200)]
Replace strerror with %m

Change-Id: I071303c25389b958fd4d9ad5c3e74af97c92fe09
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
4 years agoFix coverity issue 47/214547/4
Yunmi Ha [Wed, 25 Sep 2019 14:38:46 +0000 (16:38 +0200)]
Fix coverity issue

- resolve "Uninitialized pointer read"

Change-Id: If160a36be2cd77ed7dadc8056b234098470a52a4
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
4 years agoChange size and dumping count types into size_t 95/214595/4
Mateusz Majewski [Tue, 24 Sep 2019 06:13:18 +0000 (08:13 +0200)]
Change size and dumping count types into size_t

This also requires changing a magic value triggering the infinite dump
mode from -1 into SIZE_MAX.

Change-Id: Ib033921ca72001de2570bf740383a8471e9cae35

4 years agoDon't output errors in dlogutil outside of logutil.c 65/214365/2
Mateusz Majewski [Fri, 20 Sep 2019 12:07:50 +0000 (14:07 +0200)]
Don't output errors in dlogutil outside of logutil.c

This is useful, beacuse those functions will probably end up being used
in libdlogutil, and writing to stderr in a library seems like a bad
idea.

Change-Id: Ic07ed3548bf901ea4878d4a54a3824a0760a9b88

4 years agoAdd meaningful error codes 64/214364/2
Mateusz Majewski [Fri, 20 Sep 2019 12:28:59 +0000 (14:28 +0200)]
Add meaningful error codes

Change-Id: Ic633e51ba49e8e9261ce4e9f33efec8a66f6079a

4 years agoFill the seconds field of invalid timestamps 68/214268/4
Mateusz Majewski [Thu, 19 Sep 2019 10:53:08 +0000 (12:53 +0200)]
Fill the seconds field of invalid timestamps

We used to fill only nsec with -1. However, this means that the sec
field is kept uninitialized. This means that reading it would be
undefined behavior, which is bad. This doesn't seem to happen in
dlogutil as is, but it would be possible when choosing a timestamp to sort
on is be implemented.

Also, a slight change to sort vector is done so that it works well in
such situation.

Change-Id: I501adad093c0782433d014395e8cc752f7d48574

4 years agoPropagate callback return value 58/214158/2
Mateusz Majewski [Wed, 18 Sep 2019 08:44:55 +0000 (10:44 +0200)]
Propagate callback return value

This will be especially useful in libdlogutil, where it will enable the
user of the library to return a nonzero value from the callback in order
to stop log processing.

Change-Id: I0565be6f8af2c7804a129250075778ec3f2b2e7c

4 years agoFix an include 95/213995/1
Mateusz Majewski [Tue, 17 Sep 2019 06:21:52 +0000 (08:21 +0200)]
Fix an include

Change-Id: I5368742a9054956d5b8506b92b47551a43b0cbb6

4 years agoFix an off-by-one inconsistency in the "out of order" message 99/213799/1
Mateusz Majewski [Wed, 11 Sep 2019 11:59:59 +0000 (13:59 +0200)]
Fix an off-by-one inconsistency in the "out of order" message

The len field of the logger_entry should contain the byte size of the
msg field. However, in this case, the final null byte is not counted.
This is not really a bug since we should handle this case, but
nevertheless an inconsistency with the rest of the dlogutil.

Change-Id: Icf2277abc8dd7f8cd1885fc53dd49c9bdede623d

4 years agoRemove unnecessary newlines at the end of the files 79/213679/1 accepted/tizen/unified/20190916.111626 submit/tizen/20190910.115310
Mateusz Majewski [Tue, 10 Sep 2019 05:56:36 +0000 (07:56 +0200)]
Remove unnecessary newlines at the end of the files

Change-Id: I5ad464bb853b3209f9a87ac899c3be677c1a8942

4 years agoCreate and fill logretrieve.{c,h} 47/213647/1
Mateusz Majewski [Thu, 22 Aug 2019 09:41:48 +0000 (11:41 +0200)]
Create and fill logretrieve.{c,h}

Change-Id: I4f0402cb2d8ff38e1b371b63600dd79e1aa467b3

4 years agoMove pipe/logger backend choice logic to create_initial_fdis 46/213646/1
Mateusz Majewski [Mon, 9 Sep 2019 09:39:39 +0000 (11:39 +0200)]
Move pipe/logger backend choice logic to create_initial_fdis

Change-Id: I3221f256d96e014200875a87467ed4b3eab5cd79

4 years agoMove flush_logs into sort_vector.c 45/213645/1
Mateusz Majewski [Thu, 22 Aug 2019 09:15:45 +0000 (11:15 +0200)]
Move flush_logs into sort_vector.c

It's now called sort_vector_flush.

Change-Id: I9a90166e81bb129df7529c92626fa80c7ae84f10

4 years agoMove buffer choice validation into create_initial_fdis 34/213534/7
Mateusz Majewski [Fri, 6 Sep 2019 08:59:02 +0000 (10:59 +0200)]
Move buffer choice validation into create_initial_fdis

Change-Id: I3328790d7ef438aaa7dd99a22b12c3243145c292

4 years agoMove sort_vector initialization into do_print 33/213533/7
Mateusz Majewski [Fri, 6 Sep 2019 07:23:16 +0000 (09:23 +0200)]
Move sort_vector initialization into do_print

This way, main doesn't have to care about the sort_vector at all.

Change-Id: Iaf9f80957f1df40f1113f0cdd7428aef782d3baf

4 years agoAdd some missing const qualifiers 09/213609/1
Mateusz Majewski [Mon, 9 Sep 2019 06:18:10 +0000 (08:18 +0200)]
Add some missing const qualifiers

Change-Id: I521e570921a07b93c7fbdd6cef0abcb1f2409fba

4 years agoSet some sort_vector fields indirectly 32/213532/5
Mateusz Majewski [Fri, 23 Aug 2019 09:34:42 +0000 (11:34 +0200)]
Set some sort_vector fields indirectly

This way, we don't need to pass the sort_vector to the parse_options
function.

Change-Id: Iffe9436e847846b4dc4d1c39123ada87526a0db5

4 years agoMove some arguments into a common struct 51/213551/2
Mateusz Majewski [Fri, 6 Sep 2019 11:50:51 +0000 (13:50 +0200)]
Move some arguments into a common struct

Change-Id: Iacb5461d42688128c52842e20c8d32317b3cd60a

4 years agoFix log_filter_free 53/213553/1
Mateusz Majewski [Fri, 6 Sep 2019 13:12:16 +0000 (15:12 +0200)]
Fix log_filter_free

Change-Id: I3a23f7a2303d4659aacd2fbd9e88a5a4bf046893

4 years agoFix some minor issues with the last refactor 13/213513/2
Mateusz Majewski [Fri, 6 Sep 2019 05:56:56 +0000 (07:56 +0200)]
Fix some minor issues with the last refactor

Change-Id: I1883acd871bbb09d55c14f1d766499be4b0a05af

4 years agoRefactor set_sorting 69/213469/1
Mateusz Majewski [Mon, 26 Aug 2019 09:58:58 +0000 (11:58 +0200)]
Refactor set_sorting

This will allow us to reuse the same code in libdlogutil in a clean way.

Change-Id: I97b44d639ce4da91e83a2243919318ba0f81f96d

4 years agoMove sort_vector_time_span into sort_vector.c 68/213468/1
Mateusz Majewski [Wed, 21 Aug 2019 10:51:59 +0000 (12:51 +0200)]
Move sort_vector_time_span into sort_vector.c

Change-Id: I4a948c731e41b16909f14576adeba86001526e64

4 years agoMove print preparation into do_print 15/213315/5
Mateusz Majewski [Tue, 27 Aug 2019 13:25:43 +0000 (15:25 +0200)]
Move print preparation into do_print

Motivation for this is two-fold. First, it will allow us to reuse it in
the libdlogutil in the future. Second, it allows us to merge the two
loops that appear there (especially since do_print already did some
additional preparation on the FDIs).

Change-Id: Icd026476f3f453ccaca69ed992b32611f07c3a0a

4 years agoFix process_log docs 36/213336/2
Mateusz Majewski [Wed, 21 Aug 2019 12:39:02 +0000 (14:39 +0200)]
Fix process_log docs

Oops! I actually had this done, but I did it in a separate commit and
forgotten to actually apply this change :(

Change-Id: I41cdbacb73bb4315e3a3ca904b4efbe4cb1aaaef

4 years agoMove various files from dlogutil into shared locations 76/213276/1
Mateusz Majewski [Wed, 14 Aug 2019 06:26:25 +0000 (08:26 +0200)]
Move various files from dlogutil into shared locations

This is due to the need to use them in the upcoming libdlogutil.

Change-Id: I7048116972dbef9e345b333a91f92c2067188c5a

4 years agoPass the printing function in dlogutil by a callback 71/213271/2
Mateusz Majewski [Wed, 14 Aug 2019 06:26:25 +0000 (08:26 +0200)]
Pass the printing function in dlogutil by a callback

Currently it doesn't matter, however, this will come in handy when
implementing libdlogutil, since it will allow to reuse the code, but
do an arbitrary operation.

Change-Id: Ie7b907ef9409af53ec8d8aa8893c6ba6a5f57c02

4 years agoAdd tests for some recently changed code 72/213272/1
Michal Bloch [Tue, 3 Sep 2019 11:15:50 +0000 (13:15 +0200)]
Add tests for some recently changed code

Change-Id: Ic89168dc09aa50fd80e10124e588cade9d2ae8f0
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
4 years agoFix tests for future timestamps 51/213251/1 accepted/tizen/unified/20190904.011545 submit/tizen/20190903.085817
Maciej Slodczyk [Tue, 3 Sep 2019 08:45:31 +0000 (10:45 +0200)]
Fix tests for future timestamps

Change-Id: I15b3242b10d643ade27f33fd8fb65710148afd68
Signed-off-by: Maciej Slodczyk <m.slodczyk2@partner.samsung.com>
4 years agoFix future timestamps 98/213198/5 submit/tizen/20190903.011610
Michal Bloch [Mon, 2 Sep 2019 15:05:22 +0000 (17:05 +0200)]
Fix future timestamps

Change-Id: I65e9389733d0d6718d9bf5523b9d65d52d4265d1
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
4 years agoFix a potential null ptr dereference 30/213130/2
Michal Bloch [Fri, 30 Aug 2019 12:03:47 +0000 (14:03 +0200)]
Fix a potential null ptr dereference

Change-Id: I5541047d606dea988b5ce5b54cb7394a3aba78ac
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
4 years agoRemove destructor and destruction_lock 22/213122/2 accepted/tizen/unified/20190902.220738 submit/tizen/20190902.035940
Hyotaek Shim [Fri, 30 Aug 2019 10:29:29 +0000 (19:29 +0900)]
Remove destructor and destruction_lock

Change-Id: Id68323d0b8981b8cbfff53a847ced8a0b1569fb4
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
4 years agoFix dlogutil getting blocked by clock changes 23/213123/1 accepted/tizen/unified/20190901.225940 submit/tizen/20190830.104642
Michal Bloch [Fri, 30 Aug 2019 10:11:22 +0000 (12:11 +0200)]
Fix dlogutil getting blocked by clock changes

Change-Id: Iece15b17e78824c310d94b9f3d0228017af3f019
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
4 years agolibdlog: handle thread cancellation 47/213047/1 accepted/tizen/unified/20190830.110653 submit/tizen/20190830.025800
Michal Bloch [Thu, 29 Aug 2019 11:36:54 +0000 (13:36 +0200)]
libdlog: handle thread cancellation

Change-Id: If52fa194ce10aab5e1766ed204c438fa62c03ba3
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
4 years agoFix svace issue 30/212830/1 accepted/tizen/unified/20190828.011005 submit/tizen/20190827.083548
Yunmi Ha [Tue, 27 Aug 2019 06:27:14 +0000 (15:27 +0900)]
Fix svace issue

Change-Id: Ia2d8b4a8253dd0c771456ea2579fe3c17b4c69fd
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
4 years agoMove the get_format_sorting call 86/212586/1
Mateusz Majewski [Fri, 23 Aug 2019 06:38:10 +0000 (08:38 +0200)]
Move the get_format_sorting call

This makes the set_sorting function slightly more general.

Change-Id: Ic77b0fa60bb4007baa90779905e6381e54262078

4 years agoMake sure the JSON format uses default sorting 85/212585/1
Mateusz Majewski [Fri, 23 Aug 2019 06:37:17 +0000 (08:37 +0200)]
Make sure the JSON format uses default sorting

Change-Id: If20ef91a202adf993b923b2f992036c6dcee88ac

4 years agoMerge "Move log filtering out of log writing" into tizen
Michal Bloch [Wed, 21 Aug 2019 13:27:14 +0000 (13:27 +0000)]
Merge "Move log filtering out of log writing" into tizen

4 years agoMerge "Decouple filtering and formatting messages" into tizen
Michal Bloch [Wed, 21 Aug 2019 13:26:52 +0000 (13:26 +0000)]
Merge "Decouple filtering and formatting messages" into tizen

4 years agoAdd some JSON tests 68/212168/3
Mateusz Majewski [Wed, 14 Aug 2019 09:24:08 +0000 (11:24 +0200)]
Add some JSON tests

Note that it still remains to test some of the failure cases.

Change-Id: Ie2222875b7ecafd44400e671d8b5dc51d002c694

4 years agoMove log filtering out of log writing 42/211942/3
Mateusz Majewski [Mon, 12 Aug 2019 08:25:25 +0000 (10:25 +0200)]
Move log filtering out of log writing

This also adds a nice bonus -- now, in dlogutil, the incoming logs
are only filtered once, and in one place.

Change-Id: I443b48967344353b0a92731295d11a369d9de2fb

4 years agoDecouple filtering and formatting messages 07/211407/5
Mateusz Majewski [Thu, 1 Aug 2019 10:58:25 +0000 (12:58 +0200)]
Decouple filtering and formatting messages

The log_filter struct contains both info on which messages to print,
and info on how to print them. If we want to provide a simple API that
allows applications to read log messages, we need to know which messages
to give to them, but there's no printing involved. Therefore, we need to
split the log_filter struct into the two structs, each with a single
responsibility.

To add to this, the filtering data is contained in the log_file struct.
All the other data contained in it is only meaningful when printing.
Therefore, we also need to pull the log_filter struct out of it, as we
probably are not going to use the log_file struct in the future
libdlogutil library.

Change-Id: Ied9e34ece9c7ee34c8249fcd201c167275a27fb3

4 years agoCover a line in logconfig.c 71/212171/2
Mateusz Majewski [Fri, 16 Aug 2019 08:35:04 +0000 (10:35 +0200)]
Cover a line in logconfig.c

Change-Id: I422cbbfdb0a96e173a0a08615e309530fe3cba45

4 years agoFix various typos 72/212172/1
Mateusz Majewski [Fri, 16 Aug 2019 09:19:43 +0000 (11:19 +0200)]
Fix various typos

Change-Id: I0e288eb04c33dfcdb0a1e728cddca1a340c150ba

4 years agoFix logprint time_t handling 26/212126/3
Mateusz Majewski [Wed, 14 Aug 2019 11:33:12 +0000 (13:33 +0200)]
Fix logprint time_t handling

In JSON formatting, I passed to localtime an int variable cast to
time_t. This is UB, as the size of time_t is not defined (in fact,
time_t doesn't even need to be an integer in C). This commit fixes this
by assigning the data to a temporary time_t variable.

Also, such a system was already present when formatting to other
formats, but it featured an unnecessary cast, which this commit removes.

Change-Id: I75d30cf211b9d05c833a798070cf3c0a445956ef

4 years agoFix coverity issues 67/209667/4 accepted/tizen/unified/20190809.035645 submit/tizen/20190808.060025
Yunmi Ha [Wed, 10 Jul 2019 02:48:12 +0000 (11:48 +0900)]
Fix coverity issues

- check return value
- initialize the memory

Change-Id: Iebf46f98466d94991e949687ffb6310a4c1c85d5
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
4 years agoMerge "Fix a potential privilege escalation" into tizen accepted/tizen/unified/20190807.111830 submit/tizen/20180808.030253 submit/tizen/20190807.012805
Karol Lewandowski [Fri, 2 Aug 2019 15:19:25 +0000 (15:19 +0000)]
Merge "Fix a potential privilege escalation" into tizen

4 years agoshared: fix timestamp inconsistencies 32/199532/8 accepted/tizen/unified/20190802.111406 submit/tizen/20190801.043248
Michal Bloch [Tue, 12 Feb 2019 10:50:57 +0000 (11:50 +0100)]
shared: fix timestamp inconsistencies

Change-Id: I123446edceeaa9d0552f30a351fb150aa45125ed

4 years agoFix a potential privilege escalation 74/211074/1
Michal Bloch [Mon, 29 Jul 2019 13:45:56 +0000 (15:45 +0200)]
Fix a potential privilege escalation

Change-Id: I97a4fa568a5a0eb035981803f85addcee833fec4
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
4 years agoAdd the JSON format to dlogutil 78/210478/9
Mateusz Majewski [Wed, 10 Jul 2019 13:11:08 +0000 (15:11 +0200)]
Add the JSON format to dlogutil

Change-Id: I10600b919c73d4279f34721a0a3e0bf7efc425a5

4 years agoAdd marking invalid timestamps 60/210860/2
Mateusz Majewski [Thu, 25 Jul 2019 09:47:21 +0000 (11:47 +0200)]
Add marking invalid timestamps

Some formats don't include both realtime and monotonic timestamps.
Currently, the missing timestamps are set to various values (either
the other timestamp or 0). This commit makes it so the nanosecond value
of missing timestamps is set to a normally impossible value of -1.

Change-Id: I458b9049e9e5b0581ae138a352b66b9821e3fc5a

4 years agoAdd some more tests covering a part of logger.c 75/210975/3
Mateusz Majewski [Fri, 26 Jul 2019 11:09:46 +0000 (13:09 +0200)]
Add some more tests covering a part of logger.c

Change-Id: I0c03265bdc859809b3f7d0187fd9b52c3ec4a256

4 years agoAddress the complaints of SVACE 60/210660/4 accepted/tizen/unified/20190725.042830 submit/tizen/20190724.030536
Mateusz Majewski [Tue, 23 Jul 2019 10:49:49 +0000 (12:49 +0200)]
Address the complaints of SVACE

One of them is even legitimate -- if the test was run in low memory
conditions, it could try to dereference NULL. Thanks, SVACE!

Change-Id: I61e835cc883daf6201d6ecb1a09e633047ad988f

4 years agoReuse writer_close_fd in writer_free 49/210649/2
Mateusz Majewski [Tue, 23 Jul 2019 10:10:49 +0000 (12:10 +0200)]
Reuse writer_close_fd in writer_free

It's still useful to have writer_free, since writer_create puts the new
writer directly on the heap.

Change-Id: Ia9dec7651ff322ab39818ff23e7e6f8540cf1259

4 years agoImprove modify_fd_entity 40/210640/1
Mateusz Majewski [Tue, 23 Jul 2019 08:53:06 +0000 (10:53 +0200)]
Improve modify_fd_entity

In a case in which modify_fd_entity failed, it would still record the
modification as done. This would make it fail silently without calling
epoll_ctl next time it was called, which is at least unintuitive.

Change-Id: I85b427c376e08241d33b2f864c8d16ad53c5cd7a

4 years agoAdd tests covering a minor part of logger.c 67/210467/7
Mateusz Majewski [Fri, 19 Jul 2019 08:34:24 +0000 (10:34 +0200)]
Add tests covering a minor part of logger.c

Covering the entire file will unfortunately be difficult, as this commit
is already big (and pretty ugly), yet it only covers 1/6 of logger.c.

Change-Id: I46825c5c2dfaad00791356b2d3944bb54185819b

5 years agoCover the last line of logprint.c 87/210487/1
Mateusz Majewski [Fri, 19 Jul 2019 13:08:22 +0000 (15:08 +0200)]
Cover the last line of logprint.c

Change-Id: I7014206d3fc8942ba9410a19eef4a3d6b82d8fe5

5 years agoFix a minor FD leak 74/210374/4
Mateusz Majewski [Thu, 18 Jul 2019 12:01:15 +0000 (14:01 +0200)]
Fix a minor FD leak

Not that it matters, since we quit immediately if this happens,
but still.

Change-Id: Id97227e9cf8f377626d61144b1506f524c2a46d5

5 years agoAdd tests covering a part of logutil.c 66/210366/3 accepted/tizen/unified/20190722.074750 submit/tizen/20190719.053029
Mateusz Majewski [Thu, 18 Jul 2019 09:21:01 +0000 (11:21 +0200)]
Add tests covering a part of logutil.c

Sadly, I think that testing the remaining functions will be difficult
(too difficult for me) without refactoring them.

Change-Id: I8a37c3ba4e213f784d6b85356d235298e0cfb5c1

5 years agoAdd colored headers 31/209531/11 submit/tizen/20190718.025247
Mateusz Majewski [Fri, 5 Jul 2019 12:55:23 +0000 (14:55 +0200)]
Add colored headers

Change-Id: I8b83709073604799fa38855f2c5ff2b46533a52a

5 years agoConvert FilterInfo's custom list to the one from ptrs_list 47/209647/3
Mateusz Majewski [Tue, 9 Jul 2019 07:17:52 +0000 (09:17 +0200)]
Convert FilterInfo's custom list to the one from ptrs_list

Change-Id: If2b4373209b16b4b8e50e2a302f3568009e059e3

5 years agoChange config so that we won't try to open /dev/null 87/209587/3 accepted/tizen/unified/20190717.220438 submit/tizen/20190717.061730
Mateusz Majewski [Tue, 16 Jul 2019 07:34:37 +0000 (09:34 +0200)]
Change config so that we won't try to open /dev/null

While this is not the prettiest syntax imaginable (and it might remind
some people of Pascal), it's probably the simplest way to achieve our
goal, since there's no need for any additional code.

Change-Id: Id8258932479fbd8d015193e1ed62ca3f6a62d5fe

5 years agoAdd fdi_pipe.c tests 59/210059/2
Mateusz Majewski [Mon, 15 Jul 2019 09:00:17 +0000 (11:00 +0200)]
Add fdi_pipe.c tests

Also, a little issue in send_logger_request was found; it could send
too many null bytes at the end of the message. This was also fixed.

Change-Id: I410bd91bfc2329768be9397c6d095830ff1d2d00

5 years agoFix reset_self_privledges 73/210073/1
Mateusz Majewski [Mon, 15 Jul 2019 12:43:03 +0000 (14:43 +0200)]
Fix reset_self_privledges

Change-Id: Icad7b11b46e6da1095e7c728ad9d68c83540f771

5 years agoAdd tests for the monotonic timestamps functionality 47/209747/2
Mateusz Majewski [Wed, 10 Jul 2019 06:29:58 +0000 (08:29 +0200)]
Add tests for the monotonic timestamps functionality

Change-Id: I6a4f32d604acba8b6145a0817112a5c998fc2ab1

5 years agoMerge "Add new tests to cover a branch in fdi_push_log" into tizen
Michal Bloch [Fri, 12 Jul 2019 19:37:15 +0000 (19:37 +0000)]
Merge "Add new tests to cover a branch in fdi_push_log" into tizen

5 years agoMake dlogutil not quit on SIGSTOP 42/209542/2
Mateusz Majewski [Thu, 11 Jul 2019 08:03:08 +0000 (10:03 +0200)]
Make dlogutil not quit on SIGSTOP

Change-Id: Ie02d4a8b4c86b86a5f273a5870db53ac05bd9640

5 years agoAdd new tests to cover a branch in fdi_push_log 46/209746/1
Mateusz Majewski [Wed, 10 Jul 2019 10:04:17 +0000 (12:04 +0200)]
Add new tests to cover a branch in fdi_push_log

Change-Id: I1a2ad76ba932b8df3824563cc6f54a43e41e1995

5 years agoRefactor shared_query to reduce link-time dependencies 04/209404/1
Mateusz Majewski [Fri, 5 Jul 2019 05:39:54 +0000 (07:39 +0200)]
Refactor shared_query to reduce link-time dependencies

Change-Id: If654a491d32148aecd2267b64e211487ebcfd906

5 years agoRemove unused path files 13/208413/2
INSUN PYO [Mon, 24 Jun 2019 06:05:14 +0000 (15:05 +0900)]
Remove unused path files

Change-Id: Id9270ddc3eac8fc2da82f89ea2b94f72162e2e2f

5 years agoutil: speed up dumping dlogutil 22/208322/2 accepted/tizen/unified/20190627.014809 submit/tizen/20190626.110355
Maciej Slodczyk [Fri, 21 Jun 2019 12:40:59 +0000 (14:40 +0200)]
util: speed up dumping dlogutil

Dlogutil had a chance to print logs only when the
sorting buffer was full(1) or there was no available
data in pipes(2). By checking if there are no really,
really old logs in sorting buffer independently of (1)
and (2) we can make util more responsive.

Change-Id: I59dd69f0ea00dcd1e8d8de3e7f80951c5a1a1948
Signed-off-by: Maciej Slodczyk <m.slodczyk2@partner.samsung.com>
5 years agodaemon: update pipe config file comments 93/207893/1
Maciej Slodczyk [Thu, 13 Jun 2019 16:08:47 +0000 (18:08 +0200)]
daemon: update pipe config file comments

Change-Id: Iec8133046c54652ffd5d0954c1bbe183aad676a7
Signed-off-by: Maciej Slodczyk <m.slodczyk2@partner.samsung.com>
5 years agoRevert "logger: Server is optional with logger backend - do not let it block booting... 60/207460/1 accepted/tizen/unified/20190611.050041 submit/tizen/20190610.050711
Hyotaek Shim [Wed, 5 Jun 2019 04:46:47 +0000 (04:46 +0000)]
Revert "logger: Server is optional with logger backend - do not let it block booting sequence"

This reverts commit 7eaad8b579fa11aa138f0d55dfed47d93e5a9048.

Change-Id: Ied38cc339d6c900b3816d6055f983b9758911445

5 years agologger: Server is optional with logger backend - do not let it block booting sequence 34/207434/1
Karol Lewandowski [Tue, 4 Jun 2019 15:00:39 +0000 (17:00 +0200)]
logger: Server is optional with logger backend - do not let it block booting sequence

With logger backend dlog_logger is used only to save logs to persistent storage.

Change-Id: I2cf224f9681435855d7c34690e5725b4e88546c6

5 years agoRemove unused rpm dlogbackend-logger 37/207337/1
Hyotaek Shim [Mon, 3 Jun 2019 09:10:48 +0000 (18:10 +0900)]
Remove unused rpm dlogbackend-logger

Change-Id: I03b8751939b25faed1f7409629d557de604130fb
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
5 years agolibdlog: reinitialize on each log if need be 33/206833/2 accepted/tizen/unified/20190530.043130 submit/tizen/20190529.011726 submit/tizen/20190603.232156
Michal Bloch [Fri, 24 May 2019 14:27:18 +0000 (16:27 +0200)]
libdlog: reinitialize on each log if need be

Change-Id: I613cba9e29cbbe1581912cb1fccdce8c504ac536
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
5 years agolibdlog: do lazy initialisation (no constructor) 20/206720/3
Michal Bloch [Mon, 20 May 2019 11:41:48 +0000 (13:41 +0200)]
libdlog: do lazy initialisation (no constructor)

Reasons: some long-living processes which start before dlog can initialize
properly but don't log anything until later, the ability to wrap some calls
before dlog can use them. See the comments inside for more details.

Change-Id: I808a2e7774f74a4c7ead68c6a6dac7cc7d2082e8
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
5 years agopackaging: Unify package naming 07/202907/4
Karol Lewandowski [Fri, 5 Apr 2019 14:12:40 +0000 (16:12 +0200)]
packaging: Unify package naming

All packages briging only configuration will start with config-
prefix.

dlogbackend-logger package is kept for transition period only -
it can be safely removed after installation.

Change-Id: Iaac5737e6d6b8c9968c592f432e5e9435b6ba55d

5 years agotests: can handle different error message formats 34/206234/2
Michal Bloch [Wed, 15 May 2019 09:28:26 +0000 (11:28 +0200)]
tests: can handle different error message formats

Change-Id: Id171f3b632a56313bbe914e0079bce3aa38ef19b
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
5 years agoconfig: Move persistent logging configuration to separate config file 06/202906/5 accepted/tizen/unified/20190512.221838 submit/tizen/20190510.025027
Karol Lewandowski [Thu, 4 Apr 2019 14:31:17 +0000 (16:31 +0200)]
config: Move persistent logging configuration to separate config file

This will allow easy enabling/disabling this functionality by just
removing/not installing package which provides this file.

Change-Id: I4cdabed301c32c977b09f062ad7da93377b572fa

5 years agoMove config files from /opt/etc to /etc 18/205818/2
Karol Lewandowski [Wed, 8 May 2019 14:50:55 +0000 (16:50 +0200)]
Move config files from /opt/etc to /etc

Dlog configuration is not supposed to be modified on production
images, so it's safe to move it to /etc.

This allows us to drop not only the upgrade script as in this
case configuration is guaranteed to be updated with dlog itself,
but also complex package posttrans, as used for conversion from
dlog.conf being symlink to regular file.

Change-Id: Id28c66ad32b0f1c69b9935a19455f621850ecae3

5 years agoSet to NULL after memory free 97/205797/1 accepted/tizen/unified/20190510.111058 submit/tizen/20190509.082731
Yunmi Ha [Thu, 9 May 2019 08:05:49 +0000 (17:05 +0900)]
Set to NULL after memory free

Change-Id: I282d527e396c029b3edf25fe3acaedd95f214902
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
5 years agoModify platform upgrade scripts 23/202923/1
Hyotaek Shim [Mon, 8 Apr 2019 02:28:31 +0000 (11:28 +0900)]
Modify platform upgrade scripts

Change-Id: Id737055332994dff6297468a41c7799f91e20c4b

5 years agoAdd missed test case for the destructor 02/200902/1
Michal Bloch [Fri, 22 Feb 2019 20:19:54 +0000 (21:19 +0100)]
Add missed test case for the destructor

Change-Id: I66e3b583958f8559e0ae5514a90969637f190a45
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
5 years agoFix minor issues 81/200881/1
Michal Bloch [Mon, 4 Mar 2019 19:13:19 +0000 (20:13 +0100)]
Fix minor issues

Change-Id: I884338a99299dba756ed0a6dd9510f1ff111efe9
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
5 years agologger: documentation/clean code 28/200828/2
Michal Bloch [Mon, 4 Mar 2019 15:54:45 +0000 (16:54 +0100)]
logger: documentation/clean code

Change-Id: I5a24e7fb6c3911c55db46d97a4d1f1524dd3e9c5
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
5 years agolibdlog: readd the destructor 16/199816/10
Michal Bloch [Fri, 22 Feb 2019 16:23:18 +0000 (17:23 +0100)]
libdlog: readd the destructor

Change-Id: I0fdd0e93d55e7d8055b50600378972c0e11e685a
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
5 years agoFix SVACE complaints 39/200239/2
Michal Bloch [Mon, 18 Feb 2019 15:08:01 +0000 (16:08 +0100)]
Fix SVACE complaints

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