Michal Bloch [Thu, 5 Jul 2018 17:01:32 +0000 (19:01 +0200)]
util: fix duplicated logs with backup buffers
If a buffer's primary device is unavailable, another can serve as
a backup. This feature has existed for a long time in libdlog, yet
dlogutil did not know about it. Thus, printing from a buffer would
fail if it used a backup device.
Recently this has been changed so that dlogutil prints logs from the
device that actually handles the buffer. This encapsulates the backup
feature and allows users to retrieve their logs without requiring any
knowledge of the backup mechanism, but fails when printing multiple
buffers that are being handled by the same device, resulting in log
duplication.
This patch fixes that failure mode by preventing devices from being
opened multiple times.
Change-Id: Iad43200da8f544a1e920182d7ec814fb917c402f
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Fri, 6 Apr 2018 13:55:48 +0000 (15:55 +0200)]
util: make log_len Android Logger backend specific
Under the pipe backend, it is the daemon who decides when to stop
sending more logs when dumping so util does not need to keep track.
Change-Id: I53aea552e8fd4bda2857dc63cef40d9f91f1b4d7
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Fri, 27 Apr 2018 12:55:29 +0000 (14:55 +0200)]
kmsg parser uses supplied priority and facility
Previously it was ignored and set to ERROR/"DEVKMSG".
Change-Id: Icaf481b741459d2053b4b2f73c51c2b2e465dd38
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Fri, 27 Apr 2018 12:54:37 +0000 (14:54 +0200)]
shared: split up queued_entry into separate files
queued_entry used to contain a bunch of things that happened to use
one another but weren't otherwise related. Split them up to make the
files more specific and easier to navigate.
Change-Id: Ie709e7d9261bbd484d6e13fcceaa9fce495782cc
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Fri, 29 Jun 2018 17:09:58 +0000 (19:09 +0200)]
Fix test contamination when missing apps AL device
Some devices have neither `/dev/log_apps` nor `/dev/log_events`
and so any `apps` logs end up in `main`. For testing we disable
other users from writing to `main` but not to `apps`, so the
redirection contaminates the testing environment.
Change-Id: I915e295c188319e4fe3a0c9403df17b163f15425
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Maciej Slodczyk [Thu, 28 Jun 2018 09:15:34 +0000 (11:15 +0200)]
logger: stop at first found buffer file even when unable to open it
When trying to open a buffer device file from a list of possible
paths, make the process stop at first file that exists even if it
has no permissions to open that file. This will prevent from
opening a wrong or fallback buffer.
Change-Id: Iad6cc0154fc173066456395bfb1863ff4ccf27d9
Signed-off-by: Maciej Slodczyk <m.slodczyk2@partner.samsung.com>
Maciej Slodczyk [Fri, 22 Jun 2018 12:42:16 +0000 (14:42 +0200)]
testsuite: add information when logger daemon dies during tests
Change-Id: If8abee87351465d68d37918b8562692ed31b958c
Signed-off-by: Maciej Slodczyk <m.slodczyk2@partner.samsung.com>
Maciej Slodczyk [Thu, 21 Jun 2018 15:16:06 +0000 (17:16 +0200)]
logger: add 'main' buffer as a fallback for other buffers
Change-Id: Ic5399c4226cf008d0bd57108ba960e99509a3bb6
Signed-off-by: Maciej Slodczyk <m.slodczyk2@partner.samsung.com>
Maciej Slodczyk [Thu, 21 Jun 2018 15:08:29 +0000 (17:08 +0200)]
logger: eliminate possible bug when copying strings
The strncpy() call may result in unterminated
string bug if a source does not contain a string
termination byte in specified length.
Change-Id: I17a0a474d1e7589ba3ae4172e28c102f56bdc37b
Signed-off-by: Maciej Slodczyk <m.slodczyk2@partner.samsung.com>
Maciej Slodczyk [Thu, 21 Jun 2018 12:45:53 +0000 (14:45 +0200)]
logger: eliminate race condition in opening a buffer file
With a patch that allows specifying multiple buffer paths
in config file a race condition was introduced: the
existence of a buffer file was checked with access() in a loop,
then the one that was found was opened with open(). Now, the
access() call is eliminated, the file is opened immediately.
Change-Id: Ieda1219eef8457e0c1f21ad1d4a2112a933f39a4
Signed-off-by: Maciej Slodczyk <m.slodczyk2@partner.samsung.com>
Maciej Slodczyk [Tue, 19 Jun 2018 13:55:39 +0000 (15:55 +0200)]
testsuite: add README file
Change-Id: I4f1a0bab9b1ca6bc8cbe455ec751096271a7b87b
Maciej Slodczyk [Thu, 14 Jun 2018 15:32:31 +0000 (17:32 +0200)]
logger: allow specifying multiple buffer paths in config file
Change-Id: I53b87c26265b4c7774116c4f242abbc8149014b7
Signed-off-by: Maciej Slodczyk <m.slodczyk2@partner.samsung.com>
sanghyeok.oh [Thu, 7 Jun 2018 07:59:12 +0000 (16:59 +0900)]
lcov: added excluding line
Change-Id: I41e6d5102c740d60ae3bb3aece09a769afe68bac
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
Michal Bloch [Thu, 14 Jun 2018 14:45:28 +0000 (16:45 +0200)]
util: improve formats (-v) documentation
Add a description of how each format looks
and what some of the values mean.
Change-Id: I2c90c26ceb12af04652ce75bd4a0ee57e819aa05
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Maciej Slodczyk [Wed, 13 Jun 2018 15:45:48 +0000 (17:45 +0200)]
testsuite: supress stderr messages from subcommands during tests
Change-Id: I92285b5c8f4433db5157acccf4b245ac99d46592
Karol Lewandowski [Tue, 29 May 2018 15:14:10 +0000 (17:14 +0200)]
packaging: logger: Ensure logger device node permissions are applied before dlog_logger is started
This is workaround for dlog_logger being started before udev applies
its rules (which includes device node permissions, which dlog tries
to access).
Change-Id: Idd942e83bad03bd1eeefc8e5aa4a790f3d9c67dd
Karol Lewandowski [Fri, 15 Jun 2018 08:44:23 +0000 (10:44 +0200)]
packaging: tests: Do not try reboot machine to ensure proper dlog config
Installing dlog-tests package intentionally breaks
dlog setup for normal use case, but system should
not be rebooted without user consent. Rebooting
in %post might potentially make RPM db inconsistent
and impact other pending rpm actions.
Change-Id: I95e7eb0fcf6f12ff20c0bfaa6699e476793e4a4b
Karol Lewandowski [Thu, 14 Jun 2018 12:25:45 +0000 (12:25 +0000)]
Merge "Revert "logger: detect proper apps/events buffer path"" into tizen
Michal Bloch [Tue, 12 Jun 2018 12:06:21 +0000 (14:06 +0200)]
Fix sorting breaking tail dump mode
Change-Id: Ic15181104fc1f0c3bed8d487f9a0c18c33505805
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Tue, 12 Jun 2018 15:07:38 +0000 (17:07 +0200)]
Revert "logger: detect proper apps/events buffer path"
This reverts commit
f4fe42b5dc8dcff4572353675c1bc52a62d7d939.
The post-install script works correctly as long as the package
is installed on the target directly. However, it won't work if
it arrives on the target by being included in an image, due to
the post-install script having been ran on a different system,
the one where the image had been built and not the target one.
There isn't a strict regression because the end result is that
the image sometimes contains the other path (which means there
are still some devices that will work and some that won't), so
there might still be value to keeping the change as a reminder
of the underlying problem of Android log device availablility.
Change-Id: Id71b5a66d3115fdac876ad06c51aed607a31b452
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Fri, 27 Apr 2018 10:41:46 +0000 (12:41 +0200)]
logger: make a printing function const
Log entries should never be modified by being printed
so this helps prevent possible mistakes in the future.
Change-Id: Ib03209db7fbcc382a73c24ababe172da5bdcdbbf
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Maciej Slodczyk [Fri, 8 Jun 2018 15:02:21 +0000 (17:02 +0200)]
logger: detect proper apps/events buffer path
Depending on a kernel version apps/events device file
path differ - it's either /dev/log_apps in older kernel
implementations of android logger backend, or
/dev/log_events in newer ones. The path to the device
file is set by a config file. With this patch, the right
path is detected when dlogbackend-logger is installed
and proper config files are placed in /opt/etc/dlog.conf.d/
Change-Id: Ic08bc13ff2ae7a86099ea3a0e2e5586aeb21babd
Signed-off-by: Maciej Slodczyk <m.slodczyk2@partner.samsung.com>
Maciej Slodczyk [Fri, 25 May 2018 21:03:10 +0000 (23:03 +0200)]
testsuite: simplify syntax
Change-Id: Id6883b2156a99859905e2ae61ffbfe462cf65ff9
Maciej Slodczyk [Mon, 4 Jun 2018 13:29:26 +0000 (15:29 +0200)]
testsuite: add pid/tid filter tests
Change-Id: I0e92b5c9b52e059cc4ebfa68986d1aa1bc16d8ac
Signed-off-by: Maciej Slodczyk <m.slodczyk2@partner.samsung.com>
Maciej Slodczyk [Wed, 23 May 2018 12:25:29 +0000 (14:25 +0200)]
testsuite: add logger backend tests
Change-Id: I722182f1d9c3a1c49df77e62df13c8517a9b38bd
Signed-off-by: Maciej Slodczyk <m.slodczyk2@partner.samsung.com>
Maciej Slodczyk [Fri, 25 May 2018 20:25:09 +0000 (22:25 +0200)]
testsuite: add util print formats tests
Change-Id: Ia70b9a7be31e5eeecfc9506a24587993cdad2c43
Signed-off-by: Maciej Slodczyk <m.slodczyk2@partner.samsung.com>
Maciej Slodczyk [Fri, 25 May 2018 20:20:56 +0000 (22:20 +0200)]
testsuite: add parameter parsing correctness tests
Change-Id: Ia6c8de2bf159301bf4fb66cb9e44ef2d956574ec
Signed-off-by: Maciej Slodczyk <m.slodczyk2@partner.samsung.com>
Maciej Slodczyk [Fri, 25 May 2018 19:41:29 +0000 (21:41 +0200)]
testsuite: add more descriptive output
Change-Id: I5d9555fa2f476f4f62da6cf9e5ee93ad17abaa7f
Signed-off-by: Maciej Slodczyk <m.slodczyk2@partner.samsung.com>
Maciej Slodczyk [Fri, 25 May 2018 18:24:55 +0000 (20:24 +0200)]
testsuite: add sorting test scripts
Change-Id: Ia91e649af6c0aa191b9034445813ccca6fd2fd6e
Signed-off-by: Maciej Slodczyk <m.slodczyk2@partner.samsung.com>
Maciej Slodczyk [Fri, 25 May 2018 18:01:00 +0000 (20:01 +0200)]
testsuite: introduce reliable cleanup
Handles both usual and abnormal exits.
Change-Id: Ic28753e00d23beb5bfa4ddbbaf267a6bb12c754e
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Mon, 28 May 2018 11:39:20 +0000 (13:39 +0200)]
testsuite: now has its own folder
Running inside the /tmp folder is a potential security issue.
Change-Id: I540deabb722a828a522adc52982056d2690524d9
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Fri, 20 Apr 2018 14:45:42 +0000 (16:45 +0200)]
pipe: remove padding for odd-length messages
Since
154c5eaaf1ecf6224de0bcafc872c4952ffdae9b, the padding
is no longer needed as the daemon handles odd lengths correctly.
Change-Id: I722efc2e5e73f26f1896510da857a42bbfebed9c
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Maciej Slodczyk [Mon, 23 Apr 2018 09:09:28 +0000 (11:09 +0200)]
shared: fix wrong payload size when parsing android logger message
There's priority in the first byte of payload which was stripped
off but the payload size was not correctly adjusted to take this
fact into account. Now the size is calculated correctly.
Change-Id: I66227d65ca7198190419df92da8a59b9099db091
Karol Lewandowski [Fri, 20 Apr 2018 15:18:46 +0000 (15:18 +0000)]
Merge "shared: hot fix for wrong computing of message length" into tizen
Adrian Szyndela [Fri, 20 Apr 2018 14:22:02 +0000 (16:22 +0200)]
shared: hot fix for wrong computing of message length
log_format_log_line() in its final stage (starting from line 804),
adds prefix and suffix for each line. To prepare for it,
it computes lineLen by iterating to next end-of-line. Then it
simply substracts two pointers.
The iterating condition checks only if the iteration goes beyond
the message and characters are not end-of-line. However,
sometimes the total length of the message in log_entry is larger than
actual message (TODO! Check why! It is not OK!). In such case
computed line length may be larger than actual string length.
Then, strings are concatenated (up to NUL bytes), but the destination
buffer pointer is moved by too large value, effectively skipping
trailing NUL.
This patch corrects the computation of line length, taking into
account that there may actually be (potentially rogue) NUL byte
hidden somewhere inside the message.
Change-Id: Iadd04045d28c67e947e6f0066f592196f53d9781
Michal Bloch [Fri, 20 Apr 2018 11:19:44 +0000 (11:19 +0000)]
Merge "logger: a bunch of fixes for memory leaks" into tizen
Adrian Szyndela [Fri, 20 Apr 2018 10:09:54 +0000 (12:09 +0200)]
logger: a bunch of fixes for memory leaks
Change-Id: Id519bb6489a9ba52e3a8b32cdce2c144bab08217
Karol Lewandowski [Thu, 19 Apr 2018 13:55:41 +0000 (13:55 +0000)]
Merge "pipe: Do not wait for pipe_fd indefinitely" into tizen
Karol Lewandowski [Thu, 19 Apr 2018 11:12:21 +0000 (13:12 +0200)]
pipe: Do not wait for pipe_fd indefinitely
In the case of dlog_logger crash dlog clients
will try to reconnect to server and receive pipe_fd
for logging again. However, if dlog_logger is being
dumped (in Tizen - by crash-worker), clients will be
able to connect to the socket and request the new
pipe_fd, but recv() for fd will make client block
forever.
This commit works around this problem by introducing
finite timeout for which recv can wait.
Change-Id: Iddbbe668a084a2d0f4fcb2c34b80737d8c4c7eb6
Hyotaek Shim [Mon, 16 Apr 2018 04:43:13 +0000 (13:43 +0900)]
Add .gitignore
Change-Id: Ibea939edeb45994de2c9b2eadfa1e4d3f2653f8b
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
Wook Song [Fri, 13 Apr 2018 06:29:54 +0000 (15:29 +0900)]
shared: Fix issue with pointer casting on 64bit system
The type casting from the pointer of a signed int value to the pointer
of a signed long value (time_t, especially in this patch) could provide
unintended result in 64bit system. This patch fixes this issue related
to using the localtime/localtime_r function.
Change-Id: Ief46cc079a64e628c1219dc7638a494264583af5
Signed-off-by: Wook Song <wook16.song@samsung.com>
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
Hyotaek Shim [Wed, 11 Apr 2018 08:56:02 +0000 (17:56 +0900)]
Fix build error with HAVE_LOCALTIME_R
Change-Id: Ia276b3728b7a42d5813fac2ba27d0315b2ed2fe8
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
Maciej Slodczyk [Tue, 3 Apr 2018 11:11:17 +0000 (13:11 +0200)]
Remove unnecessary log_entry struct
After removal of unnecessary entry parsing between
two formats it is pointless to keep the log_entry
struct.
Change-Id: I5eb84554a5be299d6aeb2f47d7ae02f7f54bd8c1
Signed-off-by: Maciej Slodczyk <m.slodczyk2@partner.samsung.com>
Maciej Slodczyk [Tue, 27 Mar 2018 10:11:23 +0000 (12:11 +0200)]
Storage format keeps cached priority
Change-Id: I2b60fe7909b60883133fd9ff7bb39879e8548253
Michal Bloch [Wed, 4 Apr 2018 13:58:29 +0000 (15:58 +0200)]
dlog_logger daemon: handle epoll dynamically
The daemon used to have a static array for 1024 FDs (ie. the default
file descriptor limit). This was both wasteful in the usual case, as
usually this value is not reached, and incorrect otherwise, because
this limit can be increased, causing any extra FDs to starve.
Change-Id: Ifc61a2cecbfb1b78fcf00abe9655f02147f8316f
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Adrian Szyndela [Mon, 9 Apr 2018 11:38:06 +0000 (13:38 +0200)]
logger: fix leaking log_storage_readers
log_storage_reader was not freed at all...
Credit for finding to Michał Bloch <m.bloch@samsung.com>.
Change-Id: I9af873a563f47919cc61b21ac226d7e8ceccaac5
Adrian Szyndela [Mon, 9 Apr 2018 09:55:14 +0000 (11:55 +0200)]
logger: fix for use-after-free in log storage
A report from ASAN build has shown a bug while freeing a storage.
When a dumping reader was created with no available logs it
was disconnected from storage, but put into waiting_readers.
This commit changes log_storage_new_reader() in a way that
a reader is added to waiting_readers only if it is connected
to the storage.
Change-Id: Id6033fe73e86674384feb2fafb9b3814f0f0b73e
Michal Bloch [Fri, 6 Apr 2018 13:57:42 +0000 (15:57 +0200)]
util: fix dump mode not ending
An important bit of code sat inside a snippet only otherwise useful with
binary files and accidentally got culled alongside them during their
recent removal (cf.
31655fb8b716991ecfdc8e2422a0bb3e05305b1b)
Change-Id: I69e8b329edc62248df2a23a114c099720bc15d09
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Wed, 4 Apr 2018 13:04:32 +0000 (15:04 +0200)]
util: remove dynamic sort vector growth
This reverts
f9b568e5484d85d373033b2bf6857ef39cfc5c39.
Dynamic growth was originally implemented to help improve sorting quality.
However, it removes the bound on memory usage and was discovered to cause
starvation in case of a constant flow of logs. The need for very large
vectors has also recently been reduced with the implementation of sorting
in the daemon (cf. commit
e937e788bfcf4d4e791dac47099f998c778dd4fc,
"logger: inserting logs in ordered way to the buffers").
Change-Id: I6d0c89531ea7aca28b9062a4054b9975e25f0d36
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Wed, 4 Apr 2018 12:52:31 +0000 (14:52 +0200)]
util: fix a crash on -u 0 and -u 1
The sorting vector was not allocated in those cases
since it was not actually needed, but an assumption
had erroneously been introduced that it always exists.
Change-Id: I231be3cc80975792a5b5cbf6a668cd8308e43a31
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Maciej Slodczyk [Mon, 26 Mar 2018 12:07:18 +0000 (14:07 +0200)]
Remove unnecessary entry parsing
Change-Id: Ia79f67e5f42702ef70ed64b2e8b76f963d63b99b
Maciej Slodczyk [Wed, 28 Mar 2018 13:47:13 +0000 (15:47 +0200)]
remove unused callback function
struct log_file has a callback function pointer, set by
logfile_open() and used when handling binary files in
daemon. Since binary files support is removed, it is no
longer needed.
Change-Id: Idee02b1f2c3e9af2cad26c68f10ae0fb903f9730
Maciej Slodczyk [Thu, 22 Mar 2018 15:18:38 +0000 (16:18 +0100)]
util: remove binary files support, plaintext only
Binary files support is no longer needed as log entries
are now sorted by daemon.
Change-Id: Ia24712bb23b45606e477c43fa036e2904a2f45ee
Maciej Slodczyk [Thu, 22 Mar 2018 15:16:08 +0000 (16:16 +0100)]
daemon: don't create binary files, plaintext only
Binary files support is no longer needed as log entries
are now sorted by daemon.
Change-Id: I84dee5b25af358ad9de73a6209e7969b7d892b98
Michal Bloch [Tue, 20 Mar 2018 11:08:01 +0000 (12:08 +0100)]
Storage format keeps cached tag length
It has to be done at some point anyway, so do it once and be
done with it forever (previously each util reparsed the message
on its own). It's also progress towards unifying the two "entry"
structures.
Change-Id: I17f7ef2675070c228c764743a53e0a64892dd2cb
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Fri, 23 Mar 2018 13:11:57 +0000 (14:11 +0100)]
KMSG parser: refactor
Remove some variables that are no longer needed now that extended-kmsg
has been removed. Add commentary.
Change-Id: Ica194fca05694216bbd3b3d6d6f733122feafbfa
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Tue, 20 Mar 2018 13:56:38 +0000 (14:56 +0100)]
Remove inplace KMSG parsing
KMSG messages were parsed in-place, which made the process fragile
and prone to break in case the log format was changed.
Change-Id: Ie3517e172806bd54cdb3164578065cf9ab848426
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Karol Lewandowski [Tue, 27 Mar 2018 08:49:19 +0000 (10:49 +0200)]
logconfig: Remove dead code
Remove functions that were created for dlogctrl
utility, removed from codebase in commit 06d8039.
Change-Id: I2ff44899e60abe58c5b7bc33d9eee90c0a1a1464
Adrian Szyndela [Thu, 1 Mar 2018 14:40:58 +0000 (15:40 +0100)]
logger: inserting logs in ordered way to the buffers
This commit introduces new storage for log entries.
It sorts incoming log entries by their time on the fly.
Change-Id: I4f498d67ca03950d0424fbb3fc28b9187e0bfe51
Michal Bloch [Tue, 27 Mar 2018 09:55:30 +0000 (09:55 +0000)]
Merge "logger: refactor print_out_logs - extracted for single log" into tizen
Adrian Szyndela [Fri, 16 Mar 2018 13:35:32 +0000 (14:35 +0100)]
logger: refactor print_out_logs - extracted for single log
This patch extracts printing out of a single log entry
from print_out_logs() to a separate function
reader_print_out_single_log().
This is going to be used in further development.
Change-Id: I5ca8290e15bbda1b3512e5ac508b8d94827303eb
Maciej Slodczyk [Fri, 23 Mar 2018 11:42:49 +0000 (12:42 +0100)]
util: fix possible buffer overflows
Change-Id: I3f6b411fa03e9301f627e19f36c72546b58a7ab0
Michal Bloch [Tue, 20 Mar 2018 11:01:49 +0000 (11:01 +0000)]
Merge "shared: const correctness" into tizen
Michal Bloch [Tue, 20 Mar 2018 11:01:34 +0000 (11:01 +0000)]
Merge "Fix cast to enum" into tizen
Michal Bloch [Fri, 16 Mar 2018 12:37:40 +0000 (13:37 +0100)]
shared: const correctness
An unneeded line was preventing a handful of functions from being const.
Change-Id: I34f288f828505f4fd1a133efaaf3cb1f0d7656e1
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Fri, 16 Mar 2018 13:48:10 +0000 (14:48 +0100)]
Fix cast to enum
Checks against values outside the enum range are legal for the compiler
to optimize out, ergo they have to be done before the cast.
Change-Id: I3059b3a16e6331c3a3a1389f0a4acfbae1d3a16f
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Karol Lewandowski [Fri, 16 Mar 2018 09:03:10 +0000 (10:03 +0100)]
packaging: Hardcode udev rules directory location to avoid cyclic dependency
DLog did build-depend on udev devel package, as it does provide information
where udev rules are located on the system in the form of RPM macros (_udevrulesdir).
udev is part of systemd, which caused libsystemd-devel package to be installed
for the build.
In situations where someone wants to use dlog in a library that is
required by systemd this would create a cyclic build dependency:
systemd -> dlog -> library -> systemd.
Change-Id: Ia8c929ccffe169bfcb08b84ad3d273b4edd38ab5
Michal Bloch [Fri, 16 Mar 2018 11:37:10 +0000 (12:37 +0100)]
packaging: fix path convention
Be safe and assume path macros do not necessarily end with '/'.
Change-Id: I5302500d92724b86e27ae782aa621456c5bb1ce7
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Tue, 13 Mar 2018 13:34:04 +0000 (14:34 +0100)]
Handle payload sizes correctly
Change-Id: Ie809ace9b5463025caeefdbbda9d8d237bb318b9
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Mon, 12 Mar 2018 11:05:50 +0000 (12:05 +0100)]
util: add license to recently added files
Change-Id: Idb96f30717ae0a9e3274a09d903cfcd1e08e029f
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Karol Lewandowski [Thu, 8 Mar 2018 10:33:23 +0000 (10:33 +0000)]
Merge "dlogutil: add pid and tid based filtering" into tizen
Maciej Slodczyk [Thu, 15 Feb 2018 12:29:46 +0000 (13:29 +0100)]
dlogutil: add pid and tid based filtering
Add dlogutil command line options to specify pid and tid
list to be passed to daemon and filter log output by.
Change-Id: Icf233d8e01fec32a25ca2ec28791bf4e7642222f
Signed-off-by: Maciej Slodczyk <m.slodczyk2@partner.samsung.com>
Michal Bloch [Fri, 2 Mar 2018 09:12:14 +0000 (10:12 +0100)]
util: standarize output destination
Errors used to end up either in stdout or stderr without any apparent
pattern. All errors will now end up in stderr, with stdout being used
only for actual logs (or, in case of -g, the size).
Additionally, rename the _E and _D macros to ERR and DBG respectively
since there is a convention in application code that that these are
for sending logs to dlog itself.
Change-Id: Ie53fc55d4ad47a1d7cf28278d5b5392e58d9be1e
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Wed, 7 Mar 2018 12:53:28 +0000 (13:53 +0100)]
util: fix wrong errno being reported
If an Android Logger ioctl failed, and then the debug message produced due to
this failure also failed, the errno reported would be the one from the debug,
not the one from the ioctl.
Change-Id: Iae1a3a40e20ebc6f4823252a111804a043665e02
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Wed, 7 Mar 2018 13:04:40 +0000 (14:04 +0100)]
util: don't consider -h an execution failure
Explicitly requesting help is no longer considered a program execution failure.
Being shown the help due to invalid parameters is still considered a failure.
Change-Id: Iacfbbcd8249926ec9607dee84299ea48c5aa13f3
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
lokilee73 [Mon, 5 Mar 2018 09:18:54 +0000 (18:18 +0900)]
Fix typing error
Change-Id: Id541effe76d4aec610f2105a14522531d15cb1d5
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
Michal Bloch [Tue, 27 Feb 2018 11:19:04 +0000 (12:19 +0100)]
util: handle epoll fd correctly
Handle creation failure and close after use.
Change-Id: Iafaf888e18183f09ea9990c535cdec1ff9fd4f50
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Tue, 27 Feb 2018 09:43:21 +0000 (10:43 +0100)]
util: fix premature exit in dump mode
The program would end when epoll reported no ready file descriptors.
This was incorrect as data could still be awaiting to be put into
the fd when dlogutil read data from a pipe faster than dlog_logger
could feed it. Android Logger relied on this behaviour to exit when
there were no logs to read as there would not be a read() to trigger
the exit through its regular "log_len quota filled" exit path, but is
otherwise unaffected.
Change-Id: I58abc94dba9d161de684a73fe585b3efa764d0f8
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Mon, 26 Feb 2018 13:35:59 +0000 (14:35 +0100)]
util: workaround an Android Logger driver bug
GET_LOG_LEN always returns as if the connection were using protocol version 2,
even if the connection is actually using version 1. Since read does not suffer
from this problem, there is a mismatch between the total sum accumulated over
multiple reads and value reported by GET_LOG_LEN, which results in more logs
being read than is necessary. The reason it appears to work correctly when no
extra logs are present to make up the difference is that util also ends when
epoll returns zero ready file descriptors, which is an incorrect behaviour as
it can happen even with more data awaiting, for example when dlog_logger daemon
cannot keep up and fills a pipe slower than util can read it.
Change-Id: I3e48cedbc4a73d778316c1ebfeb555aa97e7d8b3
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Thu, 22 Feb 2018 13:42:02 +0000 (13:42 +0000)]
Merge "replace inplace android log entry parsing" into tizen
Maciej Slodczyk [Tue, 13 Feb 2018 12:25:15 +0000 (13:25 +0100)]
replace inplace android log entry parsing
android_logger_entry was parsed to logger_entry inplace
and caused problems when the latter was extended. Allocate
separate memory for each other so that they don't overlap.
Change-Id: I9ec9c47b9709e3a1c5a6deba5da97a91be6492db
Signed-off-by: Maciej Slodczyk <m.slodczyk2@partner.samsung.com>
Michal Bloch [Thu, 15 Feb 2018 13:03:49 +0000 (14:03 +0100)]
util: minor mainloop refactor
Change-Id: Ia02b4866857eb0328eb6a22a53fc2986e6046265
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Thu, 8 Feb 2018 14:58:16 +0000 (15:58 +0100)]
util: getsize now asks the appropriate device
Additionally, the GETSIZE request now explicitly uses a 32 bit type
so that the protocol does not leave the width undefined.
Change-Id: I1189f2734c670ee68ca76448b8efc410939df952
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Thu, 8 Feb 2018 14:16:32 +0000 (15:16 +0100)]
util: unify external request handling
Change-Id: I3b970acba37904c9a175185a68c0c0820d44f27b
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Thu, 8 Feb 2018 13:12:09 +0000 (14:12 +0100)]
util: add buffer ops
Change-Id: Id0fee76de71e46565afde89afaf906d3f11a34b7
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Karol Lewandowski [Fri, 9 Feb 2018 14:07:41 +0000 (14:07 +0000)]
Merge "Improve filtering capabilities of filterspecs" into tizen
Radoslaw Bartosiak [Wed, 31 Jan 2018 12:56:06 +0000 (13:56 +0100)]
Improve filtering capabilities of filterspecs
Add tag prefix specifier (prefix*) to show messages
with tags starting with given prefix
Add equals specifier (=E) to show only given priority messages
Change-Id: I85ad96b13da20f8c11ce28dacbeea179b39f1f1b
Signed-off-by: Radoslaw Bartosiak <r.bartosiak@samsung.com>
Michal Bloch [Wed, 7 Feb 2018 19:06:18 +0000 (20:06 +0100)]
util: handle filters correctly
* for pipe-backend, do not create a filter locally as the daemon
already does that.
* do not disable sorting based on filter count as it is orthogonal
to sorting (it is possible for many processes to share a tag).
Change-Id: I21932344861b3c8d418e39c569ace62e8cb454c0
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Wed, 7 Feb 2018 16:09:33 +0000 (17:09 +0100)]
util: extract fd_info to subfiles
Change-Id: I79569ea5bd91cc23a6b9a168f66de337a518a6f1
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Wed, 7 Feb 2018 15:30:00 +0000 (16:30 +0100)]
util: extract sort_vector to a separate file
Change-Id: Id18abbaefc2ca317802944ebebb6a1c150071ca4
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Karol Lewandowski [Thu, 8 Feb 2018 11:26:05 +0000 (11:26 +0000)]
Merge "packaging: fix post-script requirements" into tizen
Michal Bloch [Thu, 8 Feb 2018 11:09:16 +0000 (11:09 +0000)]
Merge "Fix missing nullptr check after call to malloc" into tizen
Michal Bloch [Thu, 8 Feb 2018 10:55:40 +0000 (10:55 +0000)]
Merge "shared: add a way to receive control msg reply" into tizen
Michal Bloch [Thu, 8 Feb 2018 10:55:09 +0000 (10:55 +0000)]
Merge "Fix variable shadowing." into tizen
Radoslaw Bartosiak [Thu, 8 Feb 2018 07:42:45 +0000 (08:42 +0100)]
Fix missing nullptr check after call to malloc
Change-Id: If4753a68897e2780b162c22bee6a9c2b0b826cb6
Signed-off-by: Radoslaw Bartosiak <r.bartosiak@samsung.com>
Michal Bloch [Wed, 7 Feb 2018 17:39:14 +0000 (18:39 +0100)]
Fix a missing header include
`[f]printf` requires `stdio.h`
Change-Id: I80437216477480abcf3511b4b77f5a29aeea2bb9
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Wed, 7 Feb 2018 15:04:31 +0000 (16:04 +0100)]
Fix variable shadowing.
Change-Id: Icb88cd9a624d0f1e85e784d716898b291c3b9608
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Mon, 29 Jan 2018 10:26:35 +0000 (11:26 +0100)]
shared: add a way to receive control msg reply
Change-Id: Ice96f49aaf8982c73747c05e351a16abcabec15e
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Mon, 5 Feb 2018 15:39:08 +0000 (16:39 +0100)]
packaging: fix post-script requirements
Change-Id: I4034d0affd64f73de37ceb74c317125bec6765fa
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Michal Bloch [Fri, 2 Feb 2018 13:02:49 +0000 (14:02 +0100)]
Fix a missing header include
`int32_t` requires `stdint.h`.
Change-Id: Ibdbadcdd6ead5f3e2c32a8cc46b4ee85edcd337c
Signed-off-by: Michal Bloch <m.bloch@samsung.com>