platform/core/system/dlog.git
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>
3 years agoBe more assertive regarding request types 36/251836/2
Michal Bloch [Tue, 19 Jan 2021 19:44:19 +0000 (20:44 +0100)]
Be more assertive regarding request types

Dispatchers now exist so a type mismatch should never happen.

Change-Id: Ife09ed700e20375dabef165b3878c48de1adeaa5
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agoAdd a basic write-socket request dispatcher 35/251835/2
Michal Bloch [Mon, 18 Jan 2021 14:59:32 +0000 (15:59 +0100)]
Add a basic write-socket request dispatcher

In anticipation of new request types for that socket type.

Change-Id: I9cd8e1035f8c225158b9717e81469c1e5e1d17cd
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agoMove the connect_pipe function to a separate file 99/252399/1
Mateusz Majewski [Wed, 27 Jan 2021 09:13:43 +0000 (10:13 +0100)]
Move the connect_pipe function to a separate file

Change-Id: I22e000667bdcb34b504c1f166223c0f74bfdbeaa

3 years agoRemove a useless field 01/252101/2
Mateusz Majewski [Fri, 22 Jan 2021 10:10:08 +0000 (11:10 +0100)]
Remove a useless field

An artifact of the past.

We don't want to have this field, since we want to add the stdout mode.
But logs using such mode don't have any send timestamp, so there is
nothing reasonable to put in this field.

Change-Id: Ie4173fe81294e42564a5865fd9a0210f5684331a

3 years agoAdd some documentation on dlog_logger interface 01/251901/3
Mateusz Majewski [Wed, 20 Jan 2021 14:01:22 +0000 (15:01 +0100)]
Add some documentation on dlog_logger interface

Change-Id: I94288a407f8b19e4cef784b2d7fbc4b8c8d7bf78

3 years agoModify documentation about dlog priorities 31/249831/3 accepted/tizen/unified/20201222.122623 submit/tizen/20201217.052632 submit/tizen/20201218.002753
Hyotaek Shim [Thu, 17 Dec 2020 04:42:30 +0000 (13:42 +0900)]
Modify documentation about dlog priorities

Change-Id: If0ec7301de496fc5060a118b311ed61565e2a3ff
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
3 years agoIgnore QoS write errors more explicitly 10/249210/1
Michal Bloch [Tue, 8 Dec 2020 18:09:18 +0000 (19:09 +0100)]
Ignore QoS write errors more explicitly

Change-Id: I98c5a995565f3b31bdda6859aed50271ac67b8c3
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agoMerge "Move some headers into better places" into tizen
Michal Bloch [Fri, 4 Dec 2020 13:58:43 +0000 (13:58 +0000)]
Merge "Move some headers into better places" into tizen

3 years agoMove some headers into better places 49/249049/1
Mateusz Majewski [Fri, 4 Dec 2020 12:57:48 +0000 (13:57 +0100)]
Move some headers into better places

Change-Id: Ib01dfeb49092e26eab27f9a3ca39d5ea82eb5013

3 years agolibdlog: Allow disabling critical logs 51/248351/2 accepted/tizen/unified/20201127.130449 submit/tizen/20201126.015643
Karol Lewandowski [Wed, 25 Nov 2020 10:45:12 +0000 (11:45 +0100)]
libdlog: Allow disabling critical logs

Critical log can be disabled like other buffers:

  enable_critical=0

The default is to enable critical log buffer and function.

Change-Id: I7ce36638213b275c302ada18437cc911bb68548b

3 years agologger: extract privilege related code 45/242545/10
Michal Bloch [Wed, 26 Aug 2020 11:08:55 +0000 (13:08 +0200)]
logger: extract privilege related code

Change-Id: I7cd79b564227bb5b7479d04248430ae457b34b46
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agoMerge "Add logger daemon write buffering tests" into tizen
Michal Bloch [Mon, 9 Nov 2020 19:45:37 +0000 (19:45 +0000)]
Merge "Add logger daemon write buffering tests" into tizen

3 years agoThreadtime format: ensure space after tag 01/247201/1 accepted/tizen/unified/20201110.125035 submit/tizen/20201109.060608
Michal Bloch [Fri, 6 Nov 2020 18:11:21 +0000 (19:11 +0100)]
Threadtime format: ensure space after tag

The padding is only added for tags shorter than 8 characters.
This means that tags 8 characters or longer do not have any
whitespace between the tag and the bracket at the moment.

Tizen® Studio™ Dynamic Analyzer™ seems to expect whitespace there
to process a log correctly and I have come to believe that it drops
messages with longer tags. Not that it's any of our concern (since
technically their rule is broken), but that rule is actually fairly
sensible so we may as well adopt it.

Change-Id: I8e32fc9c5cdbd8db9d042fb7213596f85284eb41
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agoFix the short tag case 92/247192/1
Mateusz Majewski [Fri, 6 Nov 2020 10:56:54 +0000 (11:56 +0100)]
Fix the short tag case

Change-Id: Ie9a05377a40994bfc3a012d28fb17dfdc69706b6

3 years agologprint: bring back line breaks in all remaining formats 39/247039/2
Adrian Szyndela [Fri, 6 Nov 2020 08:38:21 +0000 (09:38 +0100)]
logprint: bring back line breaks in all remaining formats

The commit efa5c1ff changed tests behavior for inline warnings
however this was made due to some mistakes, mainly this one:
- line break tests were incomplete, they tested only few formats;
  this led me to think that these were the only formats that should
  be prefixed with the tag on every line. It wasn't true.

This commit fixes the formats by:
- switching the formats' line breaking behavior;
- adding line breaks tests for every missing format;
- bringing back the original inline warning tests.

Change-Id: If6db7b548e9ab1a0d6395968ee512447558afc1f

3 years agologprint: make threadtime format print metadata in every line 81/246981/1 submit/tizen/20201106.012725
Adrian Szyndela [Thu, 5 Nov 2020 15:16:25 +0000 (16:16 +0100)]
logprint: make threadtime format print metadata in every line

This brings back previous formatting for the threadtime format,
which was changed with rewriting log_print_log_line().

Additionally, it adds tests for such case, fixes inline warning test,
AND poses questions if more formats are affected by the rewrite.
And maybe commit efa5c1ff gives some hints for that.

Change-Id: I55470f397fd45fba61b8a68d58b1d9cd7f3e8257

3 years agoAdd logger daemon write buffering tests 57/246957/1
Mateusz Majewski [Thu, 5 Nov 2020 06:26:57 +0000 (07:26 +0100)]
Add logger daemon write buffering tests

Change-Id: I27cf20c553297532fde2f7ae51c9260cc084489d

3 years agoFix compilation on 64-bit targets 38/246738/2
Michal Bloch [Tue, 3 Nov 2020 18:58:58 +0000 (19:58 +0100)]
Fix compilation on 64-bit targets

Change-Id: I1da090652bbac925be2519f6137558f813d0724f
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agoMerge "Unify logger and pipe tests a bit" into tizen
Michal Bloch [Tue, 3 Nov 2020 15:36:23 +0000 (15:36 +0000)]
Merge "Unify logger and pipe tests a bit" into tizen

3 years agoUnify logger and pipe tests a bit 23/246723/1
Mateusz Majewski [Tue, 3 Nov 2020 12:03:33 +0000 (13:03 +0100)]
Unify logger and pipe tests a bit

Change-Id: I62beb09c8f00e3083037f655bf95be8684911aec

3 years agoEnable -Wall 86/245486/2
Mateusz Majewski [Fri, 9 Oct 2020 14:47:48 +0000 (16:47 +0200)]
Enable -Wall

🎉

Change-Id: I3827def56eab6042d2024083fe8ce31bf99735aa

3 years agoWarn when log is duplicated X times 67/243867/24 submit/tizen/20201027.165937
Agnieszka Baumann [Tue, 8 Sep 2020 10:24:29 +0000 (12:24 +0200)]
Warn when log is duplicated X times

Change-Id: I9302cd761a7de0f090a35940f47ef38de19ba9fa

3 years agoFix QoS division by 0 55/246255/3
Mateusz Majewski [Tue, 27 Oct 2020 08:57:13 +0000 (09:57 +0100)]
Fix QoS division by 0

While the count_above_threshold does have a check for 0, it doesn't do
what we want; we want it to return an infinite value somehow, but it
instead returns the dividend. This patch checks for this case and
returns the correct value manually.

The reason why it is important to return infinite value in this case is
that this division is supposed to always increase the threshold value.
Usually it does that correctly, since remaining_throughput has been
decreased by only those values that were under the average value, and
count_above_threshold has been decreased by count of those values.
Therefore, the result of the division is the average of all the values
that weren't lower than the previous average, and this average obviously
can't be lower than the previous average. However, if all the values are
under the average, the new average doesn't exist. It's morally infinite,
but the division instead returns the remaining_throughput, which is
obviously much lower than the original throughput, and often lower than
the threshold value. For example, if throughput is 20 and we have one
log source having written 18 logs, the result will be 2, which is wrong.

Change-Id: Id6d085707aeabc4032f931869c213f01db2c927a

3 years agoRemove time travel 70/246270/1
Mateusz Majewski [Tue, 27 Oct 2020 11:49:21 +0000 (12:49 +0100)]
Remove time travel

This commit fixes a bug in which some logs come to the pipe backend with
receipt timestamp earlier than sending timestamp.

Change-Id: I6c93cfa97547f89d6c55a4d1767322f64fe8fb5f

3 years agoAdd Requires=local-fs.target dependency to dlog_logger.service 11/245411/2
INSUN PYO [Thu, 8 Oct 2020 08:22:40 +0000 (17:22 +0900)]
Add Requires=local-fs.target dependency to dlog_logger.service

In emergency mode, local-fs.target always fails.
So, you have to check if local-fs.target is successful.

Change-Id: I6094ee7c585e62179d12e83ee36c9462491e6226

3 years agoFix QoS blocking too many logs 59/245659/3
Mateusz Majewski [Tue, 13 Oct 2020 11:00:08 +0000 (13:00 +0200)]
Fix QoS blocking too many logs

The original implementation of QoS had some logic errors which made it
allow too few logs. This commit fixes those logic errors, and raises
the limit in the integration tests accordingly.

Change-Id: Ia2591eca30fa5518575c0889fc7fa9d4e6bc1e54

3 years agoUpdate the overview file 19/245819/1
Mateusz Majewski [Fri, 16 Oct 2020 07:07:14 +0000 (09:07 +0200)]
Update the overview file

Change-Id: Idd6a56f7543186112f9ce82bfa4d6edc3c094acc

3 years agoDo not prepare for printing if not going to print 70/245770/2
Mateusz Majewski [Thu, 15 Oct 2020 12:18:28 +0000 (14:18 +0200)]
Do not prepare for printing if not going to print

The prepare_print function assumes that we are going to print. In
particular, it can disable buffers at will if they aren't going to be
printed. This can be problematic if we want to clear those buffers.

Change-Id: Ibe13a21cf0b599340d6404be569a2199bb3be9bc

3 years agoMake sure a mode isn't set if we want to use fetch operations 69/245769/2
Mateusz Majewski [Thu, 15 Oct 2020 11:54:52 +0000 (13:54 +0200)]
Make sure a mode isn't set if we want to use fetch operations

Change-Id: Ida4603727554c721eb03c0ea22b543c6cb83c39d

3 years agoMake sure the buffer is enabled before querying it 57/245757/1
Mateusz Majewski [Thu, 15 Oct 2020 09:53:41 +0000 (11:53 +0200)]
Make sure the buffer is enabled before querying it

Otherwise, the operation might segfault.

Change-Id: I7ba7e8fab50bc9bb3cbfa26e8ebbd086bfc2b4e9

3 years agoFix some cases of data loss caused by partial writes 08/245708/2
Mateusz Majewski [Wed, 14 Oct 2020 12:14:02 +0000 (14:14 +0200)]
Fix some cases of data loss caused by partial writes

Change-Id: Ibce508fac5f674041547253ebc8ad6fe6c64d649

3 years agoRemove some obsolete TODOs 79/245679/2
Mateusz Majewski [Wed, 14 Oct 2020 06:26:50 +0000 (08:26 +0200)]
Remove some obsolete TODOs

We now have a separate option parser, which doesn't use dlogutil_config
for reusability. Also, the logger does have the flush functionality
already (see flush_logfile_timely in logger.c).

Change-Id: Iefbac63e499b22b2b359710be76b65dd4a55af39

3 years agoMake some functions static only outside of unit tests 85/245485/1
Mateusz Majewski [Fri, 9 Oct 2020 14:46:10 +0000 (16:46 +0200)]
Make some functions static only outside of unit tests

Change-Id: I92bad069655456172cef67d1da37463567e6303e

3 years agoMake sure a function is only declared when it's actually defined 84/245484/1
Mateusz Majewski [Fri, 9 Oct 2020 14:45:20 +0000 (16:45 +0200)]
Make sure a function is only declared when it's actually defined

Change-Id: I974d9b984260940c94dd7dca9704a77e8511a239

3 years agoFix function formatting 83/245483/1
Mateusz Majewski [Fri, 9 Oct 2020 14:03:32 +0000 (16:03 +0200)]
Fix function formatting

Change-Id: Id9058c6480d1a463f09ff9effe78d29575f2fdad

3 years agoImprove src/tests/logutil.c 78/245478/1
Mateusz Majewski [Fri, 9 Oct 2020 13:39:58 +0000 (15:39 +0200)]
Improve src/tests/logutil.c

Change-Id: Ied5c4a0f846f36d8941f4a1b492f76d3fd1468e4

3 years agoUse the sizeof(*ptr) pattern more consistently 75/245475/1
Mateusz Majewski [Fri, 9 Oct 2020 12:47:22 +0000 (14:47 +0200)]
Use the sizeof(*ptr) pattern more consistently

It allows the code to withstand type changes slightly better.

Change-Id: I143806c54528e8cf30d18526b7a481280665ac6b

3 years agoLearn to count to 9 74/245474/1
Mateusz Majewski [Fri, 9 Oct 2020 12:05:11 +0000 (14:05 +0200)]
Learn to count to 9

Change-Id: I2fd23c61a793aadaea1bad5f9be32c6ca38485d0

3 years agoFix various formatting issues 73/245473/1
Mateusz Majewski [Fri, 9 Oct 2020 11:47:30 +0000 (13:47 +0200)]
Fix various formatting issues

Change-Id: Ie6352f4b13f1eba6b2fb808b92efd1b8560495fe