Mateusz Majewski [Mon, 10 Feb 2020 08:34:03 +0000 (09:34 +0100)]
Clarify the a && b || c && d type expression with parens
As suggested by -Wall.
Change-Id: Ifd6316a637542cd88aa4f115dcb2b62af38dc36e
Mateusz Majewski [Mon, 27 Jan 2020 13:46:43 +0000 (14:46 +0100)]
Add some libdlogutil negative tests
Change-Id: I7fc0aef2e522ae1a997399fb318b448a55c0a237
Mateusz Majewski [Mon, 10 Feb 2020 07:03:02 +0000 (08:03 +0100)]
Fail on no buffers passed
Change-Id: I2b7957c620fcd78507a4155de81a34036711009c
Mateusz Majewski [Fri, 31 Jan 2020 15:11:41 +0000 (16:11 +0100)]
Change -ENOTSUP to TIZEN_ERROR_NOT_SUPPORTED
This is actually a behavior change, since the both values are actually
not equal.
Change-Id: I4239f42ee2553c22095aa9bda02721b0489ff1d6
Mateusz Majewski [Fri, 7 Feb 2020 09:37:49 +0000 (10:37 +0100)]
Add exit code propagation to the integration tests
Now, if any of the tests fails, the dlog_test script will return a
nonzero error code. You can use this, for example, to execute
`dlog_test pipe && dlog_test logger`.
Note that, if you are using SDB, running `sdb shell dlog_test pipe` or a
similar command will NOT pass the exit code to the local shell. This is
because SDB always returns 0 as the exit code, no matter what was the
code of the underlying command; the nonzero exit codes are reserved for,
for example, connection failures.
Change-Id: I935ad63170ce7e02d27b496d1cf62f8c755bc3ab
Mateusz Majewski [Fri, 7 Feb 2020 08:24:11 +0000 (09:24 +0100)]
Add various libdlogutil filterspec tests
Change-Id: I12ab4b598142670e4c30fa35063261f41241e13f
Hyotaek Shim [Fri, 7 Feb 2020 01:53:23 +0000 (10:53 +0900)]
Change dlog_logger options to increase the size of log backup files
Change-Id: Ib68c769d8edc38a55c9965e8e0b8da74547ca79f
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
Mateusz Majewski [Wed, 5 Feb 2020 12:35:24 +0000 (13:35 +0100)]
Improve filter tests
Change-Id: Id8b56bf3db4ceef43a8df61fc54a432912c111b8
Mateusz Majewski [Wed, 5 Feb 2020 12:19:59 +0000 (13:19 +0100)]
Add tests for tag filtering
To make sure I won't break it ever again.
Change-Id: Ie0f9a56d9692bf09ff288975de454060e6d09c33
Mateusz Majewski [Wed, 5 Feb 2020 07:21:55 +0000 (08:21 +0100)]
Make the FDI creation check more strict
Change-Id: I4d2ca0aaf12e451cb13ce4288046863daa3127ca
Mateusz Majewski [Thu, 16 Jan 2020 07:02:14 +0000 (08:02 +0100)]
Add colorful output integration tests
Change-Id: I40fa224bf367908a3850875d25c2892e9e09ef0e
Karol Lewandowski [Wed, 5 Feb 2020 11:16:06 +0000 (12:16 +0100)]
Release 6.0.5
This release rewrite of dlogutil to use libdlogutil and numerous bugfixes.
Change-Id: I4dca1823a6a3b33b33c7b0825bb727509ee326e3
Mateusz Majewski [Mon, 3 Feb 2020 14:43:10 +0000 (15:43 +0100)]
Add KMSG integration test
Change-Id: Id41b5091cc7a9cfa6a74a712e01310e80fcce958
Michal Bloch [Tue, 28 Jan 2020 17:05:14 +0000 (18:05 +0100)]
Fix the handling of KMSG with regard to timestamps
Change-Id: I62542b352439f4447139fcd4cdd74a3e01da8e8f
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Mateusz Majewski [Wed, 5 Feb 2020 09:22:04 +0000 (10:22 +0100)]
Fix libdlogutil tag filtering
It turns out that it never worked in first place! :(
There was a tiny logical error in translation of dlogutil code into
libdlogutil; namely, dlogutil added the "*:D" at the end if no other
filterspec was added. Obviously I, not knowing how filterspec works,
decided that it would be equivalent to add it at the beginning no matter
if there are any other filterspec. This assumption is hiliarously wrong,
and now needs to be fixed.
Change-Id: I8496e3a4e248bd060d82ab5814e9b439bc2212b7
Mateusz Majewski [Wed, 5 Feb 2020 10:18:55 +0000 (11:18 +0100)]
Fix log_filter_from_filter
Change-Id: I7609bf7d586b66109bcf7f905295f647bcaf5ffe
Mateusz Majewski [Wed, 5 Feb 2020 07:21:55 +0000 (08:21 +0100)]
Fix the sed command
This command used to be wrong because it contains a star. When shell
sees the star, it expands it, which is very wrong in our case. The test
somehow still passes, but sed spams the error message on the stderr,
which is unhelpful while debugging.
Change-Id: Ief9666698b7163e6b332bb5c7535cc6814abd50e
Mateusz Majewski [Mon, 27 Jan 2020 11:26:57 +0000 (12:26 +0100)]
Enable returning TIZEN_ERROR_INVALID_PARAMETERS on invalid params instead of asserting them
Change-Id: I9754699e774b4b3de8a166063bb9b44b52c3bf06
Michal Bloch [Tue, 28 Jan 2020 11:30:13 +0000 (12:30 +0100)]
Critical logs: move to /var/log/dlog
The writer binary now has the 'System' smack label to allow this.
Change-Id: I2f8486c02caa2e45cff5594b19d3155919ddd1e9
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Fri, 31 Jan 2020 12:51:45 +0000 (13:51 +0100)]
Critical logs: avoid leaving zombie processes
libdlog doesn't really want to wait for the writer child process,
so now it leaves reaping it to init through the double fork idiom,
where the worker process is actually a grandchild and the immediate
child exists just to die and be reaped immediately.
Change-Id: I7a5c903f55b0ccd0f56824a228ee69f21ed87cac
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Fri, 31 Jan 2020 16:26:01 +0000 (17:26 +0100)]
Critical logs: less fragile unit tests
Change-Id: I826970a7a13c89051ca2dd18689ea001e2722632
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Hyotaek Shim [Mon, 3 Feb 2020 04:50:20 +0000 (13:50 +0900)]
Change time option for dlog_logger (recv_realtime -> threadtime)
Change-Id: I3ef8c23721cec38a555da5b090af9c6173544b21
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
Mateusz Majewski [Fri, 31 Jan 2020 15:43:28 +0000 (16:43 +0100)]
Fix the docs a bit
Change-Id: Ief7de9cad5383f3d8058771a5630653c0445fd35
Michal Bloch [Fri, 31 Jan 2020 10:35:18 +0000 (11:35 +0100)]
kmsg passive logs: use the same timestamp as dmesg
Change-Id: If93482f353f05f3870ff906d96cae9d60edeffee
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Mateusz Majewski [Thu, 19 Dec 2019 08:21:34 +0000 (09:21 +0100)]
Move non-shared files out of shared/ directory
Some files have been moved to the shared directory during the
libdlogutil refactor. But now dlogutil, having been rewritten to use
libdlogutil, doesn't have to use those files anymore. Therefore,
libdlogutil is the only user of those files, and so they belong in the
libdlogutil directory.
Change-Id: If9f2728f33f92b4b25d8380245a0c06d745541d0
Michal Bloch [Wed, 15 Jan 2020 16:53:39 +0000 (17:53 +0100)]
Check impossible situations more aggressively
Our locks cannot ever fail so using an assert both
better represents our confidence and improves runtime
performance for release builds.
Expands upon
7b74b02574fbc5065f6a7de31de49e73916044c3
Change-Id: I88a8ee8056d0b5a81b9f99da01bf2376e216d428
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Mon, 27 Jan 2020 16:56:29 +0000 (17:56 +0100)]
tests: exclude arg parsing
Belongs to integration tests
Change-Id: I1c26dddd73dbc0434479aa9244110cc63484f062
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Mateusz Majewski [Mon, 20 Jan 2020 12:41:15 +0000 (13:41 +0100)]
Rewrite dlogutil in terms of libdlogutil
Change-Id: I0c089c19bbf0af661a232e1ab0b82f3686ca8838
Michal Bloch [Mon, 27 Jan 2020 16:32:28 +0000 (17:32 +0100)]
libdlogutil: DLOGUTIL_MODE_FULL_DUMP is not a mode
Change-Id: Ia7bfd8d14b2f742edda14bc58d5eb5bde5163c79
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Mateusz Majewski [Mon, 27 Jan 2020 10:46:53 +0000 (11:46 +0100)]
Slightly refactor EXPORTing the API
Change-Id: I6db009bc4a9f526031e8d6b82e83f85c5bb50e21
Michal Bloch [Wed, 27 Nov 2019 12:07:05 +0000 (13:07 +0100)]
logger: separate args parsing from config parsing
Change-Id: I3878f696ee702b9c55971392840c4d8eac2f83b1
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Mateusz Majewski [Wed, 15 Jan 2020 15:46:27 +0000 (16:46 +0100)]
Add JSON integration test
Change-Id: If510047fad0a1f930a0e1e1617dc1e7db8d4ed0f
Michal Bloch [Mon, 27 Jan 2020 14:34:21 +0000 (15:34 +0100)]
dlogutil: make error message syntax consistent
Change-Id: I03d1b4612db9f665b227c68de5e738b8c2149879
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Mateusz Majewski [Mon, 27 Jan 2020 13:29:04 +0000 (14:29 +0100)]
Clarify the manpage reference
Change-Id: I141afafd2260bcb2fa86472ac4e9012ddc437d96
Mateusz Majewski [Mon, 27 Jan 2020 13:15:42 +0000 (14:15 +0100)]
Clarify TID/PID errors
Change-Id: I3039ea871f1cdcc0f03c757ee1f94f377530217e
Michal Bloch [Fri, 24 Jan 2020 13:48:17 +0000 (14:48 +0100)]
libdlogutil: type consistency
`unsigned int` is used everywhere else.
Change-Id: I991be1bc16965772dc8d6f2a0b4a4e9f7a885160
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Mateusz Majewski [Fri, 24 Jan 2020 07:34:14 +0000 (08:34 +0100)]
Decrease magic amount
Change-Id: If4b3942f25080442df372f08f49bd33ac51694c6
Mateusz Majewski [Fri, 24 Jan 2020 07:21:51 +0000 (08:21 +0100)]
Minor libdlogutil documentation clarification
Change-Id: I4bafb349eff49a6a3e14d980d4887e8e4adc751b
Michal Bloch [Fri, 24 Jan 2020 11:50:11 +0000 (12:50 +0100)]
Release 6.0.4
This release adds the critical logging functionality.
Change-Id: I90b479d53aed2d8dea84ea1c4bcc3a4e554fd57f
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Thu, 16 Jan 2020 10:03:27 +0000 (11:03 +0100)]
tests: solve some coverage regressions
Change-Id: I8dd82a6ba2da72db797db62f1d71d9fdd8c67572
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Fri, 24 Jan 2020 11:20:31 +0000 (12:20 +0100)]
tests: fix scandirat wrapping
Change-Id: I381d623749ddc90deb2ddad7d828dbbc20c160df
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Karol Lewandowski [Fri, 24 Jan 2020 11:26:55 +0000 (11:26 +0000)]
Merge "Create the critical log file at package install" into tizen
Karol Lewandowski [Fri, 24 Jan 2020 11:26:55 +0000 (11:26 +0000)]
Merge changes into tizen
Karol Lewandowski [Fri, 24 Jan 2020 11:26:55 +0000 (11:26 +0000)]
Merge changes from topic "kritzkrieg" into tizen
* changes:
Create the critical log writer program
logsend: add -k option for critical logs
Michal Bloch [Thu, 23 Jan 2020 11:26:30 +0000 (12:26 +0100)]
Create the critical log file at package install
Change-Id: I089dec6c016c924237f550e5e7a01dbea54d9733
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Mon, 20 Jan 2020 14:11:46 +0000 (15:11 +0100)]
Create the critical log writer program
Change-Id: I079979b8ca1a369ad24327b7219e2556d819f71d
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Mon, 20 Jan 2020 14:51:50 +0000 (15:51 +0100)]
logsend: add -k option for critical logs
Change-Id: I4b6a69d73eb14fa17c676aeadad490df83b981a5
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Fri, 17 Jan 2020 12:08:52 +0000 (13:08 +0100)]
libdlog: add __dlog_critical_print to the API
Still requires the special privileged logging program,
so doesn't yet do anything.
Change-Id: Id1195957592f0fa475cf8f9482b5edd8b2bc04fe
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Mateusz Majewski [Mon, 20 Jan 2020 13:30:01 +0000 (14:30 +0100)]
Make the libdlogutil sorting test actually test something
-.-
Change-Id: I15b38f7fb41ad950ae75b78cee5666e9820f6d1b
Mateusz Majewski [Mon, 20 Jan 2020 12:41:01 +0000 (13:41 +0100)]
Improve some test signatures
Change-Id: I2ac0b8f6f8848d76ca3e4d5217a26ef6efced9b5
Michal Bloch [Fri, 17 Jan 2020 13:13:45 +0000 (14:13 +0100)]
Move priority / char mapping to logcommon
Change-Id: I65206d11e943f4d4aea02c38ebeccf7a7927eb25
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Karol Lewandowski [Fri, 17 Jan 2020 15:53:44 +0000 (16:53 +0100)]
Release 6.0.3
This release brings addion of libdlogutil - library and API.
Change-Id: I4b7742ffe58b1090f6ee042a58001850d0df8008
Mateusz Majewski [Fri, 25 Oct 2019 06:24:44 +0000 (08:24 +0200)]
Implement the first version of the libdlogutil library
Change-Id: I2bf179f93df97e157a625c3538d6c9ddefa1e68b
Michal Bloch [Fri, 17 Jan 2020 10:35:17 +0000 (10:35 +0000)]
Merge "Filterspec get/setters: conform to Tizen API style" into tizen
Mateusz Majewski [Mon, 13 Jan 2020 10:10:23 +0000 (11:10 +0100)]
Filterspec get/setters: conform to Tizen API style
Change-Id: I265d5e7b2891b70a6d964f0409b13c18e0154c46
Michal Bloch [Mon, 13 Jan 2020 09:28:04 +0000 (10:28 +0100)]
Entry getters return error code
And return the actual thing through a parameter.
This is the Tizen API style.
Change-Id: Ibf4056a3d3a70c4c27de0b9bf5534c4bb575628c
Michal Bloch [Mon, 13 Jan 2020 09:17:48 +0000 (10:17 +0100)]
Remove DLOGUTIL_SORT_MAX
Only used in a test and is unwanted in an API
Change-Id: Ic186c6de6150bc004c5033469a3efe2f44c52901
Mateusz Majewski [Mon, 13 Jan 2020 08:54:36 +0000 (09:54 +0100)]
Change some `size_t` to `unsigned int`
Tizen interfaces are fairly consistent in only using `size_t` when the
variable represents the size of some object in bytes. Therefore we're
changing our variables away from `size_t` as they represent the number
of objects.
Change-Id: I7e9b0a66d51ad1ca0114387d8dbc40914f605138
Semun Lee [Thu, 16 Jan 2020 01:02:21 +0000 (10:02 +0900)]
Fix to handle F_SETLKW64 in the test code
glibc is changed to call fcntl64 in a certain configuration.
refer to: https://sourceware.org/git/?p=glibc.git;a=commit;h=
06ab719d30b01da401150068054d3b8ea93dd12f
Change-Id: Id89344430e0c85a4cf6e0bd7537c143add247d18
Signed-off-by: Semun Lee <semun.lee@samsung.com>
Michal Bloch [Tue, 14 Jan 2020 14:18:53 +0000 (15:18 +0100)]
Workaround a flaw in the build toolchain
For armv7l builds, the emulator handles the `scandirat` syscall
differently than what glibc expects. This results in EOVERFLOW.
Handle this case by skipping the test (it can't really be salvaged
from our side).
Change-Id: I8100dd342ebfc086642e134619270403ae361462
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Tue, 14 Jan 2020 12:41:19 +0000 (13:41 +0100)]
Provide wrappers for large-file system calls
Some toolchains produce binaries linked to large-file versions
of most system calls (e.g. open() → open64()). Handle those
in addition to the regular versions.
Change-Id: I7277f93fa064a168c95ca09a7cda01dafe1eafae
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Tue, 31 Dec 2019 14:56:12 +0000 (15:56 +0100)]
Don't fail the whole build through broken lcov
Change-Id: I88b873714a81b89852ae5b90295ce8828f014c07
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Karol Lewandowski [Mon, 13 Jan 2020 11:11:37 +0000 (12:11 +0100)]
Limit ability to control operations to log user and log group members
This brings consistency with Android logger backend.
Change-Id: I46f6816d6613b955b9ce84f82a54f50c0c43f7c9
Mateusz Majewski [Thu, 9 Jan 2020 11:49:31 +0000 (12:49 +0100)]
Rename dlogutil_entry_ts to dlogutil_entry_get_ts
This is to fit Tizen's guidelines better.
Change-Id: I3ec3548bd61346b94c76fd07b522b1f0129a7992
Mateusz Majewski [Thu, 9 Jan 2020 11:30:20 +0000 (12:30 +0100)]
Rename dlogutil_entry_(tag|msg) to dlogutil_entry_get_(tag|msg)
This is to fit Tizen's guidelines better.
Change-Id: Ia0e2025b17a5e86bd5f618cd1af5846dad8df340
Mateusz Majewski [Fri, 10 Jan 2020 08:30:46 +0000 (09:30 +0100)]
Rename dlogutil_write_cb to dlogutil_entry_cb
Change-Id: Ib8aa0e66a766b5918f5fcc1a0bbe747f88ef1a07
Michal Bloch [Fri, 10 Jan 2020 13:51:59 +0000 (14:51 +0100)]
Release 6.0.2
* fix Android Logger passive logging
* fix various errors found through aggressive compiler warnings
* miscellaneous minor bugfixes
Change-Id: Ibde07ec14e0db6022b95a196bcfe2f2d60c85eaa
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Thu, 9 Jan 2020 15:26:33 +0000 (16:26 +0100)]
Revert "Increase log source scanning frequency from 1s to 10ms"
This reverts commit
b98095cc7007b14b22f2e91e0e18066efbf63ec3.
No longer needed due to
f419d06319fcd3da39aa6812f05aaa8cdf330e50
and the other changes since
b98095cc. With Android Logger devices
being added to epoll, they are always handled immediately as long
as they have more data available (which is equivalent to increasing
the frequency to 0ms under the old rules).
Change-Id: Ic1150dd8e967c01e9d7f9aea3a8b13c64a5eea9b
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Thu, 9 Jan 2020 14:43:31 +0000 (15:43 +0100)]
dlog_logger: handle reader source fd entity
Change-Id: I803f5f535248d9f2ee15c99d6cd58b3486b5dfce
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Thu, 9 Jan 2020 09:12:08 +0000 (10:12 +0100)]
dlog_logger: subscribe source fd entity to epoll
The event is not yet handled (still relies on the periodic check).
Change-Id: I9ceefa64b20416a4a5bf749fc3099b58b011011b
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Thu, 9 Jan 2020 09:16:45 +0000 (10:16 +0100)]
Fix an epoll descriptor list leak
Change-Id: I914ad793674c72aeabd4c5c101d0fbc692d6cfe1
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Wed, 8 Jan 2020 15:47:02 +0000 (16:47 +0100)]
dlog_logger: wrap reader read_fd in an FD entity
No logic change so far; will be made to work with epoll
in a subsequent patch.
Change-Id: I9a3d199206b392976a63ae7b66bb14d4e8616a90
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Wed, 8 Jan 2020 15:08:42 +0000 (16:08 +0100)]
dlog_logger: rename reader fd entity to _sink
This is in preparation for adding a second fd entity to that structure,
which will represent the log source and will need to be distinguished from
the current one that represents the log sink.
Change-Id: Ia56c352c564fd0bae4a40e4c923e4ab6013a2579
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Karol Lewandowski [Wed, 8 Jan 2020 15:13:34 +0000 (16:13 +0100)]
Increase log source scanning frequency from 1s to 10ms
This is workaround. This commit ensures logs source is checked every 10ms.
In current design logs from source devices (/dev/log_) are checked
only periodically on fixed intervals (unlike other sources, which
are driven by epoll()). The "special" android source handling seems
to be microoptimisation, done due to not entirely correct architecture
decisions.
Proper solution require adding android source devices to epoll.
Change-Id: I91e01f988566c1766385d0c94c6d9dc82bd8e08b
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
Michal Bloch [Wed, 8 Jan 2020 09:53:25 +0000 (10:53 +0100)]
Fix GCC9 compilation
Change-Id: I6b6a4ae4f3fe0dba2c9d8e82db3f64618eeba203
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Thu, 2 Jan 2020 16:23:21 +0000 (17:23 +0100)]
Various string buffer size checks
Change-Id: I39a757599ddd78fd121bf5446cba7fa5ee5ee710
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Mon, 30 Dec 2019 11:29:59 +0000 (12:29 +0100)]
writev(2) requires <sys/uio.h>
Change-Id: Ifacc47eb488359d3d4741fcab16650920e8e9677
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Mateusz Majewski [Tue, 17 Dec 2019 12:40:43 +0000 (13:40 +0100)]
Refactor the permission checking for libdlogutil
Change-Id: I679f23b4366bdc70f515fb2633fb0c0d54fe0f8e
Michal Bloch [Fri, 15 Nov 2019 13:35:36 +0000 (14:35 +0100)]
Check necessary privilege for correct behaviour
Change-Id: I10a5796292e4e166df86b4f49b7f47c01a914d21
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Mateusz Majewski [Mon, 9 Dec 2019 07:50:30 +0000 (08:50 +0100)]
Create a typedef for dlogutil_entry
Change-Id: I73ff0af0d07490e6fdadd3ed1c95c42046662700
Mateusz Majewski [Mon, 9 Dec 2019 07:44:25 +0000 (08:44 +0100)]
Create a typedef for dlogutil_sorting_order
Change-Id: Ic600f59f30a686e43bb459773aa07f4892fca586
Mateusz Majewski [Mon, 9 Dec 2019 07:40:02 +0000 (08:40 +0100)]
Create a typedef for dlogutil_filter_options
Change-Id: Ic7320ed0fa10a5f6863a7095dea665029e6cca55
Mateusz Majewski [Mon, 9 Dec 2019 07:37:31 +0000 (08:37 +0100)]
Rename dlogutil_write_callback
Change-Id: Idfefbd7ab4e634dbb0f0a2470e1448db1a80c212
Mateusz Majewski [Fri, 6 Dec 2019 07:33:33 +0000 (08:33 +0100)]
Improve the sorting test loop slightly
This makes it slightly faster, slightly less fragile, and also slightly
nicer.
Change-Id: I99e54de7b25935d17d5a9a994c35b44da4fcde59
Yunmi Ha [Fri, 22 Nov 2019 02:52:33 +0000 (11:52 +0900)]
Make gcov package
- Make gcov package when --define 'gcov ON' is given
Change-Id: If2d18676637dad6f94ba9b1d4ca1bf3b8510e0b7
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
Hyotaek Shim [Fri, 29 Nov 2019 01:48:58 +0000 (01:48 +0000)]
Revert "libdlog doesn't modify errno from outside PoV"
This reverts commit
6afdbf69c184f8b1b466af16d65272ad9e7f757a.
Change-Id: Ie046f84788b84f748211df374d8d601db1280810
Mateusz Majewski [Mon, 25 Nov 2019 10:02:52 +0000 (11:02 +0100)]
Specify buffers in some calls of dlog_tests
Those tests would start failing on some targets after the libdlogutil
patches. This would be due to them trying to clear/get size of the apps
buffer, which does not exist. This was accepted before the libdlogutil
patches, because dlogutil would consider all of the enabled buffers at
the same time. However, said patches change it to clear/get size of each
buffer separately and return on the first failure. We can work around
this issue by making it so that dlogutil will not try to manipulate the
apps buffer in the failing spots.
Change-Id: I5b3135256b99b0bc8f53a14fc68f99a9effbf6c3
Yunmi Ha [Tue, 26 Nov 2019 02:39:13 +0000 (11:39 +0900)]
[logcleanup] Fix svace/coverity issue
- check return value
Change-Id: Ie861d6972c3bfa2c8346f8a25e72e0039e344e6e
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
Yunmi Ha [Tue, 19 Nov 2019 07:30:37 +0000 (16:30 +0900)]
Add dlog_cleanup service
- dlog_cleanup service will delete old dlog files.
- dlog_cleanup service will be started by activationd.
Change-Id: I3f197f98edcaa03b6f418dbefdb6f4ced714cb91
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
Mateusz Majewski [Mon, 18 Nov 2019 08:37:37 +0000 (09:37 +0100)]
Fix asserts
Some of the pointer arguments of some functions were not asserted. This
commit fixes that. To add to this, userdata is no longer asserted, since
it is not used anywhere, only passed on to the callback. This way the
user can pass NULL if he doesn't need to use it.
Change-Id: I1c6c616fef5ccb95fc6d2465a01f0df68af2b2a6
Michal Bloch [Fri, 15 Nov 2019 11:18:34 +0000 (12:18 +0100)]
Unsupported buffer set retval: EINVAL → ENOTSUP
Change-Id: I370bfc46d6326a8ae14cae89da87623adb8c7a03
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Tue, 19 Nov 2019 10:22:22 +0000 (11:22 +0100)]
libdlog doesn't modify errno from outside PoV
Change-Id: If5b0fabec233d805041fa534933828cc72bf87cf
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Thu, 7 Nov 2019 20:14:43 +0000 (21:14 +0100)]
Document the behaviour of CAP_SYSLOG
Change-Id: I3fe9d45220883b17141203539928059f57847bc1
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Mateusz Majewski [Fri, 8 Nov 2019 09:32:10 +0000 (10:32 +0100)]
Optimize terminal detection
dlogutil needs to check if it's printing to the terminal or not in order
to see if it needs to apply colors or not in the automatic color mode.
Previously, we checked this repeatedly on every log we printed. However,
whether we are printing to the terminal or not shouldn't change at all.
Therefore, we should only check this once, during setup, and then never
call isatty() again. This commit achieves that.
Change-Id: I2084a4efbfeab057f33028a4b298a929aa3d5851
Michal Bloch [Thu, 7 Nov 2019 12:24:09 +0000 (13:24 +0100)]
Fix missing logs when a dlogutil pipe gets clogged
Change-Id: I44e5c53401abc03605fdc9a0c15e5611742d31a1
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Thu, 7 Nov 2019 11:15:51 +0000 (12:15 +0100)]
Update the version to 6.0 in autoconf as well
Change-Id: Ic1bbc298d6922f182e6f2b9ad22f23f166ae43a0
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Mateusz Majewski [Wed, 6 Nov 2019 16:17:57 +0000 (17:17 +0100)]
Rename SORT_* to DLOGUTIL_SORT_*
Change-Id: I5ddf6b95b4abf24dfaecd464b94015c7bdeb51f5
Mateusz Majewski [Wed, 30 Oct 2019 16:01:00 +0000 (17:01 +0100)]
Fix a SVACE complaint
The complaint is that the function should be checked for NULL before
dereferencing. This is wrong, since we build the struct and so we can
be sure that it is indeed correctly built. However, it's simpler to just
do the check so that SVACE doesn't complain.
Change-Id: I4664170c25b2a7feeb4b25fafb6ebb9741016f5e
Mateusz Majewski [Wed, 30 Oct 2019 14:48:41 +0000 (15:48 +0100)]
Rename log_add_filter_string to dlogutil_filter_options_filterspec
Change-Id: I15b5b5aa930e36fb040d198d63d994cf2c57afa5
Mateusz Majewski [Wed, 30 Oct 2019 14:44:11 +0000 (15:44 +0100)]
Rename log_add_filter_pid to dlogutil_filter_options_pid
Change-Id: I5ed69dddb731f57d1f545110b306351f8ae379e0