platform/core/system/dlog.git
2 years agoHotfix the long log condition 47/265947/1 accepted/tizen/unified/20211105.130439 submit/tizen/20211102.155418
Mateusz Majewski [Tue, 2 Nov 2021 08:05:07 +0000 (09:05 +0100)]
Hotfix the long log condition

Change-Id: I835d43c905f0f8eb3895f86f606b39f6d17ba6a4

2 years agoAdd some fuzz tests against garbage logs 92/265092/8
Michal Bloch [Fri, 15 Oct 2021 16:44:21 +0000 (18:44 +0200)]
Add some fuzz tests against garbage logs

Change-Id: Icaa353a0d6b7a9e66edc96e09dd104a79c5a6dfa

2 years agoExtend the persistent logging tests a bit 84/265784/1
Mateusz Majewski [Thu, 28 Oct 2021 10:28:51 +0000 (12:28 +0200)]
Extend the persistent logging tests a bit

Change-Id: Ia55d584b87a0a670a854c72f3c0ab8d51af49590

2 years agoFix the persistent log bug 73/265773/1
Mateusz Majewski [Thu, 28 Oct 2021 07:53:04 +0000 (09:53 +0200)]
Fix the persistent log bug

Change-Id: I31a5a2c5266ccfa7d7ab19d02f4ab789f4553851

2 years agoFix the handling of over/undersized logs 91/265091/3
Michal Bloch [Wed, 29 Sep 2021 18:48:34 +0000 (20:48 +0200)]
Fix the handling of over/undersized logs

Change-Id: Ibdc31f97dd0fd541b4f49f3eea89f8d5888f3737
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
2 years agoMake error reporting more accurate in logger configuration parsing 65/265165/1
Mateusz Majewski [Tue, 12 Oct 2021 07:41:08 +0000 (09:41 +0200)]
Make error reporting more accurate in logger configuration parsing

Change-Id: I0748813c458213574c6338c1ca7dd03c6a804bfb

2 years agoReplace strcpy with memcpy in tests 75/264775/2
Mateusz Majewski [Wed, 29 Sep 2021 11:04:49 +0000 (13:04 +0200)]
Replace strcpy with memcpy in tests

... as strcpy is banned in the Tizen codebase.

Change-Id: I895ad9bdb5ab806fd2f3a8579fa2767661bc8b6b

2 years agoHotfix a pipe backend request length issue 43/264643/1 accepted/tizen/6.5/unified/20211028.114416 accepted/tizen/unified/20210928.212633 submit/tizen/20210927.231439 submit/tizen_6.5/20211028.162501 tizen_6.5.m2_release
Mateusz Majewski [Mon, 27 Sep 2021 12:40:01 +0000 (14:40 +0200)]
Hotfix a pipe backend request length issue

The previous patch (and to be exact our modifications and not Hubert's
code) has caused some of the integration tests to fail. This is because
we forgot to count one of the characters. This patch fixes that.

Change-Id: Ia1fa9e2da67de755c363142aaae03c0ba8f5c69b

2 years agoEnlarged MAX_LOGGER_REQUEST_LEN to 65535 bytes 45/264145/17 accepted/tizen/unified/20210927.120919 submit/tizen/20210923.232435
Hubert Kowalski [Tue, 14 Sep 2021 13:36:15 +0000 (15:36 +0200)]
Enlarged MAX_LOGGER_REQUEST_LEN to 65535 bytes

Also buffer sizes are variable and calculated a priori.
This means that buffer is as small as possible.

Change-Id: Ib26bb02bdb46e85da71a7ef13d87aa462914f4b2

2 years agoCandidate fix for the nanosecond issue 92/264492/1
Mateusz Majewski [Thu, 23 Sep 2021 06:55:37 +0000 (08:55 +0200)]
Candidate fix for the nanosecond issue

Change-Id: I768c98f1cb8c7b3b2aebcbf3c62975aaaabfc945

2 years agoAdded additional pointer tests. 34/263834/4 submit/tizen/20210917.212514
Hubert Kowalski [Fri, 10 Sep 2021 11:33:13 +0000 (13:33 +0200)]
Added additional pointer tests.

Additional tests have been added to libdlogutil_neg.c to check whether
a bad pointer affects dlogutil_config_connect(...).

Change-Id: I52e716bdb1b437ffbeca65ea929a91160f6f1dad

2 years agoCandidate fix for the zero-payload log issue 63/263763/4 accepted/tizen/unified/20210917.124807 submit/tizen/20210911.232819 submit/tizen/20210916.011737
Michal Bloch [Thu, 9 Sep 2021 18:31:00 +0000 (20:31 +0200)]
Candidate fix for the zero-payload log issue

The stdout redirection mode for Android Logger can apparently produce
zero payload logs. Add a check to guard against this and also some
other cases as a safety measure.

Change-Id: I20ea6c9a49ae6b17d902b1cd21e208a949ae409f
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
2 years agoMoved test from test_libdlogutil.c to libdlogutil_neg.c. 90/263490/14
Hubert Kowalski [Thu, 2 Sep 2021 09:34:27 +0000 (11:34 +0200)]
Moved test from test_libdlogutil.c to libdlogutil_neg.c.

negative_main test was moved to libdlogutil_neg as this test didn't really
test anything related to integration. Essentialy it was a misplaced unit test.
So it is moved where it belongs.

Change-Id: Idc8b4b005e7d3cc5a07a771915600d559994abd1

2 years agoReduce compiler complaints by adding helpful asserts 69/261469/4
Mateusz Majewski [Mon, 19 Jul 2021 12:59:51 +0000 (14:59 +0200)]
Reduce compiler complaints by adding helpful asserts

Change-Id: I3975c8399cfde2718aa3711d8ad1df46124bd842

2 years agoMark a ton of static vars as such 24/262224/4
Michal Bloch [Tue, 3 Aug 2021 19:11:44 +0000 (21:11 +0200)]
Mark a ton of static vars as such

Change-Id: I9bdd8fde2ee206ea017664f8a286c44bf1956023
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
2 years agoRemove some janky unit test code 23/262223/5
Michal Bloch [Tue, 3 Aug 2021 18:09:43 +0000 (20:09 +0200)]
Remove some janky unit test code

It was disabled anyway and for good reasons.

Change-Id: Id4f3f8447f1121181b4a50c22c2ee3078fc58a94
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
2 years agoHandle timestamp fetching failure on printing 13/262013/6
Michal Bloch [Fri, 30 Jul 2021 11:41:12 +0000 (13:41 +0200)]
Handle timestamp fetching failure on printing

Change-Id: I81dd4ad1893fb50b12a1ce792eded08a9989f955

2 years agoMicrooptimize a getpid call out of empty QoS check 71/262271/4
Michal Bloch [Thu, 5 Aug 2021 14:58:05 +0000 (16:58 +0200)]
Microoptimize a getpid call out of empty QoS check

Change-Id: Id4119faa5cefcf7e4cded2d97c55aa475b2001f2
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
2 years agoAdded deep_copy_dlogutil_entry_s() function and tests for it. 69/262369/11
Hubert Kowalski [Mon, 9 Aug 2021 06:54:59 +0000 (08:54 +0200)]
Added deep_copy_dlogutil_entry_s() function and tests for it.

The deep_copy_dlogutil_entry_s function was made in effort
to create abstraction layer. Thus make code more readable.

Change-Id: If48246c3aefda46d77cbfbfb66337b7b18787da6

2 years agoClarify overview.rst a bit 27/262427/1
Mateusz Majewski [Tue, 10 Aug 2021 09:09:24 +0000 (11:09 +0200)]
Clarify overview.rst a bit

Change-Id: I63db978712631508dd75b60cfb1df1957d14944f

2 years agoEnable more redirection tests on logger 35/261235/2
Mateusz Majewski [Thu, 8 Jul 2021 05:54:23 +0000 (07:54 +0200)]
Enable more redirection tests on logger

Change-Id: I8611ef19184d3c0dd68a874e57f916ed60882724

2 years agoDaemon write socket: rename to "conn" 43/261543/3 submit/tizen/20210722.222608
Michal Bloch [Tue, 20 Jul 2021 20:49:57 +0000 (22:49 +0200)]
Daemon write socket: rename to "conn"

Including socket paths from ".wr" to ".conn", this is done to reduce
confusion because the socket isn't actually the final writing target.

Change-Id: Ief187209ac54eb76cd404c89b208b4a8da7f795e
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
2 years agoFix some resource leaks. 45/260845/5
Michal Bloch [Mon, 5 Jul 2021 12:04:23 +0000 (14:04 +0200)]
Fix some resource leaks.

One was O(1) and the other only happened on failure,
so not too impactful, but to be fixed nevertheless.

Change-Id: I069baabbf557934d20ab99ef5fcff9231d3d477e
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
2 years agoRework dlogutil_state_init 94/261094/4
INSUN PYO [Mon, 12 Jul 2021 01:53:49 +0000 (10:53 +0900)]
Rework dlogutil_state_init

Change-Id: I724514b7d9aeca85a3becf55a66cd4f416986879

2 years agoAdd test for multiple dlog_connect_fd calls 82/260882/4
Mateusz Majewski [Tue, 6 Jul 2021 08:18:22 +0000 (10:18 +0200)]
Add test for multiple dlog_connect_fd calls

Change-Id: I6454d95e5ee3cc7f5269bfcc9d6d670e128cfa8a

2 years agoDo not create state->enabled if DLOGUTIL_MODE_NONPRINTING 12/260712/2
Mateusz Majewski [Thu, 1 Jul 2021 11:13:21 +0000 (13:13 +0200)]
Do not create state->enabled if DLOGUTIL_MODE_NONPRINTING

This would be just an array of all 1s, a waste of memory and a worthless
syscall.

Change-Id: I9ef737bcf417547573d0ec264c1607318381b9c4

2 years agoRemove unused connect_dlog() 14/260214/1 accepted/tizen/unified/20210623.125322 submit/tizen/20210622.065044
Hyotaek Shim [Tue, 22 Jun 2021 06:22:53 +0000 (15:22 +0900)]
Remove unused connect_dlog()

Change-Id: Ie88190a9788b3eda5a7d5ce136073ca5f512f0e7
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
3 years agoMake the limiter a self-contained struct 14/258014/5
Mateusz Majewski [Fri, 26 Mar 2021 14:20:36 +0000 (15:20 +0100)]
Make the limiter a self-contained struct

Change-Id: Ic2abf2da2b9e51b596e5612d9ac65044cf4540c4

3 years agoAdd more useful performance measurements to dlog_cpu 08/258008/6
Mateusz Majewski [Fri, 7 May 2021 10:41:27 +0000 (12:41 +0200)]
Add more useful performance measurements to dlog_cpu

Change-Id: I72353a79666359daf15f5459e7af41284960f716

3 years agoImplement stdout benchmark 07/258007/6
Mateusz Majewski [Fri, 7 May 2021 10:41:11 +0000 (12:41 +0200)]
Implement stdout benchmark

Change-Id: Ia0fdf1abfbe24db49f65c4ce8b24d1e7fd65279c
Co-authored-by: Michał Bloch <m.bloch@samsung.com>
3 years agoAllow no fallback mode in dlog_redirect_stdout 06/258006/6
Mateusz Majewski [Fri, 16 Apr 2021 09:52:01 +0000 (11:52 +0200)]
Allow no fallback mode in dlog_redirect_stdout

Change-Id: Iaeb8a4bda937e3ec696269604de45d65e4702a28

3 years agoStreamline limiter initialization 13/258013/4
Mateusz Majewski [Wed, 21 Apr 2021 13:13:23 +0000 (15:13 +0200)]
Streamline limiter initialization

Change-Id: I36595e3bca15817b64cfc3ecd2292ac1b15e252a

3 years agoRemove an obsolete TODO 59/258659/2
Mateusz Majewski [Fri, 21 May 2021 12:27:44 +0000 (14:27 +0200)]
Remove an obsolete TODO

This is now done in lines 127-128.

Change-Id: Ida251a29f8e50b635d47fa0856ae360ac9d4cdcc

3 years agoClean up in one place more in dlog_test 65/258765/1
Mateusz Majewski [Tue, 25 May 2021 09:11:00 +0000 (11:11 +0200)]
Clean up in one place more in dlog_test

Change-Id: If9ba3fdbe27b944f6ed22041b9cb066f6ec89612

3 years agoRemove `libcap` from build requirements 39/258239/1
Michal Bloch [Wed, 12 May 2021 13:54:53 +0000 (15:54 +0200)]
Remove `libcap` from build requirements

Change-Id: I162a000d65bfb2b0251f83acd1ea3f4048f33004
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agoFix a use-after-free issue 67/258167/1
Michal Bloch [Tue, 11 May 2021 15:02:14 +0000 (17:02 +0200)]
Fix a use-after-free issue

Change-Id: I96e85f2a8965068108b00f56ed63b2855ac35f6a
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agoRelease 6.5.8 73/257773/1 accepted/tizen/unified/20210505.141516 submit/tizen/20210430.114749
Michal Bloch [Fri, 30 Apr 2021 10:22:40 +0000 (12:22 +0200)]
Release 6.5.8

Coverage collection; misc fixes

Change-Id: I4e05562d7505832759ff71b36d07c56d2f639883
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agoRemove a redundant piece of code 72/257772/1
Michal Bloch [Fri, 30 Apr 2021 10:22:02 +0000 (12:22 +0200)]
Remove a redundant piece of code

Change-Id: Ida0b53328dc51b3ed3653b47cbd1e12ead3c329f
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agogcov: Adjust build to Tizen:Gcov OBS project 02/257702/2
Karol Lewandowski [Thu, 29 Apr 2021 23:14:53 +0000 (01:14 +0200)]
gcov: Adjust build to Tizen:Gcov OBS project

Change-Id: I080b79f25ce6567cc680dd643a52c9f75e480994

3 years agoAdd '\0'-related stdout redirection tests 22/256022/3
Mateusz Majewski [Fri, 26 Mar 2021 15:56:42 +0000 (16:56 +0100)]
Add '\0'-related stdout redirection tests

Change-Id: Ic5d4432b7d855ca495dd86c66ae166663dd82b36

3 years agoAdd stdout redirection state info to logctl 35/255235/7
Mateusz Majewski [Fri, 12 Mar 2021 15:47:03 +0000 (16:47 +0100)]
Add stdout redirection state info to logctl

Change-Id: I776ee15e8d16dd9a8b2b4afe3f9529ae6cc1e8bc

3 years agoStop caching the timestamp in the server 33/257533/4
Mateusz Majewski [Tue, 27 Apr 2021 08:06:28 +0000 (10:06 +0200)]
Stop caching the timestamp in the server

Caching the timestamp makes the recv timestamps in the logs slightly
less useful, and the performance gains are questionable.

Change-Id: I71300325622ccc51bfef3cb548ce6e8a725b8429

3 years agoFix gcov build error 07/257407/2 accepted/tizen/unified/20210427.085808 submit/tizen/20210427.001358
Mateusz Majewski [Fri, 23 Apr 2021 07:54:35 +0000 (09:54 +0200)]
Fix gcov build error

Change-Id: I09b18f45fa82e0dd68ce2518b16949d47b51f5d7

3 years agoAddress some static analysis complaints 22/257122/2
Michal Bloch [Mon, 19 Apr 2021 10:43:34 +0000 (12:43 +0200)]
Address some static analysis complaints

Change-Id: I365afab682da1f86edde0a59b3e309e951c503be
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years ago[ACR-1631] Add http://tizen.org/privilege/log, platform-level privilege 59/256759/5 accepted/tizen/unified/20210421.101233 submit/tizen/20210420.085549
Hyotaek Shim [Mon, 12 Apr 2021 11:20:53 +0000 (20:20 +0900)]
[ACR-1631] Add tizen.org/privilege/log, platform-level privilege

Change-Id: Id32ad30218b9a513d7d7302790ea14ca18d8bc11
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
3 years agoRelease 6.5.7: Bring back libdlog-devel 07/257007/1 submit/tizen/20210416.093756 submit/tizen/20210419.103115 submit/tizen/20210419.103606
Karol Lewandowski [Fri, 16 Apr 2021 08:59:34 +0000 (10:59 +0200)]
Release 6.5.7: Bring back libdlog-devel

It seems moving .pc files between packages (from libdlog to dlog-devel)
causes problems for OBS, so bring back original package name to workaround
this problem.

Change-Id: I945fade0101fdd7cf655b6bb578e7ac865ee67b1

3 years agoRelease 6.5.6 64/256964/1 submit/tizen/20210415.175945 submit/tizen/20210415.193959
Michal Bloch [Thu, 15 Apr 2021 14:11:36 +0000 (16:11 +0200)]
Release 6.5.6

Fixes stdout redirection newlines; new release for build process issues

Change-Id: If1d21ad260312637684a4282b3f2c9597d29ac83

3 years agoReplace "DLOG_ERROR_NOMSG" with an empty message 61/256961/1
Michal Bloch [Thu, 15 Apr 2021 13:01:15 +0000 (15:01 +0200)]
Replace "DLOG_ERROR_NOMSG" with an empty message

Change-Id: I279aa7913fc368599439c37b80bf94ca18f5fb61
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agoRelease 6.5.5 35/256835/1 submit/tizen/20210413.230526
Michal Bloch [Tue, 13 Apr 2021 17:22:40 +0000 (19:22 +0200)]
Release 6.5.5

Further development of the stdout redirection feature

Change-Id: I97eb5775d9227ff37a0ce64f816ab629470cbe8e
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agoUpdate Android Logger stdout tag setting 34/256834/1
Michal Bloch [Tue, 13 Apr 2021 14:23:30 +0000 (16:23 +0200)]
Update Android Logger stdout tag setting

Kernel-side development changed the expected data format; conform.

Change-Id: I107b55b195cb9247fcccec7e7d48e646eeb09af8
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agoMerge "Decrease an array in tests for Coverity" into tizen
Karol Lewandowski [Tue, 13 Apr 2021 14:14:27 +0000 (14:14 +0000)]
Merge "Decrease an array in tests for Coverity" into tizen

3 years agoDecrease an array in tests for Coverity 12/256812/3
Mateusz Majewski [Tue, 13 Apr 2021 10:18:12 +0000 (12:18 +0200)]
Decrease an array in tests for Coverity

Change-Id: Ia9ecae92608f6ac15754aa6c349145c8fdeac1e6

3 years agoReplace () with (void) in function prototypes 55/256755/3
Mateusz Majewski [Mon, 12 Apr 2021 09:17:32 +0000 (11:17 +0200)]
Replace () with (void) in function prototypes

In C, argumentless functions are declared as receiving (void). It is,
however, more natural to declare them as receiving (). But this means
that the function can receive any number of arguments. This is bad.
We don't want this. We could miss some calls when adding arguments in
a refactor, leading to stack garbage/corruption.

Change-Id: I94732497663937fd3f9d30cea71a2eb966d6f439

3 years agoAdd some basic latency data to logmetrics 11/256711/4
Mateusz Majewski [Fri, 9 Apr 2021 10:33:02 +0000 (12:33 +0200)]
Add some basic latency data to logmetrics

To be exact: minimum, maximum, and average difference between sent and
recv timestamps.

Change-Id: Iecd98c2168059924fd986530f3c0de2080110e60

3 years agoRelease 6.5.4 69/256769/2 submit/tizen/20210412.154546
Karol Lewandowski [Mon, 12 Apr 2021 11:26:15 +0000 (13:26 +0200)]
Release 6.5.4

Change-Id: I3065f916ad8cadd78517859e8b568f393b6a3d8e

3 years agoType safety for redirection tags 57/256757/2
Michal Bloch [Mon, 12 Apr 2021 10:22:39 +0000 (12:22 +0200)]
Type safety for redirection tags

This was supposed to be self-documenting but it's fairly obvious that
the extra byte is for the terminator and I'm very worried about weird
things that can happen to the char (int promotions or something).

Change-Id: Ib33404db86055fb1840f5942e9740cbf6199d7c3
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agolibdlog: Do not export private functions 68/256768/2
Karol Lewandowski [Mon, 12 Apr 2021 11:51:34 +0000 (13:51 +0200)]
libdlog: Do not export private functions

Change-Id: Iffbf96204be08a5f0d71de8ce93bcfdaf962d056

3 years agolog-redirect: Deprecate connect_dlog() 67/256767/2
Karol Lewandowski [Mon, 12 Apr 2021 11:25:02 +0000 (13:25 +0200)]
log-redirect: Deprecate connect_dlog()

connect_dlog() does not use library prefix and is potentially going
to cause name conflict.

Let's remove it when possible.

Change-Id: Ib9769737d33a4cae3d19f1cd49440ea9515c7aea

3 years agoIntroduce dlog_is_fd_redirected 61/256661/2
Michal Bloch [Thu, 8 Apr 2021 12:09:24 +0000 (14:09 +0200)]
Introduce dlog_is_fd_redirected

Checks whether given FD is redirected to dlog.

Change-Id: I71bc905d9c377c5ff6791d39955459d41923a29a
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agoSimplify dlog packaging 83/256583/3
Karol Lewandowski [Wed, 7 Apr 2021 12:51:33 +0000 (14:51 +0200)]
Simplify dlog packaging

This commit reduces number of packages by combining
 - all libraries - into libdlog package
 - all development files - into dlog-devel package
 - common files - into 'dlog' package

It does not seem the fine-grained "one library per package"
scheme is useful in Tizen.

Change-Id: I1e0dff4cfb836d5c4872faa9491fdd8b5128dcb3

3 years agoIncrease config entry field lengths 43/256543/2
Michal Bloch [Tue, 6 Apr 2021 12:36:59 +0000 (14:36 +0200)]
Increase config entry field lengths

32 is not enough for limiter rules for long tags.
Examples: CAPI_APPFW_APPLICATION, SAMSUNG_CONNECT_SERVICE.

Change-Id: I296ece081595316f83894e48f28cfe9679f6cecc
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agoRelease 6.5.2 21/256421/6 accepted/tizen/unified/20210403.020733 submit/tizen/20210402.111638
Karol Lewandowski [Fri, 2 Apr 2021 08:06:52 +0000 (10:06 +0200)]
Release 6.5.2

Change-Id: I1c0297c20053d5bcda26c2d4ba86b29ae33102e8

3 years agodlog_redirect_stdout: Use internal library 38/256438/4
Karol Lewandowski [Fri, 2 Apr 2021 10:39:20 +0000 (12:39 +0200)]
dlog_redirect_stdout: Use internal library

Change-Id: Id54c7df7a5ccbfbe6b2cd8167943b08ea3347080

3 years agoRename toggle request to a better name 28/256428/1
Mateusz Majewski [Fri, 2 Apr 2021 08:16:49 +0000 (10:16 +0200)]
Rename toggle request to a better name

Change-Id: I6fdeded8caea015c71c7190d7500ec7dae027edf

3 years agoMove stdout toggle operation to control socket 86/256186/4
Mateusz Majewski [Tue, 30 Mar 2021 12:40:50 +0000 (14:40 +0200)]
Move stdout toggle operation to control socket

We put it in the write socket, but this seems to have been a mistake.

Change-Id: I01a483a14b9a87a8b93c530c38af9d4221061541

3 years agoUse named pipes when creating pipes for clients 93/256193/7
Karol Lewandowski [Fri, 2 Apr 2021 08:04:31 +0000 (10:04 +0200)]
Use named pipes when creating pipes for clients

Change-Id: I8652af5c2ad623ca39bdba5b77a52ccb29c4cfd3

3 years agoredirect-stdout: Ensure lines are line buffered 76/256376/5
Karol Lewandowski [Thu, 1 Apr 2021 11:49:16 +0000 (13:49 +0200)]
redirect-stdout: Ensure lines are line buffered

Change-Id: Ibbd677e3680900f94e7431c4c7dd1bb29e76a98b

3 years agoredirect-stdout: Perform sanity check on paramters passed to public API 85/256385/2
Karol Lewandowski [Thu, 1 Apr 2021 21:10:52 +0000 (23:10 +0200)]
redirect-stdout: Perform sanity check on paramters passed to public API

Change-Id: I060c05cb88fd834dbf6151e32e0e08056b9e9e9d

3 years agoFix a dumb mistake 63/256263/1 accepted/tizen/unified/20210401.105944 submit/tizen/20210331.124628
Mateusz Majewski [Wed, 31 Mar 2021 11:24:39 +0000 (13:24 +0200)]
Fix a dumb mistake

:hah:

Change-Id: I9cf19dba4dcfadb33eb50f2f046bfa3951004a10

3 years agoAdd extern "C" to dlog-redirect-stdout.h 43/256143/1
Hyotaek Shim [Tue, 30 Mar 2021 05:44:37 +0000 (14:44 +0900)]
Add extern "C" to dlog-redirect-stdout.h

Change-Id: I331b3db0955909c9f6808c4096fad6da97e04b4b
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
3 years agoRelease 6.5.1 00/255700/2 accepted/tizen/unified/20210328.230643 submit/tizen/20210324.095642 submit/tizen/20210326.090524
Michal Bloch [Mon, 22 Mar 2021 15:06:39 +0000 (16:06 +0100)]
Release 6.5.1

Improvements to stdout redirection, incl. support for Android Logger

Change-Id: I7964d2170b86b6fe5803bca41e438a534e6cd695

3 years agopackaging: Move dlog_redirect_stdout utility to dlogutil package 03/255703/1
Karol Lewandowski [Mon, 22 Mar 2021 21:22:35 +0000 (22:22 +0100)]
packaging: Move dlog_redirect_stdout utility to dlogutil package

This is where other utilities are.

Change-Id: I08b1152411d61ce514078df43d8806e72b414888

3 years agoAdd nominal support for Android Logger in the redirector 18/255618/4
Michal Bloch [Fri, 19 Mar 2021 12:29:33 +0000 (13:29 +0100)]
Add nominal support for Android Logger in the redirector

Change-Id: I80e2d092723951c4c22b6a47e5e6b81ebb801420
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agoSimplify stdout redirection logic a bit 79/255679/2
Mateusz Majewski [Fri, 19 Mar 2021 13:58:21 +0000 (14:58 +0100)]
Simplify stdout redirection logic a bit

The pipe backend is supposed to provide sent timestamps, ie. timestamps
that are as close to log sending time as possible. In libdlog this is
done by taking a timestamp in the sending process and attaching it to
the sent log. Of course stdout redirection can't do this.

Originally, we decided that the best solution is to not attach the sent
timestamps. This would however invalidate some internal assumptions,
which would make some functionality unusable. We were forced to add a
flag which allows users to assert that they won't be using redirection,
which would allow them to continue to use that functionality.

However, there is a simpler solution, which, not unlike magic according
to Penn Jillette (see https://www.youtube.com/watch?v=pd3_HFvQeXQ),
involves lying, cheating, and swindling. In particular, we just make up
a sent timestamp by copying it from the receive timestamp (which is a
timestamp captured in the daemon). This completely ruins the whole point
of the sent timestamp. However, it's still somewhat close to the one we
would get, and the redirection logic gets a tad bit simpler.

Change-Id: I11c6b389ddda88f067a7458e8dac596715fb4cac

3 years agoMake stdout redirection tests less racey 78/255678/1
Mateusz Majewski [Mon, 22 Mar 2021 09:21:02 +0000 (10:21 +0100)]
Make stdout redirection tests less racey

Those tests are inherently racey: unlike libdlog, stdout redirection
doesn't wait until logs are stored. Therefore, if we launch a redirected
library and then quickly fetch logs, we might see only a part of the
logs. Waiting a second between those two fixes the issue.

Change-Id: I6fed704c4455cfe7cd2ff00a62e8330dfdc0d88e

3 years agoMerge "logger: extract signal setup" into tizen
Michal Bloch [Mon, 15 Mar 2021 11:25:38 +0000 (11:25 +0000)]
Merge "logger: extract signal setup" into tizen

3 years agoMerge "Add dlogctl stdout control for pipe" into tizen
Michal Bloch [Mon, 15 Mar 2021 11:25:38 +0000 (11:25 +0000)]
Merge "Add dlogctl stdout control for pipe" into tizen

3 years agologger: extract signal setup 95/255195/1
Michal Bloch [Mon, 15 Mar 2021 06:13:11 +0000 (07:13 +0100)]
logger: extract signal setup

Change-Id: Ibe5ebdc03f1d6b88b05397d1977e50f77ea10f7b
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agoAdd dlogctl stdout control for pipe 58/255158/3
Mateusz Majewski [Tue, 9 Mar 2021 14:02:50 +0000 (15:02 +0100)]
Add dlogctl stdout control for pipe

Change-Id: I0d16717f6ca89b21ffa1d7a0c6451268695c4aa6

3 years agoAdd the toggle stdout request 21/254721/3
Michal Bloch [Thu, 4 Mar 2021 21:30:08 +0000 (22:30 +0100)]
Add the toggle stdout request

Change-Id: I3a5f6aaef0ebae87e0d33220d9b2b71c500d1cf6
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agoAdd buffer::accept_stdout 20/254720/2
Michal Bloch [Mon, 8 Mar 2021 08:15:12 +0000 (09:15 +0100)]
Add buffer::accept_stdout

No logic change so far, just the data field.

Change-Id: Icce69dfa049a4a004bf70fbdcdc87cfc54541d20
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agoMake some room among pipe request codes 19/254719/2
Michal Bloch [Thu, 4 Mar 2021 23:25:13 +0000 (00:25 +0100)]
Make some room among pipe request codes

Peanut brain: encoding N values in N bits
Galaxy brain: encoding N values in log2(N) bits

We're pressured to do this because the request is
encoded as a char so we're running out of bits.

Change-Id: Ide0949886a67e92bb792e612ae0ef3e87f7331a0
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agoRedirector binary: user-friendly params/output 27/255027/3
Michal Bloch [Wed, 10 Mar 2021 21:40:23 +0000 (22:40 +0100)]
Redirector binary: user-friendly params/output

 * removed --std{out,err}, now --{out,err}tag also enables
 * there's now the --help parameter (including -h)
 * incorrect parameters and help show extensive usage guide

Change-Id: I990c35720fce5f4fb521a6b8b09fcfb0b739744f
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agoMerge changes from topic "dlog-stdout-writer-03-2021" into tizen
Michal Bloch [Mon, 8 Mar 2021 12:03:27 +0000 (12:03 +0000)]
Merge changes from topic "dlog-stdout-writer-03-2021" into tizen

* changes:
  Add basic stdout redirector tests
  Flush redirector daemon buffer on error
  Make the pipe daemon not drop stdin bytes

3 years agoAdd basic stdout redirector tests 56/254656/3
Mateusz Majewski [Fri, 5 Mar 2021 16:22:05 +0000 (17:22 +0100)]
Add basic stdout redirector tests

Here are a few integration tests that check if it works, some
basic options, and handling of multiple lines and long lines.

Change-Id: I138c02753a7c8cdf66d9a2a1d1730d39d3fec90d

3 years agoFlush redirector daemon buffer on error 55/254655/1
Mateusz Majewski [Fri, 5 Mar 2021 16:13:12 +0000 (17:13 +0100)]
Flush redirector daemon buffer on error

Unlike the "normal" buffers, messages aren't usually sent completely in
these buffers. Therefore, when we remove the buffer, we should flush
them.

Change-Id: Idb6824e5b7e904463dfc992e3876f85381735ce6

3 years agoMake the pipe daemon not drop stdin bytes 54/254654/1
Mateusz Majewski [Fri, 5 Mar 2021 15:08:39 +0000 (16:08 +0100)]
Make the pipe daemon not drop stdin bytes

The daemon part of the stdin redirection wrongly assumed that the log
will always fit to the structure. If it didn't the part that fit was
written, but all bytes were removed from the input buffer, which
resulted in dropping all the extra bytes. This commit fixes that by
dropping the exact right amount of bytes.

Change-Id: I48fc9f80b2b617a442b5c5d654d474449a10af8c

3 years agoImprove the pipe backend stdout writer 67/254367/2
Mateusz Majewski [Mon, 1 Mar 2021 17:32:06 +0000 (18:32 +0100)]
Improve the pipe backend stdout writer

Change-Id: I4fae8ae6e977f15db43e08a51020e6acc71a0310

3 years agoAdd dlog-config-enable-redirector-for-pipe 65/254365/1
Mateusz Majewski [Mon, 1 Mar 2021 15:52:02 +0000 (16:52 +0100)]
Add dlog-config-enable-redirector-for-pipe

Change-Id: I972e085414e91da94bc90976a6cebccf5ef0bc2f

3 years agoRelease 6.5.0 89/254189/1 accepted/tizen/unified/20210301.130201 submit/tizen/20210224.142709
Michal Bloch [Wed, 24 Feb 2021 13:42:41 +0000 (14:42 +0100)]
Release 6.5.0

Adds the stdout redirector and acknowledges Tizen 6.5

Change-Id: I1d997e1725777310e83d6ca991c1c0ccdc57fee8
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agoAdd redirector binary and lib 66/253766/3
Mateusz Majewski [Wed, 17 Feb 2021 14:21:43 +0000 (15:21 +0100)]
Add redirector binary and lib

Change-Id: I704c8d0eda44accd1692464f592e3476868f28b8

3 years agoAdd stdout redirection support to the daemon 58/254058/1
Mateusz Majewski [Tue, 16 Feb 2021 12:55:20 +0000 (13:55 +0100)]
Add stdout redirection support to the daemon

Change-Id: Icca4761c9f22d7b4c4a899118d7a763b8bb49612

3 years agoAdd enable_redirector_for_pipe option 95/253695/3
Mateusz Majewski [Tue, 16 Feb 2021 11:35:17 +0000 (12:35 +0100)]
Add enable_redirector_for_pipe option

… along with supported documentation and required libdlogutil support.

Change-Id: Ic5c23f6f480a3f25e504ee5afc47d06d8a5e7ab4

3 years agoDon't explode when logs lack the timestamp 94/253694/2
Mateusz Majewski [Tue, 16 Feb 2021 10:33:00 +0000 (11:33 +0100)]
Don't explode when logs lack the timestamp

Change-Id: I255d8c6d03f218c17b66e8f40285e5c4c232f6bf

3 years agoChange connect_pipe to get dlog_control_msg struct by pointer 68/253568/2
Michal Bloch [Mon, 15 Feb 2021 14:02:22 +0000 (15:02 +0100)]
Change connect_pipe to get dlog_control_msg struct by pointer

As this struct has a flexible array member, a pointer fits better.

Change-Id: I6df7c1c372ea0f061bca05faf9538713c77f8a75

3 years agoRemove unused Requires(posttrans) dependencies 91/253791/1
INSUN PYO [Thu, 18 Feb 2021 04:37:48 +0000 (13:37 +0900)]
Remove unused Requires(posttrans) dependencies

posttrans was removed by "Move config files from /opt/etc to /etc" commit.

Change-Id: Ic69b8301a8d1ac517cacbe1b57a34d9b1c7fa6fe

3 years agoCorrect the documentation of available timestamps 85/253485/1
Mateusz Majewski [Thu, 11 Feb 2021 11:02:36 +0000 (12:02 +0100)]
Correct the documentation of available timestamps

Change-Id: I4457d59f082f80bf997cc464509a1e0c497657df

3 years agolibdlogutil: reorder parameter checks 85/246985/5
Michal Bloch [Wed, 4 Nov 2020 21:23:41 +0000 (22:23 +0100)]
libdlogutil: reorder parameter checks

Some cases in which TIZEN_ERROR_INVALID_PARAMETER would be returned
will now do so without crashing (specifically, those where the state
pointer segfaults but another parameter is also invalid).

This affects some negative tests.

Change-Id: I8761375880bc8b5c92e5590c632beb64988259fe
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agoDrop some unused value setting 64/247864/5
Michal Bloch [Wed, 18 Nov 2020 11:13:46 +0000 (12:13 +0100)]
Drop some unused value setting

Change-Id: I05ed35832c8f28688ce8ced572010ef54ade8ee8
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agoAdd an assert() to a scary-looking buffer indexing 52/247952/4
Michal Bloch [Wed, 18 Nov 2020 10:58:41 +0000 (11:58 +0100)]
Add an assert() to a scary-looking buffer indexing

Static analysis had some worries about a buffer overrun here.

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