platform/core/system/dlog.git
3 years agoClean up Makefile.am 12/244012/2
Mateusz Majewski [Mon, 14 Sep 2020 05:30:17 +0000 (07:30 +0200)]
Clean up Makefile.am

Change-Id: I573639255626da315293ca557b05f7ee6361b5d0

3 years agoRemove a useless variable 79/243979/2
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

3 years agoRemove… something 78/243978/2
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

3 years agoIntroduce basic --sort-by tests 04/243904/2
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

3 years agoMake API+internal functions behavior dependent on usage 61/243961/1
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

3 years agoMerge changes Ibfc41bf3,Id7181124,Idf23665c into tizen
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

3 years agoRemove some unnecessary backslashes 51/243851/1
Mateusz Majewski [Thu, 10 Sep 2020 11:28:32 +0000 (13:28 +0200)]
Remove some unnecessary backslashes

Change-Id: Ifea988b15c12bf82bd85fe093cd4b8d0d9c27459

3 years agoFix a little regression in the JSON format 30/243830/2
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

3 years agoInline struct log_filter in the struct dlogutil_config 49/243749/1
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

3 years agoRemove an unnecessary include 48/243748/1
Mateusz Majewski [Wed, 9 Sep 2020 13:28:00 +0000 (15:28 +0200)]
Remove an unnecessary include

Change-Id: Id718112405ebd1382eedf6f66e1ae84c65cba8b7

3 years agoChange dlogutil_filter_options -> log_filter 45/243745/2
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

3 years agoInline dlogutil_filter_options_destroy 44/243744/1
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

3 years agoInline dlogutil_filter_options_create 43/243743/1
Mateusz Majewski [Wed, 9 Sep 2020 12:15:08 +0000 (14:15 +0200)]
Inline dlogutil_filter_options_create

Change-Id: I914bb6e3215e970d226000ea859c90caaf0a2e53

3 years agoMake some internal functions more internal 42/243742/1
Mateusz Majewski [Wed, 9 Sep 2020 11:53:00 +0000 (13:53 +0200)]
Make some internal functions more internal

Change-Id: I0868ab5a8eaee6e46a65510f133c4bb44bef689f

3 years agoMake the infamous rotation test more consistent 17/243717/2
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

3 years agoAdd verbose mode and advanced argument parsing to the test script 27/243627/2
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

3 years agoQuote more in the test script 10/243610/1
Mateusz Majewski [Tue, 8 Sep 2020 11:38:25 +0000 (13:38 +0200)]
Quote more in the test script

Change-Id: I93b685e58ad659c8e60d01763fc94ccff038ad14

3 years agoAdd a test verifying the correct handling of SIGPIPE 63/243563/2
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

3 years agoStop pretending log_print_log_line return value is meaningful 56/243156/3
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

3 years agoDon't cache the file size 55/243155/3
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

3 years agoRemove data loss possibility in the log_file struct (again) 14/243314/2
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

3 years agoConform dlogutil_get_log to Tizen errors 79/243179/3
Agnieszka Baumann [Tue, 1 Sep 2020 17:24:54 +0000 (19:24 +0200)]
Conform dlogutil_get_log to Tizen errors

Change-Id: I25053217122caf750184ba208f6d19eb8fb9ae3e

3 years agoConform dlogutil_config_connect to Tizen errors 80/243180/2
Agnieszka Baumann [Mon, 31 Aug 2020 17:06:31 +0000 (19:06 +0200)]
Conform dlogutil_config_connect to Tizen errors

Change-Id: I32d660fe8ced95061a67ec7888483192c2f5af8d

3 years agoAdd basic persistent logging tests 89/243289/2 accepted/tizen/unified/20200908.060805 submit/tizen/20200907.062212
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

3 years agoRevert "Remove data loss possibility in the log_file struct" 70/243170/1
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

3 years agoDrop the CAP_SYSLOG requirement 78/242878/6
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

3 years agoRemove data loss possibility in the log_file struct 21/243021/2
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

3 years agoCompile with -g 97/242997/4
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

3 years agoRemove some more bashisms and weird shell issues 04/243004/1
Mateusz Majewski [Wed, 2 Sep 2020 07:02:54 +0000 (09:02 +0200)]
Remove some more bashisms and weird shell issues

Change-Id: Icc8b3e13caf5961cef0938b68718fb39565dacb4

3 years agoRemove unnecessary wc -l 68/242968/1
Mateusz Majewski [Wed, 2 Sep 2020 06:33:52 +0000 (08:33 +0200)]
Remove unnecessary wc -l

Change-Id: I29d8541202e5a98b26b2f09c0f14bdf9b6f97f92

3 years agoFix AOSP file licenses 90/242890/1
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>
3 years agolibdlogutil: memory capacity failure now returns TIZEN_ERROR_OUT_OF_MEMORY 82/242882/2
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

3 years agolibdlogutil: request failure now IO_ERROR 83/242883/2
Agnieszka Baumann [Tue, 1 Sep 2020 10:50:38 +0000 (12:50 +0200)]
libdlogutil: request failure now IO_ERROR

Change-Id: I009ab67f874fe5894ed5befb97330bf93138d4a5

3 years agolibdlogutil: config failure now returns TIZEN_ERROR_IO_ERROR 84/242884/1
Agnieszka Baumann [Fri, 28 Aug 2020 13:56:17 +0000 (15:56 +0200)]
libdlogutil: config failure now returns TIZEN_ERROR_IO_ERROR

Instead of an arbitrary POSIX errno

Change-Id: Ieeb3c93d8d72fa19322ac9a0f232800632b16ca9

3 years agoAssert that the logger devices don't end 73/242873/1
Mateusz Majewski [Tue, 1 Sep 2020 10:41:28 +0000 (12:41 +0200)]
Assert that the logger devices don't end

Change-Id: Ib8abd22294360784158a75d49af127019922872a

3 years agoUse the hash from hash.c in the limiter 68/242868/1
Mateusz Majewski [Tue, 1 Sep 2020 10:08:26 +0000 (12:08 +0200)]
Use the hash from hash.c in the limiter

We have a nicely tested hash implementation in hash.c. It makes little
sense for the loglimiter to have its own hash.

Change-Id: I09e8c8bb8e2dcc385a2063d794bf5c627fa12460

3 years agoFix a long-standing Android Logger blocking bug 67/242867/1
Mateusz Majewski [Tue, 1 Sep 2020 08:11:51 +0000 (10:11 +0200)]
Fix a long-standing Android Logger blocking bug

Change-Id: I8c99d1f5ed70570e8bf1facab248207f07f1c2b3

3 years agoRemove an unused variable 34/242834/1
Mateusz Majewski [Tue, 1 Sep 2020 06:21:09 +0000 (08:21 +0200)]
Remove an unused variable

Change-Id: I7a4a7721e2c280ddbd57d37d4d62b87708acda3c

3 years agoRemove unused dlogutil_entry_cb 31/242731/1
Agnieszka Baumann [Mon, 31 Aug 2020 15:05:22 +0000 (17:05 +0200)]
Remove unused dlogutil_entry_cb

Change-Id: I74789caaee407e891be3816f9793f53831221128

3 years agoReduce gotos 78/242678/4
Agnieszka Baumann [Tue, 25 Aug 2020 10:43:23 +0000 (12:43 +0200)]
Reduce gotos

Change-Id: I85686289d0c3ab6c2f8a572a58a553c254b88a38

3 years agoUse the correct function 24/242724/2
Mateusz Majewski [Mon, 31 Aug 2020 12:33:04 +0000 (14:33 +0200)]
Use the correct function

Sadly a way too common in DLog case of "how has this even been working
in first place?".

Change-Id: I9f76e20fef78462ddd3d7acf239baf9f9035dbe7

3 years agoFix dlog_logger invocation in the test suite 15/242715/1
Mateusz Majewski [Mon, 31 Aug 2020 08:00:51 +0000 (10:00 +0200)]
Fix dlog_logger invocation in the test suite

Change-Id: I26823df8dd0719f2d34fcd22d2c412e5a7559b1c

3 years agoImplement a basic version of failed log stashing 88/242588/3
Mateusz Majewski [Tue, 25 Aug 2020 08:46:02 +0000 (10:46 +0200)]
Implement a basic version of failed log stashing

This implements a simple solution of keeping logs that weren't sent;
saving them in the critical log file. It's off by default.

Change-Id: I08c18d4bfe6c413961dc551fe93009a686ce1414

3 years agoImprove the integration test script a bit 56/242656/1
Mateusz Majewski [Thu, 27 Aug 2020 08:01:01 +0000 (10:01 +0200)]
Improve the integration test script a bit

This includes eliminating many bashisms (the script is supposed to be
POSIX-compatible) and fixing various warnings reported by shellcheck.
Not all warnings are fixed yet, but the other ones are harder to fix,
and what we already achieved is useful anyway.

Change-Id: Ib0f4a2f52f90fb2af823dfe9c9c37c947a0e6632

3 years agoIntroduce log write buffering 59/235659/13
Mateusz Majewski [Fri, 8 May 2020 12:59:02 +0000 (14:59 +0200)]
Introduce log write buffering

Change-Id: Iac626630b6885a4214e42c5f810aa50d98d66ecb

3 years agotests: make inline warning behave like a normal part of log 58/242158/5
Adrian Szyndela [Mon, 24 Aug 2020 13:56:59 +0000 (15:56 +0200)]
tests: make inline warning behave like a normal part of log

Inline warning is added to a log if timestamps are incorrect.
However, such warning is sometimes printed as a separate line,
with all metadata added, and sometimes printed as if it was
part of log lines.

This commit makes the tests conforming to the change in the printing
function: warning printing is now consistent with the printing
format. That is, if new lines get metadata, then warning also gets metadata,
and if new lines don't get metadata, then warning also doesn't get it.

Change-Id: I186330adb7728a715bc4bc85a386edfd2204c2ff

3 years agologprint: implement log_print_log_line() 57/242157/5
Adrian Szyndela [Fri, 7 Aug 2020 07:40:10 +0000 (09:40 +0200)]
logprint: implement log_print_log_line()

A brand new, clean room implementation of log_print_log_line()
made with the specification consisting of the existing tests,
and a bit of the other existing code, but not the old implementation
of log_print_log_line().

There was one additional change: "inline warning". Initially it was printed
sometimes with its own copy of log metadata, sometimes without it.
Now, it's consistent with the printing format: the warning gets
its own metadata only if separate lines in logs get their own metadata.

Change-Id: I93f3b7864854a6a988a9ae02743df54ad46a37fe

3 years agolog_format_log_line: CLEANSE! PURGE! KILL! 56/242156/4
Michal Bloch [Mon, 3 Aug 2020 11:17:12 +0000 (13:17 +0200)]
log_format_log_line: CLEANSE! PURGE! KILL!

Change-Id: I3387a1511920a8695420e09ea55120d677061a71
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agoAdd a few more QoS distribution tests 23/242523/1
Agnieszka Baumann [Fri, 21 Aug 2020 14:04:51 +0000 (16:04 +0200)]
Add a few more QoS distribution tests

Change-Id: I7ca564e2cffaa07b0375067c8fe36737f9b4beba

3 years agoqos: add pictures to the documentation 74/242174/3
Agnieszka Baumann [Fri, 21 Aug 2020 09:43:09 +0000 (11:43 +0200)]
qos: add pictures to the documentation

Change-Id: If7a3bbe653aec3570ecc0450f7841594de39bee0

3 years agoAdd a simple critical log integration test 49/242349/3
Mateusz Majewski [Tue, 25 Aug 2020 12:54:29 +0000 (14:54 +0200)]
Add a simple critical log integration test

Change-Id: If70b4d29efd36df435f0e91fffdc0cef17da2a08

3 years agoMove various dlog_logger functions to better places 41/242141/1
Mateusz Majewski [Mon, 24 Aug 2020 11:57:03 +0000 (13:57 +0200)]
Move various dlog_logger functions to better places

Change-Id: Ib9c4364a92f3ffdfc71f7e6b93c4aaa7ea8672ea

3 years agoSplit various writer related stuff to a separate file 34/242134/2
Mateusz Majewski [Mon, 24 Aug 2020 10:31:35 +0000 (12:31 +0200)]
Split various writer related stuff to a separate file

Change-Id: I973e057119535f7a57a16c469900a6480eab5c8c

3 years agoSplit various log_buffer related stuff to separate file 29/242129/2
Mateusz Majewski [Mon, 24 Aug 2020 09:48:23 +0000 (11:48 +0200)]
Split various log_buffer related stuff to separate file

Change-Id: If20af3642f882f1cd3357cb5a726d1d98db4232a

3 years agoSplit various dlogutil line parsing to a separate file 24/242124/2
Mateusz Majewski [Mon, 24 Aug 2020 09:04:14 +0000 (11:04 +0200)]
Split various dlogutil line parsing to a separate file

Change-Id: I633d126554f6a9d086abd7585f25f911085b5aea

3 years agoMetrics: test sorting comparator 42/242042/1
Agnieszka Baumann [Thu, 13 Aug 2020 08:48:09 +0000 (10:48 +0200)]
Metrics: test sorting comparator

Change-Id: I66ef7749dbd211fcc6e4951cef7cf3cdb66888a7

3 years agoFix various tiny dlog_logger issues 40/242040/1
Mateusz Majewski [Fri, 21 Aug 2020 12:27:39 +0000 (14:27 +0200)]
Fix various tiny dlog_logger issues

Change-Id: I66c5424aed49aa8a67fbbe4cdf17877ba4bd3e82

3 years agoMetrics sorting: prevent overflow and optimize 00/241900/3
Agnieszka Baumann [Thu, 20 Aug 2020 13:19:21 +0000 (15:19 +0200)]
Metrics sorting: prevent overflow and optimize

Change-Id: Idc7065e6224b77c6e9c37bc78852ec0107587323

3 years agoMove various socket related things to a separate file 38/242038/1
Mateusz Majewski [Fri, 21 Aug 2020 11:25:54 +0000 (13:25 +0200)]
Move various socket related things to a separate file

Change-Id: I37fc57b6ba380016621819bab7b9273ba2935191

3 years agoRemove an unnecessary signature 37/242037/1
Mateusz Majewski [Fri, 21 Aug 2020 11:25:34 +0000 (13:25 +0200)]
Remove an unnecessary signature

Change-Id: Ic0025f1ff1659b0c59c1a6789e9a6f906bc8aa39

3 years agoMove various reader_logger relate things to a separate file 01/242001/1
Mateusz Majewski [Fri, 21 Aug 2020 09:07:01 +0000 (11:07 +0200)]
Move various reader_logger relate things to a separate file

Change-Id: I80de86306dc906da8890554320c09d4ff746606b

3 years agoMove various reader related things to a new file 67/241967/1
Mateusz Majewski [Fri, 21 Aug 2020 06:28:03 +0000 (08:28 +0200)]
Move various reader related things to a new file

Change-Id: I40a4ca623294060d61b5d39da078d1f03ae44e3e

3 years agoAdd a missing pragma 66/241966/1
Mateusz Majewski [Fri, 21 Aug 2020 06:27:55 +0000 (08:27 +0200)]
Add a missing pragma

Change-Id: I184ed8c6a127743c3e06da59726dcecd70c4ff65

3 years agoMove some QoS related stuff to separate file 92/241892/2
Mateusz Majewski [Thu, 20 Aug 2020 12:50:48 +0000 (14:50 +0200)]
Move some QoS related stuff to separate file

Change-Id: Ic5ee82c0602d95297a4ab89b5b8a04d27a4454a0

3 years agoType correctness 10/239310/2
Agnieszka Baumann [Mon, 20 Jul 2020 11:09:28 +0000 (13:09 +0200)]
Type correctness

Change-Id: Iaa7dc84159e323aec2aa230b796de2ebb243946e

3 years agoPrevent `goto` from crossing initialisation 09/239309/4
Agnieszka Baumann [Mon, 20 Jul 2020 15:44:40 +0000 (17:44 +0200)]
Prevent `goto` from crossing initialisation

Change-Id: Ia7d14f3ae2b3884c5b77085b785202d70627cbdd

3 years agoMove some fd_entity related stuff to separate file 82/241882/2
Mateusz Majewski [Thu, 20 Aug 2020 11:07:32 +0000 (13:07 +0200)]
Move some fd_entity related stuff to separate file

Change-Id: I27b219d11d6f909ea49dd984df3a3de8420d4140

3 years agoFix a few signatures in a DLog unit test 81/241881/2
Mateusz Majewski [Thu, 20 Aug 2020 11:08:53 +0000 (13:08 +0200)]
Fix a few signatures in a DLog unit test

Change-Id: I38f5f962609ca971b47f09b2b07aaeb4f22be8c7

3 years agoMove some reader_pipe related stuff to separate file 60/241460/2
Mateusz Majewski [Thu, 20 Aug 2020 07:35:07 +0000 (09:35 +0200)]
Move some reader_pipe related stuff to separate file

Change-Id: Ie70ae0811e4eddd2d27eeb5855902d05f0b5fe00

3 years agoRemove some needless variables 59/241459/1
Mateusz Majewski [Thu, 20 Aug 2020 07:04:49 +0000 (09:04 +0200)]
Remove some needless variables

Change-Id: Iafd8493cc32b5184713b332c0f96284dc45bfc39

3 years agoRelease 6.0.16 89/241389/1 accepted/tizen/unified/20200820.133531 submit/tizen/20200819.185951
Michal Bloch [Wed, 19 Aug 2020 17:13:04 +0000 (19:13 +0200)]
Release 6.0.16

This release brings further improvements, including
performance, to QoS-adjacent mechanisms.

Change-Id: I3514c36944c3e1d0820977d9dc83314601e28238
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agoReuse current timestamp in sort_vector_time_span 75/241375/3
Mateusz Majewski [Wed, 19 Aug 2020 11:02:55 +0000 (13:02 +0200)]
Reuse current timestamp in sort_vector_time_span

For performance. One syscall less per log is good!

Change-Id: I7cd41affc5367e825c52cdf70fdaf83c1dc521f1

3 years agoDo not call clock_gettime() if dedup is not configured 32/241332/8
Hyotaek Shim [Wed, 19 Aug 2020 08:39:51 +0000 (17:39 +0900)]
Do not call clock_gettime() if dedup is not configured

Change-Id: I04982e00fc15b09c7c2a826ec001cd18ba934227
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
3 years agoAdd PID-limit exceeded message 37/241337/2
Mateusz Majewski [Wed, 19 Aug 2020 08:48:52 +0000 (10:48 +0200)]
Add PID-limit exceeded message

Change-Id: I06ece67a40a38a2128eb7e3ddd3f4f536c48fac2

3 years agoImprove __log_limiter_pass_log interface 36/241336/2
Mateusz Majewski [Wed, 19 Aug 2020 07:55:06 +0000 (09:55 +0200)]
Improve __log_limiter_pass_log interface

Change-Id: Ie47e84c25a5ed615e52a69e51bde2018d987f06d

3 years agodlog_logger: disambiguate `log_storage` 08/239308/2
Agnieszka Baumann [Mon, 20 Jul 2020 09:31:45 +0000 (11:31 +0200)]
dlog_logger: disambiguate `log_storage`

No longer both a type name and a member name.

Change-Id: Ie073cb9295732a75b36a79727239d2f32723f278

3 years agoImprove libdlog Android Logger backend initialization 61/241361/1
Mateusz Majewski [Wed, 19 Aug 2020 10:28:07 +0000 (12:28 +0200)]
Improve libdlog Android Logger backend initialization

Exactly same thing as with the pipe backend few patches ago.

Change-Id: Ic9ca9068904206918e324376d53cf6ca80ed7b78

3 years agoEnable QoS test in the logger backend 99/241199/1 accepted/tizen/unified/20200820.034649 submit/tizen/20200819.013928
Mateusz Majewski [Tue, 18 Aug 2020 12:06:37 +0000 (14:06 +0200)]
Enable QoS test in the logger backend

This is aggressively hacky and I don't like it, but it's good enough for
now.

Change-Id: Iee6c3c79ec6a1af2d8073662b955b86a5ad9b0fc

3 years agoMake the QoS test slightly more consistent 67/241167/1
Mateusz Majewski [Tue, 18 Aug 2020 07:18:02 +0000 (09:18 +0200)]
Make the QoS test slightly more consistent

Change-Id: I5a6ec0ec19dcf24260ae054322bf6d6046298883

3 years agoFix the QoS test 66/241166/1
Mateusz Majewski [Tue, 18 Aug 2020 05:37:44 +0000 (07:37 +0200)]
Fix the QoS test

It seems that in the merged version there are a few lines missing.
Oops!

Change-Id: I1958266839242ef98d05030566d66ed0b2525099

3 years agoAdd quick mode to the integration tests 24/241124/3
Mateusz Majewski [Mon, 17 Aug 2020 11:01:04 +0000 (13:01 +0200)]
Add quick mode to the integration tests

"Ok, here we go. Focus. Speed. I am speed. 1 winner. 42 losers. I eat
losers for breakfast. Breakfast? Ah, maybe I should've had breakfast?
Uh, brekkie could be good for me. No no no, stay focused. Speed. I'm
faster than fast, quicker than quick! I am Lightning."
-- intro of Cars by Pixar Animation Studios

Change-Id: If82241fa670c53882735aff1daaa373c81ae0dac

3 years agoOnly write missed AL logs on the first service start 76/240976/7
Mateusz Majewski [Wed, 12 Aug 2020 12:20:06 +0000 (14:20 +0200)]
Only write missed AL logs on the first service start

The AL backend is based on the kernel devices, which may be written to
at any time. dlog_logger used to read the whole contents of the device
on its start, which is the reasonable thing to do (we don't want to miss
any logs) but bad for various reasons (for example, the same logs are
written to the persistent logs file many times when the service is
restarted). This patch makes it so that the device is only read in its
entirety on the first start of the service after reboot; on every other
start, all the logs existing in the device at the moment of the service
start are skipped.

Change-Id: I1eefd62191d66201ca74919d32b27aecbb1f621b

3 years agoAdd a NOP QoS test 17/241117/2
Mateusz Majewski [Mon, 17 Aug 2020 08:05:39 +0000 (10:05 +0200)]
Add a NOP QoS test

Change-Id: I2e4eea1c1fe50affe4b0e9b39ac104675428ecfa

3 years agoImprove libdlog pipe backend initialization 21/241121/2
Mateusz Majewski [Mon, 17 Aug 2020 09:46:42 +0000 (11:46 +0200)]
Improve libdlog pipe backend initialization

Change-Id: Ifaa13d33f3747b6176ef41308c64c1c51739c91d

3 years agoMake logctl argument parsing slightly more understandable 20/241120/1
Mateusz Majewski [Mon, 17 Aug 2020 09:18:51 +0000 (11:18 +0200)]
Make logctl argument parsing slightly more understandable

Change-Id: I17c6cde9e4888465b51f4aeece66ff1b5bba4931

3 years agoMove some functions to backend_androidlogger.c 98/240998/4
Mateusz Majewski [Thu, 13 Aug 2020 10:48:30 +0000 (12:48 +0200)]
Move some functions to backend_androidlogger.c

Change-Id: I6043e488277ddcf382a7743a0c8579a9efd0e395

3 years agoImprove logctl const-correctness 09/241009/3
Mateusz Majewski [Thu, 13 Aug 2020 12:00:17 +0000 (14:00 +0200)]
Improve logctl const-correctness

Change-Id: I19579e4960e60de146ccce6e565a881b53f2fe4b

3 years agoRemove unused logfile_callback 00/241000/1
Agnieszka Baumann [Thu, 13 Aug 2020 07:46:03 +0000 (09:46 +0200)]
Remove unused logfile_callback

Change-Id: I4f42d7e29fd9be4be5eb7ac192a2b002796a478f

3 years agoRelease 6.0.15 04/240904/1 accepted/tizen/unified/20200813.122630 submit/tizen/20200812.191454
Michal Bloch [Wed, 12 Aug 2020 17:19:07 +0000 (19:19 +0200)]
Release 6.0.15

This release brings further improvements to QoS

Change-Id: I5ff35143f8f18b26b4789789c119adc1ada042e2
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agoAdd metrics.c test 02/240902/2
Agnieszka Baumann [Fri, 7 Aug 2020 07:49:03 +0000 (09:49 +0200)]
Add metrics.c test

Change-Id: I1bd23d2b0dfe9ed834872d6e9c7c61ba849030b9

3 years agoBuffer QoS limit writes 61/240861/4
Mateusz Majewski [Wed, 12 Aug 2020 06:55:56 +0000 (08:55 +0200)]
Buffer QoS limit writes

Change-Id: Ibcdc53b2255a5bc59ccaa6070a445cfa0b40663e

3 years agoFix an itty-bitty QoS-related memory leak 95/240895/3
Mateusz Majewski [Wed, 12 Aug 2020 12:21:04 +0000 (14:21 +0200)]
Fix an itty-bitty QoS-related memory leak

Change-Id: I5b5a487bbdc186fc63286f70df4b2ac0e28af622

3 years agoQoS: add some new distributions, change default 16/240816/2
Michal Bloch [Tue, 11 Aug 2020 15:14:39 +0000 (17:14 +0200)]
QoS: add some new distributions, change default

'equal_multi' is now the default.

Change-Id: If7e4ef33aba2982db023629590c901af5b4c3309
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agoQoS: rename 'proportional' to 'proportional_raw' 15/240815/2
Michal Bloch [Tue, 11 Aug 2020 14:50:58 +0000 (16:50 +0200)]
QoS: rename 'proportional' to 'proportional_raw'

In anticipation of the other proportional-adjacent modes.

Change-Id: I9ec9077758160a4dce28f1e0854db117ee820e82

3 years agoIntroduce a minor math helper 14/240814/2
Michal Bloch [Tue, 11 Aug 2020 14:44:10 +0000 (16:44 +0200)]
Introduce a minor math helper

Change-Id: Ie4da8c6a962314a11e8ace65cde8f99105f9524a
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agoQoS: add distribution unit tests 13/240813/2
Michal Bloch [Tue, 11 Aug 2020 13:22:59 +0000 (15:22 +0200)]
QoS: add distribution unit tests

Change-Id: I68865ce93bc6435c33ee4774037d4db6eb1af688
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agoQoS: split off distributions to a separate file 12/240812/2
Michal Bloch [Tue, 11 Aug 2020 12:59:11 +0000 (14:59 +0200)]
QoS: split off distributions to a separate file

Change-Id: I2f708535940b355e6396eb28b5523752ce8c8872
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agoQoS: move file handling out of distribution funcs 11/240811/2
Michal Bloch [Tue, 11 Aug 2020 12:16:30 +0000 (14:16 +0200)]
QoS: move file handling out of distribution funcs

Will allow easier testing for the functions.

Change-Id: Idacc1b8863eb76d87b4b58f8824ce8bcf53cf808
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
3 years agoAdd a missing check to libdlogutil 02/240802/3
Mateusz Majewski [Tue, 11 Aug 2020 13:16:34 +0000 (15:16 +0200)]
Add a missing check to libdlogutil

Change-Id: Iad79fd6df59cb6c585f45febc23a1263df055111

3 years agoClarify types 80/240780/1
Mateusz Majewski [Tue, 11 Aug 2020 07:50:58 +0000 (09:50 +0200)]
Clarify types

Change-Id: Ie8afc3a9f087b124f5d105a7d0b60fea8587c81d