Mateusz Majewski [Thu, 11 Feb 2021 11:02:36 +0000 (12:02 +0100)]
Correct the documentation of available timestamps
Change-Id: I4457d59f082f80bf997cc464509a1e0c497657df
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>
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>
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>
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>
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>
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
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
Mateusz Majewski [Wed, 20 Jan 2021 14:01:22 +0000 (15:01 +0100)]
Add some documentation on dlog_logger interface
Change-Id: I94288a407f8b19e4cef784b2d7fbc4b8c8d7bf78
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>
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>
Michal Bloch [Fri, 4 Dec 2020 13:58:43 +0000 (13:58 +0000)]
Merge "Move some headers into better places" into tizen
Mateusz Majewski [Fri, 4 Dec 2020 12:57:48 +0000 (13:57 +0100)]
Move some headers into better places
Change-Id: Ib01dfeb49092e26eab27f9a3ca39d5ea82eb5013
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
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>
Michal Bloch [Mon, 9 Nov 2020 19:45:37 +0000 (19:45 +0000)]
Merge "Add logger daemon write buffering tests" into tizen
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>
Mateusz Majewski [Fri, 6 Nov 2020 10:56:54 +0000 (11:56 +0100)]
Fix the short tag case
Change-Id: Ie9a05377a40994bfc3a012d28fb17dfdc69706b6
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
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
Mateusz Majewski [Thu, 5 Nov 2020 06:26:57 +0000 (07:26 +0100)]
Add logger daemon write buffering tests
Change-Id: I27cf20c553297532fde2f7ae51c9260cc084489d
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>
Michal Bloch [Tue, 3 Nov 2020 15:36:23 +0000 (15:36 +0000)]
Merge "Unify logger and pipe tests a bit" into tizen
Mateusz Majewski [Tue, 3 Nov 2020 12:03:33 +0000 (13:03 +0100)]
Unify logger and pipe tests a bit
Change-Id: I62beb09c8f00e3083037f655bf95be8684911aec
Mateusz Majewski [Fri, 9 Oct 2020 14:47:48 +0000 (16:47 +0200)]
Enable -Wall
🎉
Change-Id: I3827def56eab6042d2024083fe8ce31bf99735aa
Agnieszka Baumann [Tue, 8 Sep 2020 10:24:29 +0000 (12:24 +0200)]
Warn when log is duplicated X times
Change-Id: I9302cd761a7de0f090a35940f47ef38de19ba9fa
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
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
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
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
Mateusz Majewski [Fri, 16 Oct 2020 07:07:14 +0000 (09:07 +0200)]
Update the overview file
Change-Id: Idd6a56f7543186112f9ce82bfa4d6edc3c094acc
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
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
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
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
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
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
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
Mateusz Majewski [Fri, 9 Oct 2020 14:03:32 +0000 (16:03 +0200)]
Fix function formatting
Change-Id: Id9058c6480d1a463f09ff9effe78d29575f2fdad
Mateusz Majewski [Fri, 9 Oct 2020 13:39:58 +0000 (15:39 +0200)]
Improve src/tests/logutil.c
Change-Id: Ied5c4a0f846f36d8941f4a1b492f76d3fd1468e4
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
Mateusz Majewski [Fri, 9 Oct 2020 12:05:11 +0000 (14:05 +0200)]
Learn to count to 9
Change-Id: I2fd23c61a793aadaea1bad5f9be32c6ca38485d0
Mateusz Majewski [Fri, 9 Oct 2020 11:47:30 +0000 (13:47 +0200)]
Fix various formatting issues
Change-Id: Ie6352f4b13f1eba6b2fb808b92efd1b8560495fe
Mateusz Majewski [Thu, 8 Oct 2020 11:59:03 +0000 (13:59 +0200)]
Add some docs
Change-Id: I7132296bddf6ce1095184f7a8db4e510adaebacb
Mateusz Majewski [Thu, 8 Oct 2020 07:33:58 +0000 (09:33 +0200)]
Put critical logs in the main buffer in the tests
Otherwise, the logger verbose tests emit an error.
Change-Id: Id5cdd781c3b4fa42da736fe2207837528416eec9
Michal Bloch [Fri, 2 Oct 2020 15:05:07 +0000 (15:05 +0000)]
Merge "Miscellaneous fixes" into tizen
Karol Lewandowski [Fri, 2 Oct 2020 09:59:53 +0000 (11:59 +0200)]
configure: fix typo
Change-Id: Ib08aa4467566712a45e2c5e791ec3bff6557c13f
Michal Bloch [Wed, 26 Aug 2020 10:51:56 +0000 (12:51 +0200)]
Miscellaneous fixes
Change-Id: I0245f509fa4e4c9b2ddf2d25ff823d486d7e7ae8
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Fri, 28 Aug 2020 17:20:02 +0000 (19:20 +0200)]
libdlogutil: relicense to MIT
Change-Id: Ic9fe65de28a03e00ab954f7752dc13bbda5cae7e
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Fri, 2 Oct 2020 11:06:36 +0000 (13:06 +0200)]
Remove AOSP licenses
As far as we are aware no AOSP code is left; possibly some trivial snippets
trace their origins to AOSP but I don't think anybody is going to complain
over one-liners.
Change-Id: I191add3a0348f7b7979977f2f80cef3f429acca3
Mateusz Majewski [Mon, 28 Sep 2020 10:11:00 +0000 (12:11 +0200)]
Make sure no partial UTF-8 encodings are left in the metadata
Change-Id: Ic02d5b13a3847a7231631782def6dc670082165a
Adrian Szyndela [Thu, 1 Oct 2020 11:14:07 +0000 (13:14 +0200)]
tests: fixed typo
Change-Id: I9fe7eedfd5f12fd7a4c8abf9887b059b5efcf4e4
Mateusz Majewski [Mon, 28 Sep 2020 08:21:02 +0000 (10:21 +0200)]
Reuse util's parser in the logger daemon
Change-Id: Ic3a73bf332b6359265a9727a46f2fdaf415d3d77
Mateusz Majewski [Fri, 25 Sep 2020 13:06:18 +0000 (15:06 +0200)]
Make the portable parser resetable
Change-Id: I34531397651f5a2e6c315ea2b0888c4a67dd3a37
Mateusz Majewski [Fri, 25 Sep 2020 11:03:31 +0000 (13:03 +0200)]
Move the util parser outside of util so we can reuse it
Change-Id: Icec52e46925923e549850ad9f10f221f7e363dfc
Michal Bloch [Wed, 16 Sep 2020 13:56:17 +0000 (15:56 +0200)]
Rewrite `log_add_filter_rule()`
* the last ':' delimiter is now taken instead of the first.
For example `FOO:::BAR:E` is now tag `FOO:::BAR` with prio `E`
instead of tag `FOO` and priority `::BAR:E`.
* fixes a memleak on `list_add()` failure.
* removes AOSP license because this was the last piece of AOSP code.
Change-Id: I6a94382cd6a1d3b175c5daf71b566dec4ba28717
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Mateusz Majewski [Fri, 18 Sep 2020 09:05:26 +0000 (11:05 +0200)]
Make util's option parsing more modular
Will be helpful in making the logger daemon use this implementation too
instead of having its own implementation (DRY!).
Change-Id: I899923f4299d6a4604526d3bafb8c5ee60029d39
Michal Bloch [Fri, 25 Sep 2020 06:20:13 +0000 (08:20 +0200)]
ptrs_list: list_clear family accepts NULLs
Change-Id: Id41135a151fcc354dbe6d7556ddb2cd98eb5f581
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Agnieszka Baumann [Fri, 18 Sep 2020 19:41:19 +0000 (21:41 +0200)]
Move parsers.h to the include directory
Change-Id: I2f5e77306b4b0cee0ed2c991ce0af71cf4970b89
Mateusz Majewski [Thu, 24 Sep 2020 06:09:35 +0000 (08:09 +0200)]
Remove another nested function
GCC nested functions bad in C.
Change-Id: Id37b7c00dc62937fb13eefd02e61b68c786a7b33
Michal Bloch [Wed, 23 Sep 2020 10:33:12 +0000 (12:33 +0200)]
Remove a ghetto lambda
Change-Id: I54da91b57b7a31f56c275a286e6226c2af5c13b3
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Yunmi Ha [Wed, 23 Sep 2020 05:11:52 +0000 (14:11 +0900)]
Add build option for DEP
- data execution prevention
- prevent execution at data area of memory
Change-Id: I8d6b00683754f57360cb8a42c880789a5748f9e0
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
Mateusz Majewski [Mon, 21 Sep 2020 11:38:39 +0000 (13:38 +0200)]
Improve printing of some edge case logs
Change-Id: I69d5dc78a7ef896a623193c96d7091302bbb63ab
Mateusz Majewski [Wed, 16 Sep 2020 08:20:58 +0000 (10:20 +0200)]
Finish improving the dlog_test.in script
Change-Id: I37ee9aa8a0a9bc78cfea48d7f3ed0f1b9873907f
Mateusz Majewski [Wed, 16 Sep 2020 09:01:33 +0000 (11:01 +0200)]
Fix the test script a bit
Don't call the ok and fail functions in a subshell. Bad idea.
Change-Id: Ic8c1dd12620773c700d4200385def2983d5bd59e
Yunmi Ha [Tue, 15 Sep 2020 01:20:27 +0000 (10:20 +0900)]
Fix coverity issue - buffer not null terminated
Change-Id: I51adcf189dd81ecef58e75f2fd4722ef2346755e
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
Mateusz Majewski [Tue, 15 Sep 2020 06:26:46 +0000 (08:26 +0200)]
Remove one last unnecessary link
Change-Id: I3926323ec45765a5b04041330b345457a1928b64
Mateusz Majewski [Mon, 14 Sep 2020 05:30:17 +0000 (07:30 +0200)]
Clean up Makefile.am
Change-Id: I573639255626da315293ca557b05f7ee6361b5d0
Mateusz Majewski [Fri, 11 Sep 2020 12:19:44 +0000 (14:19 +0200)]
Remove a useless variable
Note that it's quite important to put the variables and the check inside
of the pipeline. This is because the shell is allowed to run the pipeline
command in a subshell (here done explicitly, but even if we wouldn't put
an explicit subshell the shell could create one), and therefore not
propagate the changes outside, making the test useless.
Change-Id: Ie3bd27e38bbe88ede1b7dfcf63639befa0b47486
Mateusz Majewski [Fri, 11 Sep 2020 12:43:15 +0000 (14:43 +0200)]
Remove… something
This line is obviously bogus. It looks like it always calls continue,
but the reality is not so simple; -eq is arithmetic comparision, and the
contents of $line are not numbers. After removing the line, the test
still works.
Change-Id: I9093943086018f0eed2c8f5bc10ebcaf57c0f143
Mateusz Majewski [Thu, 10 Sep 2020 11:22:08 +0000 (13:22 +0200)]
Introduce basic --sort-by tests
Pipe backend only because there's not much to sort by on the AL backend.
Change-Id: Ib140bba2ddc677b49d19f0819729baa7304166c2
Mateusz Majewski [Fri, 11 Sep 2020 11:22:11 +0000 (13:22 +0200)]
Make API+internal functions behavior dependent on usage
Some functions are used both internally and exported in the libdlogutil
API. This is hacky, but we decided that, on invalid parameters, they
should assert when used internally, and return an error when used via
API.
Change-Id: Id8b2d173670a8eaa845c13a8178a43d4f421a004
Michal Bloch [Thu, 10 Sep 2020 11:40:06 +0000 (11:40 +0000)]
Merge changes Ibfc41bf3,Id7181124,Idf23665c into tizen
* changes:
Inline struct log_filter in the struct dlogutil_config
Remove an unnecessary include
Change dlogutil_filter_options -> log_filter
Mateusz Majewski [Thu, 10 Sep 2020 11:28:32 +0000 (13:28 +0200)]
Remove some unnecessary backslashes
Change-Id: Ifea988b15c12bf82bd85fe093cd4b8d0d9c27459
Mateusz Majewski [Thu, 10 Sep 2020 10:00:28 +0000 (12:00 +0200)]
Fix a little regression in the JSON format
We've forgotten the case in which the tag/message are empty in JSON
format. This commit fixes it.
Change-Id: I3e2deaf0595e46bd92ab763ae9b95e62aa9dc9f7
Mateusz Majewski [Wed, 9 Sep 2020 13:40:42 +0000 (15:40 +0200)]
Inline struct log_filter in the struct dlogutil_config
Change-Id: Ibfc41bf3f40564a409b2fd459633308c1ad469d1
Mateusz Majewski [Wed, 9 Sep 2020 13:28:00 +0000 (15:28 +0200)]
Remove an unnecessary include
Change-Id: Id718112405ebd1382eedf6f66e1ae84c65cba8b7
Mateusz Majewski [Wed, 9 Sep 2020 12:57:12 +0000 (14:57 +0200)]
Change dlogutil_filter_options -> log_filter
The log_filter struct used to be called this. Then it became part of
libdlogutil API and we decided to rename it dlogutil_filter_options and
provide dlogutil_filter_options_s alias instead of creating a wrapper.
However, now it and some related functions aren't part of libdlogutil
API anymore, so they should be called log_filter_* again.
Change-Id: Idf23665c41ba0eb5d744e1362042f3a246bd510f
Mateusz Majewski [Wed, 9 Sep 2020 12:31:21 +0000 (14:31 +0200)]
Inline dlogutil_filter_options_destroy
Note that the log_filter_free contains the NULL check too.
Change-Id: Iad6961fe9adf454350bc16e2a8a302a010a9d02b
Mateusz Majewski [Wed, 9 Sep 2020 12:15:08 +0000 (14:15 +0200)]
Inline dlogutil_filter_options_create
Change-Id: I914bb6e3215e970d226000ea859c90caaf0a2e53
Mateusz Majewski [Wed, 9 Sep 2020 11:53:00 +0000 (13:53 +0200)]
Make some internal functions more internal
Change-Id: I0868ab5a8eaee6e46a65510f133c4bb44bef689f
Mateusz Majewski [Wed, 9 Sep 2020 08:50:26 +0000 (10:50 +0200)]
Make the infamous rotation test more consistent
This test used to like to fail, especially the (2/4) part. It turned out
that it's due to a race condition; we run the dlogutil instance in the
background but we neglect to wait for it to do it's job. We can
improve on this by running the instance in the foreground, after the
logs already have been written, in the dump mode, which makes it quit
after writing all the logs.
Change-Id: Ic004918557afdc8a171fe7996fec66fdcf666bfe
Mateusz Majewski [Tue, 8 Sep 2020 13:35:52 +0000 (15:35 +0200)]
Add verbose mode and advanced argument parsing to the test script
Change-Id: I8aa0e4cd21e0acaabdad6b82817d63d6087466fc
Mateusz Majewski [Tue, 8 Sep 2020 11:38:25 +0000 (13:38 +0200)]
Quote more in the test script
Change-Id: I93b685e58ad659c8e60d01763fc94ccff038ad14
Mateusz Majewski [Tue, 8 Sep 2020 07:00:54 +0000 (09:00 +0200)]
Add a test verifying the correct handling of SIGPIPE
Change-Id: Ida44456203823bc51ed021e55e5d47b5c2913f29
Mateusz Majewski [Thu, 3 Sep 2020 09:12:55 +0000 (11:12 +0200)]
Stop pretending log_print_log_line return value is meaningful
According to its docs, log_print_log_line function returns the number of
bytes written, just like write.
In case of the write function, this is really useful, since the write
function can do partial writes in some cases and returning the exact
amount of bytes written allows us to restart the function and handle the
errors in a good way. However, all of this is irrelevant in the
log_print_log_line function, since the message is created inside the
function; there's no way to restart the write in case of the partial
write inside it. Therefore, the log_print_log_line is the only possible
place where the partial write is possible to be handled, and the place
where it should be handled; after doing so, there's no reason to return
the number of bytes written.
More importantly, after implementing log buffering, there's no good way
to report the number of bytes written, since sometimes it will just be 0
(if the log ends up in the buffer), even though everything went well.
Therefore, this function ended up returning some flummadiddle that was
strategically picked to appease tests, and had some correlation with the
log length, but had no real semantic meaning. It's simply better to not
pretend and to just return 1.
Change-Id: I31636c8aca8f3e90cf5322e4d3f85fed1df65e03
Mateusz Majewski [Thu, 3 Sep 2020 09:50:16 +0000 (11:50 +0200)]
Don't cache the file size
Little point in caching the file size if you are going to update it
before using anyway.
Yes, in some edge cases, the accurate size might be unavailable, but I
don't think that there are many cases in which we can't check the file
size, but we can write to it. More importantly, the cached value was
wrong anyway, since log_print_log_line has been returning hogwash
instead of an accurate written byte count for some time.
Change-Id: I73d8b6d757ac0cd6574b66349ac2e8054bb15aaa
Mateusz Majewski [Fri, 4 Sep 2020 12:25:08 +0000 (14:25 +0200)]
Remove data loss possibility in the log_file struct (again)
This is the fixed version of the commit that was reverted. The
difference is in the
if (written >= 0)
which used to be
if (written > 0)
which is right if we are calling the write function. But the full_write
function is not the drop-in replacement; it returns 0 on success.
Change-Id: I68216849734b5c351b178613ff18636136aedb6d
Agnieszka Baumann [Tue, 1 Sep 2020 17:24:54 +0000 (19:24 +0200)]
Conform dlogutil_get_log to Tizen errors
Change-Id: I25053217122caf750184ba208f6d19eb8fb9ae3e
Agnieszka Baumann [Mon, 31 Aug 2020 17:06:31 +0000 (19:06 +0200)]
Conform dlogutil_config_connect to Tizen errors
Change-Id: I32d660fe8ced95061a67ec7888483192c2f5af8d
Mateusz Majewski [Fri, 4 Sep 2020 08:31:06 +0000 (10:31 +0200)]
Add basic persistent logging tests
For pipe backend only for now.
Change-Id: I59ea088c9ba39c10cd9706ac5e432513e291bad1
Mateusz Majewski [Thu, 3 Sep 2020 12:53:30 +0000 (14:53 +0200)]
Revert "Remove data loss possibility in the log_file struct"
This reverts commit
64b01bc83d247c02b0ef31b26ffd58a6741e1fdc.
It turned out that the commit worked too well :)
Change-Id: Id6005ebd0d281cbd60e1a369a8e1cf10e8a600a9
Mateusz Majewski [Tue, 1 Sep 2020 12:50:01 +0000 (14:50 +0200)]
Drop the CAP_SYSLOG requirement
With the last fix, we don't need it anymore!
Change-Id: Ic5ed1ccb7a08d20c5e869a68575c676e69694711
Mateusz Majewski [Wed, 2 Sep 2020 13:10:50 +0000 (15:10 +0200)]
Remove data loss possibility in the log_file struct
Change-Id: I273953f7a5ebd4263b18d5e45c743793fb23f9b3
Mateusz Majewski [Wed, 2 Sep 2020 08:37:48 +0000 (10:37 +0200)]
Compile with -g
Currently DLog ignores global compiler flags, which contain -g for
debugging symbols. We'd like to make sure that they aren't overridden in
the future, but for now, we can just add -g here. As a bonus, a little
spacing mistake is fixed.
Change-Id: Iaef47e487dd7f9dabea0a97286a5b3b4134ed3c7
Mateusz Majewski [Wed, 2 Sep 2020 07:02:54 +0000 (09:02 +0200)]
Remove some more bashisms and weird shell issues
Change-Id: Icc8b3e13caf5961cef0938b68718fb39565dacb4
Mateusz Majewski [Wed, 2 Sep 2020 06:33:52 +0000 (08:33 +0200)]
Remove unnecessary wc -l
Change-Id: I29d8541202e5a98b26b2f09c0f14bdf9b6f97f92
Michal Bloch [Tue, 1 Sep 2020 16:17:40 +0000 (18:17 +0200)]
Fix AOSP file licenses
* logprint.h → contains no implementations (it doesn't contain any
Samsung implementations either but that is not a problem).
* libdlogutil/lib.c → never had any AOSP code, the license text
was copy-pasted from some other file. Some of the getters may
have existed earlier but returning a member from a struct is
its own specification so not really copyrightable.
* shared/logprint.c → we thought we had removed the only AOSP func
in
e7aa8a06f7d400a494f06cf51dbce6a69757b5c5, but it looks like
'log_add_filter_rule' has enough original AOSP parts that we'd
like to err on the side of caution and consider it AOSP, thus
the copyright note is reinstated until the func is rewritten.
Change-Id: Ie3c49f80261fc390bf5f7eca173963f0e93e21c5
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Agnieszka Baumann [Mon, 31 Aug 2020 17:03:10 +0000 (19:03 +0200)]
libdlogutil: memory capacity failure now returns TIZEN_ERROR_OUT_OF_MEMORY
Change-Id: Ifab87328b3b59ec0ffee50a309631eb21967c4bc
Agnieszka Baumann [Tue, 1 Sep 2020 10:50:38 +0000 (12:50 +0200)]
libdlogutil: request failure now IO_ERROR
Change-Id: I009ab67f874fe5894ed5befb97330bf93138d4a5