platform/core/system/dlog.git
3 years agoQoS: add distribution unit tests 13/240813/2
Michal Bloch [Tue, 11 Aug 2020 13:22:59 +0000 (15:22 +0200)]
QoS: add distribution unit tests

Change-Id: I68865ce93bc6435c33ee4774037d4db6eb1af688
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agoQoS: split off distributions to a separate file 12/240812/2
Michal Bloch [Tue, 11 Aug 2020 12:59:11 +0000 (14:59 +0200)]
QoS: split off distributions to a separate file

Change-Id: I2f708535940b355e6396eb28b5523752ce8c8872
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agoQoS: move file handling out of distribution funcs 11/240811/2
Michal Bloch [Tue, 11 Aug 2020 12:16:30 +0000 (14:16 +0200)]
QoS: move file handling out of distribution funcs

Will allow easier testing for the functions.

Change-Id: Idacc1b8863eb76d87b4b58f8824ce8bcf53cf808
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agoAdd a missing check to libdlogutil 02/240802/3
Mateusz Majewski [Tue, 11 Aug 2020 13:16:34 +0000 (15:16 +0200)]
Add a missing check to libdlogutil

Change-Id: Iad79fd6df59cb6c585f45febc23a1263df055111

3 years agoClarify types 80/240780/1
Mateusz Majewski [Tue, 11 Aug 2020 07:50:58 +0000 (09:50 +0200)]
Clarify types

Change-Id: Ie8afc3a9f087b124f5d105a7d0b60fea8587c81d

3 years agoAdd a simple QoS integration test 59/240659/1
Mateusz Majewski [Mon, 10 Aug 2020 10:13:32 +0000 (12:13 +0200)]
Add a simple QoS integration test

Change-Id: I120660d31877b433ebd66fa6717ba3716e2d8a2a

3 years agoFix compilation 86/240586/1 accepted/tizen/unified/20200812.144037 submit/tizen/20200807.162649
Michal Bloch [Fri, 7 Aug 2020 16:17:04 +0000 (18:17 +0200)]
Fix compilation

Can't rely on lenient compilers.

Change-Id: I22ca790c1ee57ec64677e84b4d01ccefe9cadc5d
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agoMerge changes from topic "dlog-qos-2020" into tizen submit/tizen/20200807.160246
Karol Lewandowski [Fri, 7 Aug 2020 15:55:33 +0000 (15:55 +0000)]
Merge changes from topic "dlog-qos-2020" into tizen

* changes:
  Release 6.0.14
  daemon: add metrics collection / QoS

3 years agoRelease 6.0.14 84/240584/3
Michal Bloch [Fri, 7 Aug 2020 15:22:05 +0000 (17:22 +0200)]
Release 6.0.14

This release introduces the QoS mode.

Change-Id: I2ef256c186cdc014bb728c7225b61f833dec2a7c
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agodaemon: add metrics collection / QoS 67/240367/11
Michal Bloch [Wed, 5 Aug 2020 21:22:43 +0000 (23:22 +0200)]
daemon: add metrics collection / QoS

Change-Id: I7a6f9fdfd371d453a8f8960b78f0d19262687757
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agolibdlogutil: Increase the wait timeout for receiving fd from dlog_logger 76/240476/3
Karol Lewandowski [Thu, 6 Aug 2020 12:49:46 +0000 (14:49 +0200)]
libdlogutil: Increase the wait timeout for receiving fd from dlog_logger

Default timeout of 500ms is easily exceeded on low-end and/or overloaded
systems, causing dlogutil failures.  This commit bumps the limit to 5s.

Change-Id: Ia7083fef7fa2bd5bf790b9ab0758f9d2b1599823

3 years agometrics: add clear and get_total functions 75/240475/2
Michal Bloch [Thu, 6 Aug 2020 11:55:50 +0000 (13:55 +0200)]
metrics: add clear and get_total functions

Change-Id: Ibebaa85982c013e16fd2be4d0c744f02a4c88f7d
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agoAdd fdi_logger.c test 62/240362/2
Agnieszka Baumann [Fri, 31 Jul 2020 13:22:39 +0000 (15:22 +0200)]
Add fdi_logger.c test

Change-Id: I9a5d468c87ecbd8663faf672673019b136e5086f

3 years agoAdd log_storage.c test 41/240241/6
Agnieszka Baumann [Wed, 29 Jul 2020 12:10:07 +0000 (14:10 +0200)]
Add log_storage.c test

Change-Id: Ifd0f0cfb6b20387f7581a903260805d796c809b3

3 years agoAdd dlog_sec_print test 47/240347/2
Agnieszka Baumann [Wed, 22 Jul 2020 16:29:02 +0000 (18:29 +0200)]
Add dlog_sec_print test

Change-Id: I7bc8e3c315fd36919fa0806018f7e35d98d18eb0

3 years agolibdlog: pid based limiter 14/226514/9
Michal Bloch [Mon, 2 Mar 2020 13:11:27 +0000 (14:11 +0100)]
libdlog: pid based limiter

Change-Id: Iac3e9df7cb97f2ce9246e35db4e00708ff684b54
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agometrics: fix a memleak 74/240474/1
Michal Bloch [Thu, 6 Aug 2020 11:55:58 +0000 (13:55 +0200)]
metrics: fix a memleak

Change-Id: Iab097759f8317ed2a39699a1a5a0ab5f33cd895e
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agoAndroid logger config readers now aggregated 66/240366/2
Michal Bloch [Wed, 5 Aug 2020 20:28:02 +0000 (22:28 +0200)]
Android logger config readers now aggregated

This should result in a single read() call to populate
multiple /var/log/dlog/x files under the same buffer.

Change-Id: I28428abfda4fcd142f3de95ff61fdf31e2c9cb87
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agoAdd a helper function for core Android buffers 69/240469/1
Michal Bloch [Thu, 6 Aug 2020 10:41:42 +0000 (12:41 +0200)]
Add a helper function for core Android buffers

Change-Id: I86fd88f689c651fd03a34b4e636bfc1d9cdd66ac
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agoExtract subreader addition 39/240339/3
Michal Bloch [Wed, 5 Aug 2020 20:19:06 +0000 (22:19 +0200)]
Extract subreader addition

Change-Id: Ie3ea31ce4a969cf8fa43ecb32fa8eeb2e678ca8d
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years ago"Move constructors" for cleaner resource handling 64/240364/2
Michal Bloch [Wed, 5 Aug 2020 13:59:20 +0000 (15:59 +0200)]
"Move constructors" for cleaner resource handling

Change-Id: Icbfd6f8e7ccf59060b63a7a73d00eedee74e56ea

3 years agoFix leak / lack of reply on invalid util requests 63/240363/1
Michal Bloch [Wed, 5 Aug 2020 14:43:30 +0000 (16:43 +0200)]
Fix leak / lack of reply on invalid util requests

Change-Id: Ie3dc944f73bed2bbbf1636899fecc071e626195e
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agoptrs_list: relicense to MIT 38/240338/1
Michal Bloch [Wed, 5 Aug 2020 12:24:04 +0000 (14:24 +0200)]
ptrs_list: relicense to MIT

Change-Id: I1abc25cbb9fe2c4dc461f3ef2258cf665ea37b4d
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agoAdd delay functionality to dlogsend 27/240327/3
Mateusz Majewski [Wed, 5 Aug 2020 09:03:51 +0000 (11:03 +0200)]
Add delay functionality to dlogsend

Change-Id: I7740faeff8fc880205d57bf8f9cbd1d0c6c103a0

3 years agodlog_logger: remove the `reader_any` kitchen sink 03/240303/1
Mateusz Majewski [Tue, 4 Aug 2020 09:35:22 +0000 (11:35 +0200)]
dlog_logger: remove the `reader_any` kitchen sink

Readers for pipe and Android Logger backends are now separate beings.

Change-Id: I334155fd0082144d05d325f9849bad8518375690

3 years agoRemove a global "create reader" backend function 95/240295/1
Mateusz Majewski [Mon, 3 Aug 2020 13:05:16 +0000 (15:05 +0200)]
Remove a global "create reader" backend function

This is a step towards uncoupling the two forms of a reader.

Change-Id: I8cc4ed66a5b8a9acfd7f67d89bfaac7318206c1d

3 years agodaemon: split util commandline parsing 68/239668/3
Michal Bloch [Tue, 28 Jul 2020 20:49:03 +0000 (22:49 +0200)]
daemon: split util commandline parsing

Change-Id: Id8154e0090b1be067e2b2799d110fb4750ab531a

3 years agodaemon: logger reader: move file handling to a sub 66/239666/5
Michal Bloch [Tue, 28 Jul 2020 16:33:54 +0000 (18:33 +0200)]
daemon: logger reader: move file handling to a sub

No logic change so far; in the future this will allow to attach a bunch of
sub-readers to a single reader so as to make them work off a single log
entry point (meaning just one read() syscall will feed everything related
to given device - all /var/log/dlog/x files and, in the future, metrics).

Change-Id: I3bdc70838b0e690e17e7ea3bd220c5d8ca4b87ac
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agoAdd logprint.c test 08/240208/1
Agnieszka Baumann [Wed, 29 Jul 2020 10:23:25 +0000 (12:23 +0200)]
Add logprint.c test

Change-Id: Ic89d866d94b701d71b26196a939f739c2e9e5f25

3 years agopackaging: Drop no longer valid mention of Apache2.0 license for libdlog-devel 25/240125/1
Karol Lewandowski [Mon, 3 Aug 2020 22:19:38 +0000 (00:19 +0200)]
packaging: Drop no longer valid mention of Apache2.0 license for libdlog-devel

Change-Id: I1151ef586a7c05755bcb041125a81f49e1f8848d

3 years agoMerge "packaging: Split binaries to different packages" into tizen
Karol Lewandowski [Mon, 3 Aug 2020 22:17:18 +0000 (22:17 +0000)]
Merge "packaging: Split binaries to different packages" into tizen

3 years agoMerge "packaging: Drop unused epoch" into tizen
Karol Lewandowski [Mon, 3 Aug 2020 22:17:01 +0000 (22:17 +0000)]
Merge "packaging: Drop unused epoch" into tizen

3 years agolibdlog: apply MIT license; clarify license confusion 15/240115/4
Michal Bloch [Mon, 3 Aug 2020 13:01:09 +0000 (15:01 +0200)]
libdlog: apply MIT license; clarify license confusion

In multiple places, the copyright of The Android Open Source Project
was mistakenly added (due to lazy copy-paste) or wasn't removed when
relevant code got replaced.

Specifically:

 * the entirety of `translate_syslog.c`, `parsers.c` were written
   in commit dd125c915efd411ac20229ce15f9c63a298384e3, as was the
   syslog related stuff inside `queued_entry.c`

 * `parse_kmsg_message` from `queued_entry.c` was written in
    commit 4425f7c497d5c79ee94baa335c6f4938d2fa0d43, back then
    under the name `parse_entry_raw`.

 * `parse androidlogger_message` can't avoid similarity to the OG
   code from Android because a lot of it is just copying from
   member fields (specification is not copyrightable), but as far
   as I can tell it was actually written mostly from scratch (see
   commit 4188ddaff9cb28c1865b23a94738653382091962) and copying
   from specific fields readded independently later in commit
   00320e1655ac0f31f743be76a866fedf2b540901.

 * in `logcommon.c` there is a lot of pipe related stuff which is
   split over a ton of refactoring commits, but is obviously all
   Samsung if you take a glance at 2015 commits and the state of
   the repo before adding the pipe backend.

 * in `logcommon.c` there's also a lot of miscellaneous chaff whose
   authorship maps fairly well to what `git blame` says.

 * in `logcommon.c` there's the function `filter_pri_to_char`,
   which is technically original Android code but it is so trivial
   that it is really nothing more than its own specification, so
   it shouldn't cause any legal issues. (The opposite function,
   `filter_char_to_pri`, was rewritten in f7b5ee04e80c53a090c9.)

Change-Id: Ibc6cccdcf06588b7c9a431c3113e77b92e58947a
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agopackaging: Split binaries to different packages 19/240119/1
Karol Lewandowski [Mon, 3 Aug 2020 13:47:42 +0000 (15:47 +0200)]
packaging: Split binaries to different packages

Various files are licensed differently, move these around so that
whole package is under one license for clarity.

Change-Id: I47a7c8344926dbf16f9a3b44dbafc999b466e5d5

3 years agopackaging: Drop unused epoch 18/240118/1
Karol Lewandowski [Mon, 3 Aug 2020 13:44:17 +0000 (15:44 +0200)]
packaging: Drop unused epoch

Change-Id: I5fed7483748738e39654bc73a135a7898b986f08

3 years agoFix memory leak 04/240104/1
Yunmi Ha [Mon, 3 Aug 2020 10:07:37 +0000 (19:07 +0900)]
Fix memory leak

Change-Id: Ic7bb29c716b64c41677e16277472e1eb10f3f1c3
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
3 years agoAdd deduplication feature to libdlog 90/236090/10
Agnieszka Baumann [Fri, 12 Jun 2020 18:41:00 +0000 (20:41 +0200)]
Add deduplication feature to libdlog

Change-Id: I5788d957d2a8c5e19683512fa4cbed55caf68f7d

3 years agoAdd PoC dlogmetrics utility 85/226085/11
Mateusz Majewski [Mon, 24 Feb 2020 12:38:30 +0000 (13:38 +0100)]
Add PoC dlogmetrics utility

Change-Id: I3be403459ea5f494fb1749a085546f66d6543513

3 years agoAdd metrics structure 91/225791/11
Mateusz Majewski [Fri, 21 Feb 2020 13:46:01 +0000 (14:46 +0100)]
Add metrics structure

Change-Id: Iff76a4e86519f5a03517b69934ef6341825ecca8

3 years agoRelease 6.0.13 02/239902/1 accepted/tizen/unified/20200731.145722 submit/tizen/20200730.122517
Michal Bloch [Thu, 30 Jul 2020 11:02:21 +0000 (13:02 +0200)]
Release 6.0.13

This release finalizes the new internal libdlogutil API.

Change-Id: Iccdd1dbb474e5c2d7246c5c525c9e2f308d7d17e
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agodlog_logger: pseudo-RAII for getopt innards 67/239667/3
Michal Bloch [Tue, 28 Jul 2020 20:32:30 +0000 (22:32 +0200)]
dlog_logger: pseudo-RAII for getopt innards

So that we don't have to do caveman tier `retval = X; goto cleanup`

Change-Id: I993023ec95a1a38d3b3565aa174cbd82e422e0b9
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agodlog_logger: move fields to reader child classes 65/239665/3
Michal Bloch [Tue, 28 Jul 2020 14:46:46 +0000 (16:46 +0200)]
dlog_logger: move fields to reader child classes

Makes the generic reader struct less of a kitchen sink.

Change-Id: I57fca12ae9439c22e0c95afb41d5ef8478a6cbf0
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agoMove loglimiter to shared 17/239717/1
Mateusz Majewski [Wed, 29 Jul 2020 06:54:17 +0000 (08:54 +0200)]
Move loglimiter to shared

After all, it is shared between libdlog and dlogctl.

Change-Id: I34b08f935e4eacbae3f505e08214432aaee84720

3 years agodlog_logger: further reader refactors 13/239613/6
Mateusz Majewski [Mon, 27 Jul 2020 18:15:17 +0000 (20:15 +0200)]
dlog_logger: further reader refactors

Split into pipe and logger variants.

Change-Id: Iabe20b812752085f12c9e4d0ed32ebd0cd5a57a3

3 years agodaemon: handle epoll callback pointers sensibly 68/239568/2
Michal Bloch [Mon, 27 Jul 2020 17:16:53 +0000 (19:16 +0200)]
daemon: handle epoll callback pointers sensibly

The event can now carry userdata to point to the needed structure directly.
No more "keep fd_entity in front of the struct" or offset calculating nonsense.

Change-Id: I9d7d565d86538931f26a63ce35b6d0bb5947f228
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agoExpand "invalid buffer" negative integration tests 28/239528/1
Michal Bloch [Mon, 27 Jul 2020 09:54:45 +0000 (11:54 +0200)]
Expand "invalid buffer" negative integration tests

Change-Id: Ief8deb05aa03f84e393651a980bdec2a0b4731b0
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agoAdd some missing checks to libdlogutil 87/239487/1
Mateusz Majewski [Mon, 27 Jul 2020 05:45:47 +0000 (07:45 +0200)]
Add some missing checks to libdlogutil

Change-Id: I178e0f1381302ac36dc5740b168e5faf8fafc9fa

3 years agoFix documentation 23/239423/1
Mateusz Majewski [Wed, 15 Jul 2020 12:11:32 +0000 (14:11 +0200)]
Fix documentation

Change-Id: I6660076300808d80a3b3323737e82f810481dd4c

3 years agoFix some signatures 22/239422/1
Mateusz Majewski [Wed, 15 Jul 2020 11:10:25 +0000 (13:10 +0200)]
Fix some signatures

Change-Id: Ic1afbc34d80ed7826344c15e15c7ea7a10ede514

3 years agoRemove dlogutil_sorting_options_s 21/239421/1
Mateusz Majewski [Mon, 13 Jul 2020 10:43:42 +0000 (12:43 +0200)]
Remove dlogutil_sorting_options_s

Change-Id: Ib4a236455a433cf45fbbbac427e201d7b413a0ba

3 years agoMove reader creation to the init functions 86/239386/3
Mateusz Majewski [Thu, 23 Jul 2020 11:53:46 +0000 (13:53 +0200)]
Move reader creation to the init functions

This allows us to see more clearly the different cases that can happen.

Change-Id: Ib86c591ae7a731748f757afac86d82bb682834bf

3 years agoMove reader creation downwards 85/239385/3
Mateusz Majewski [Mon, 20 Jul 2020 07:19:13 +0000 (09:19 +0200)]
Move reader creation downwards

Like literally downwards; this means that it will be created at once and
not on the fly.

Change-Id: Ib38505b1f6f08eb8d18a6fc762567a6cfff83c6e

3 years agoFix a mismatch between declaration and definition 04/239304/2
Michal Bloch [Wed, 22 Jul 2020 12:38:53 +0000 (14:38 +0200)]
Fix a mismatch between declaration and definition

Change-Id: I0b2bdb0892bcfded9de573bbea41d11aa6ed4cc7
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agoRename parse_command_line 84/239384/1
Mateusz Majewski [Fri, 24 Jul 2020 07:05:06 +0000 (09:05 +0200)]
Rename parse_command_line

Change-Id: I5fd5ea096945e6cafe43e38aab4a83e47636dc7f

3 years agoHeaders: add `extern "C"` where applicable 06/239306/1
Agnieszka Baumann [Mon, 20 Jul 2020 17:00:32 +0000 (19:00 +0200)]
Headers: add `extern "C"` where applicable

Some headers had this but some didn't.

Change-Id: Iab4d367ffe3bf820e8191b84cba64ce97eaccc96

3 years agolibdlog: pass timestamp from a higher layer 30/238830/3
Agnieszka Baumann [Tue, 14 Jul 2020 13:40:13 +0000 (15:40 +0200)]
libdlog: pass timestamp from a higher layer

Will allow sharing its value with the deduplication module

Change-Id: Ic66f704080f0c136ecfdd28c8ec685a2147b0be7

3 years agoPipe messages: add SENT timestamp in a separate func 08/238708/4
Agnieszka Baumann [Wed, 15 Jul 2020 18:08:09 +0000 (20:08 +0200)]
Pipe messages: add SENT timestamp in a separate func

Change-Id: If5b76103bd84b4be68132a5848f78f3c031e2cb2

3 years agolibdlogutil: add an aliasing getter 13/239213/3
Mateusz Majewski [Tue, 21 Jul 2020 16:38:12 +0000 (18:38 +0200)]
libdlogutil: add an aliasing getter

Change-Id: I7ad402c38bb1ab1a3210822c480232283e311e61

3 years agodlogutil: Kill yet another instance of dlogutil_mode_e clone 18/239218/4
Karol Lewandowski [Wed, 22 Jul 2020 14:53:03 +0000 (16:53 +0200)]
dlogutil: Kill yet another instance of dlogutil_mode_e clone

Change-Id: I097894366d7028b8a7481d90afbeee168f5a1828

3 years agoLink to libraries that are actually used 14/239214/4 accepted/tizen/unified/20200724.124232 submit/tizen/20200723.024804
Karol Lewandowski [Wed, 22 Jul 2020 12:27:56 +0000 (14:27 +0200)]
Link to libraries that are actually used

Change-Id: I3a50380525b3e39221a6db8093ad9164a67739a4

3 years agolibdlogutil: `connect` guarantees non-garbage outvalue 12/239212/1
Mateusz Majewski [Tue, 21 Jul 2020 16:37:48 +0000 (18:37 +0200)]
libdlogutil: `connect` guarantees non-garbage outvalue

Change-Id: I499ba6b64b78dacfb1cffb03d160e9702adde1df

3 years agolibdlogutil: documentation errata 11/239211/1
Mateusz Majewski [Tue, 21 Jul 2020 16:36:52 +0000 (18:36 +0200)]
libdlogutil: documentation errata

Change-Id: Ibaccae9d1912245d859909ff7268c5473776f981

3 years agolibdlogutil: various getters work upon the state 26/238826/4
Mateusz Majewski [Mon, 6 Jul 2020 13:16:43 +0000 (15:16 +0200)]
libdlogutil: various getters work upon the state

Change-Id: I1d95a84731f669d0a5ea6a9a6fb2a51869f5780c

3 years agoRemove incorrect references to DLOGUTIL_MODE_CONTINUOUS 80/239080/2 accepted/tizen/unified/20200723.161228 submit/tizen/20200722.061245
Mateusz Majewski [Tue, 21 Jul 2020 10:43:25 +0000 (12:43 +0200)]
Remove incorrect references to DLOGUTIL_MODE_CONTINUOUS

They don't make sense now, since it is no longer a value meaning no dump
and equal to 0, but instead just a single value in the enum, which is
meaningless when converted to 0.

Change-Id: I328a823b57368ddf77cdd38a8b429cafd90b6833

3 years agoFix dispatch_event_reader_common a bit 39/238939/3
Mateusz Majewski [Mon, 20 Jul 2020 12:53:22 +0000 (14:53 +0200)]
Fix dispatch_event_reader_common a bit

Change-Id: I80c62581c8fb1a894bd2eac16391431aa2744e23

3 years agoFix has_required_privlege signature in the header 76/239076/1
Mateusz Majewski [Tue, 21 Jul 2020 10:43:00 +0000 (12:43 +0200)]
Fix has_required_privlege signature in the header

Change-Id: Ic94053ac0b2280c39b243cec0800d2a997986f0a

3 years agoImprove logutil error handling 27/238927/1
Mateusz Majewski [Mon, 20 Jul 2020 09:05:39 +0000 (11:05 +0200)]
Improve logutil error handling

Change-Id: I88aeae0434ab45855f4aac297abb60c1c7b70dbe

3 years agoReduce code repetition 25/238825/2
Mateusz Majewski [Fri, 17 Jul 2020 12:32:57 +0000 (14:32 +0200)]
Reduce code repetition

Change-Id: I95057fde7c094db250b93cdbfb42bdc5bc666605

3 years agoRemove an unnecessary string comparison 24/238824/2
Mateusz Majewski [Fri, 17 Jul 2020 12:08:48 +0000 (14:08 +0200)]
Remove an unnecessary string comparison

Change-Id: I6733d5f777129c5df40fc4f2f4fafa0d9bd5634c

4 years agoReword misleading comment 88/238788/1
Mateusz Majewski [Fri, 17 Jul 2020 08:33:38 +0000 (10:33 +0200)]
Reword misleading comment

It suggests that the function also processes the KMSG buffer, but it
does not; the KMSG buffer is processed in the service_writer_kmsg
function.

Change-Id: I5e50765503fe020ee332294105f517b30e52a3d5

4 years agolibdlogutil: Rearrange config & state members according to their size 98/238698/1
Karol Lewandowski [Thu, 16 Jul 2020 09:29:27 +0000 (11:29 +0200)]
libdlogutil: Rearrange config & state members according to their size

Change-Id: I660bcaf57f051440b8e0746b3b6efbdc8f101790

4 years agolibdlogutil: Consistent state & config member naming 97/238697/1
Karol Lewandowski [Thu, 16 Jul 2020 09:21:11 +0000 (11:21 +0200)]
libdlogutil: Consistent state & config member naming

Rename dlogutil_state.logs_dump to .dump_size, consistently with
dlogutil_config.dump_size (which contains exactly same information).

Change-Id: I34cbe6182d32ac42a45054c731333a164273dc48

4 years agolibdlogutil: Drop unused dlogutil_state member 96/238696/1
Karol Lewandowski [Thu, 16 Jul 2020 09:11:30 +0000 (11:11 +0200)]
libdlogutil: Drop unused dlogutil_state member

Change-Id: Iba05e67445d0873547c4299af8de67b08f998b4a

4 years agosort_vector: move dumping size considerations up 21/238621/2
Michal Bloch [Wed, 15 Jul 2020 11:05:31 +0000 (13:05 +0200)]
sort_vector: move dumping size considerations up

Sort vector now just has the exact size it is told to have.
How dumping affects this value is none of its business and
is now taken care of by the higher layer.

Change-Id: I058a5ec9e412234a1b0b8958f8e9d2bdad5574ec
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
4 years agolibdlogutil: follow-up mode internals refactor 17/238517/2
Michal Bloch [Tue, 14 Jul 2020 16:31:50 +0000 (18:31 +0200)]
libdlogutil: follow-up mode internals refactor

Change-Id: I22f37f1dfe7ac32d20a54f870181ad9d7679378a
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
4 years agoAdd a hashing function (incl. tests) 90/235890/8
Agnieszka Baumann [Wed, 10 Jun 2020 15:45:00 +0000 (17:45 +0200)]
Add a hashing function (incl. tests)

To be used for libdlog deduplication

Change-Id: I1cea213fcb191b1b306fe6a021366f18f1716dfe

4 years agolibdlogutil: introduce connect API 25/238225/3
Mateusz Majewski [Wed, 1 Jul 2020 08:21:52 +0000 (10:21 +0200)]
libdlogutil: introduce connect API

This commit additionally adds "mode" as a separate enum in the
config struct.  Refactoring the rest of the state to be done in
another commit.

Original API change introduced Mateusz Majewski, altered by Karol
Lewandowski, made to work again by Michał Bloch.

Change-Id: I750a33545ef8f7e52557a13a7e98c2fc2c25a667
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
4 years agolibdlogutil: remove the defaults integration test 32/238232/1
Michal Bloch [Thu, 9 Jul 2020 12:31:58 +0000 (14:31 +0200)]
libdlogutil: remove the defaults integration test

Passing a valid config is now mandatory; uninitialized
values are validated by the "dump" test.

Change-Id: Ifb94e88dd49dc81807b99f58b4dcda8db1e670ee
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
4 years agolibdlogutil: add buffer setting 90/238090/2
Mateusz Majewski [Wed, 1 Jul 2020 08:44:37 +0000 (10:44 +0200)]
libdlogutil: add buffer setting

Change-Id: I88e27328b148f145d5438018219f7e2831fdaa55

4 years agodlog_logger: clear internal buffers properly 19/237919/2
Michal Bloch [Mon, 6 Jul 2020 11:35:29 +0000 (13:35 +0200)]
dlog_logger: clear internal buffers properly

Change-Id: I3f96812b1387f96f48055d01f951f7254e98e643
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
4 years agodlog_logger: bring back localtime() caching 43/237043/3
Karol Lewandowski [Wed, 24 Jun 2020 09:02:42 +0000 (11:02 +0200)]
dlog_logger: bring back localtime() caching

This reverts commit d5bffc25a9ddc4c32f9238656946911bc99edd94.

The overhead of non-cached localtime() is ~90% CPU time according
to valgrind's callgrind (cached variant drops to ~60% CPU).

While real numbers can be lower it's still too large to justify
using non-cached variant.

Change-Id: I802b4fa80662ee376ee13a90123abe6c7f96d600

4 years agoFix obsolete sorting/filter docs 93/237693/1 accepted/tizen/unified/20200707.140855 submit/tizen/20200707.013715
Michal Bloch [Thu, 2 Jul 2020 11:58:25 +0000 (13:58 +0200)]
Fix obsolete sorting/filter docs

Change-Id: I4ac1bc2ba0cfbd45615c05389df7811aa4b34f52
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
4 years agolibdlogutil: get_logs_internal accepts a config_s 81/237581/3
Michal Bloch [Wed, 1 Jul 2020 08:57:20 +0000 (10:57 +0200)]
libdlogutil: get_logs_internal accepts a config_s

Change-Id: Iaf7e40ed75a603f356061d17e032e6b5831809e6

4 years agolibdlogutil: remove the old blocking API 80/237580/3
Michal Bloch [Fri, 26 Jun 2020 17:12:12 +0000 (19:12 +0200)]
libdlogutil: remove the old blocking API

Change-Id: I43f3ad69daf5d9ef4f3d6dd2b57af2a74ffdac51
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
4 years agoKeep only buffer ID in the fd_info struct 98/237598/1
Mateusz Majewski [Wed, 1 Jul 2020 12:42:49 +0000 (14:42 +0200)]
Keep only buffer ID in the fd_info struct

Change-Id: I2cdd014a68feab42fd25ec9f3bba6f3be536248f

4 years agoRewrite dlogutil to use the new libdlogutil API 64/235564/9
Mateusz Majewski [Fri, 20 Mar 2020 14:11:58 +0000 (15:11 +0100)]
Rewrite dlogutil to use the new libdlogutil API

Change-Id: I36371311a18950fc69e3f2669b050e93dae84045

4 years agoAdd the new libdlogutil API 41/235541/8
Mateusz Majewski [Wed, 1 Jul 2020 10:54:18 +0000 (12:54 +0200)]
Add the new libdlogutil API

Change-Id: I825042f1f91d84672ba586fc62038c034958686e

4 years agoFix the docs a bit 77/237577/1
Mateusz Majewski [Wed, 1 Jul 2020 10:53:50 +0000 (12:53 +0200)]
Fix the docs a bit

Change-Id: I77eaa7ff97c2ac273bd0e9e362a15793fe74be54

4 years agoAdd description for pragma GCC diagnostic warning "-Wformat" 06/237506/1
Hyotaek Shim [Wed, 1 Jul 2020 04:41:55 +0000 (13:41 +0900)]
Add description for pragma GCC diagnostic warning "-Wformat"

Change-Id: I0ef91634dfe648186ec344b3a84b9a98f9f9d61d
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
4 years agolibdlogutil: move sorting/filters to internal 60/237360/2
Michal Bloch [Wed, 24 Jun 2020 14:47:31 +0000 (16:47 +0200)]
libdlogutil: move sorting/filters to internal

Change-Id: Id53c5e2cba1baaa7dbcd2ccd3bd8de8239e7bafc
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
4 years agodlogutil: use the new config_s interfaces 59/237359/2
Michal Bloch [Wed, 24 Jun 2020 12:13:52 +0000 (14:13 +0200)]
dlogutil: use the new config_s interfaces

Change-Id: I99d60c8216fdc9eb9de4e87a21a7c3de90690bb6
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
4 years agolibdlogutil: add config functions 55/237355/3
Mateusz Majewski [Thu, 25 Jun 2020 13:00:40 +0000 (15:00 +0200)]
libdlogutil: add config functions

Change-Id: Ibfbc784c3fe0a1bd859909ff7268c5473776f981

4 years agolog_format_log_line: Move variable declarations near to their usage 53/237153/4
Karol Lewandowski [Thu, 25 Jun 2020 09:54:35 +0000 (11:54 +0200)]
log_format_log_line: Move variable declarations near to their usage

Change-Id: Ie7dc69005c1a05c2d3c0c4ae58ed65e898b8f33a

4 years agolog_format_log_line: Call localtime() only when needed 65/237065/4
Karol Lewandowski [Wed, 24 Jun 2020 21:45:08 +0000 (23:45 +0200)]
log_format_log_line: Call localtime() only when needed

localtime() is costly, it's best if it can be avoided.

Change-Id: I6d73142f60e33493bc0b6a96b8c534bcf51725d4

4 years agolog_format_log_line: Use timespecs directly 52/237052/3
Karol Lewandowski [Wed, 24 Jun 2020 10:21:32 +0000 (12:21 +0200)]
log_format_log_line: Use timespecs directly

This Occamifies the code, ie. "entities should not be
multiplied without necessity."

Change-Id: I1d64b0563c5e921d0aa99fe0c91e3a0647232ed9

4 years agoMerge "localtime: use reentrant variant" into tizen
Karol Lewandowski [Wed, 24 Jun 2020 09:09:39 +0000 (09:09 +0000)]
Merge "localtime: use reentrant variant" into tizen

4 years agolibdlog: add a priority based pre-filter 66/226766/6
Michal Bloch [Wed, 4 Mar 2020 16:37:06 +0000 (17:37 +0100)]
libdlog: add a priority based pre-filter

Change-Id: I7850cdbfc06c1cbc5313a050bf8582fc8c9a4178
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
4 years agolocaltime: use reentrant variant 32/236832/2
Karol Lewandowski [Mon, 22 Jun 2020 10:57:58 +0000 (12:57 +0200)]
localtime: use reentrant variant

configure was never setup up properly to support both legacy and reentrant
localtime, consequently legacy variant has been selected all the time.

This commit drops legacy variant leaving reentrant as the default.

Change-Id: Id502121a1197584621cb5b9d65b1c630f2a380f1

4 years agolibdlog: change license to MIT 25/236825/1
Yunmi Ha [Mon, 22 Jun 2020 09:00:17 +0000 (18:00 +0900)]
libdlog: change license to MIT

Change-Id: I3f43578a488cc6218a8c6191dca6bea8a739e76a
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
4 years agotests: padding test works on a large buffer 08/236508/5
Michal Bloch [Wed, 17 Jun 2020 14:05:05 +0000 (16:05 +0200)]
tests: padding test works on a large buffer

Some targets don't show incorrect behaviour when the message is
on the stack-allocated default buffer (of 512 size), only on
the backup heap-allocated buffer. Test there to catch those cases.

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