Commit graph

7 commits

Author SHA1 Message Date
Tom Cherry
b2a08d81aa lmkd: add missing libcutils library to test
lmkd's test depends on the socket_local_client() function from
libcutils, but since liblog also exposes this symbol weakly, that is
the symbol that gets used instead of the intended libcutil's copy of
the symbol.

Test: build
Change-Id: I294fa157a7f50881bf6360922419976eb1ee3ac7
2019-01-15 14:14:20 -08:00
Suren Baghdasaryan
3693441d9b lmkd: rate-limit and cleanup failed kill reports
Excessive number of failed kill reports when lmkd can't find an eligible
process to kill or frees not enough memory pollutes logs and bugreports.
Cleanup kill reports to remove duplicate information and rate limit failed
kill attempts at 1 report per sec. The number of suppressed failed kills
will be reported in the next lmkd report.

Bug: 113864581
Test: Verified using lmkd_unit_test
Change-Id: I67fa1fec97613f136c7582115edcbc56b1503c9c
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2018-09-06 01:59:49 +00:00
Mark Salyzyn
aa0b84afca Merge "lmkd: test: access /sys/module/lowmemorykiller/ as u:r:shell:s0" am: b69cb7071d
am: 4f7d8851a5

Change-Id: I1ef7aab68bfb5a11891ef4777f6dc46774120a21
2018-04-05 19:45:16 -07:00
Mark Salyzyn
ce32539cf3 lmkd: test: access /sys/module/lowmemorykiller/ as u:r:shell:s0
lmkd_unit_test gets an selinux violation when run unprivileged:

lmkd_unit_test: type=1400 audit(0.0:???): avc: denied { search } for
    name="lowmemorykiller" dev="sysfs" ino=??? scontext=u:r:shell:s0
    tcontext=u:object_r:sysfs_lowmemorykiller:s0 tclass=dir
    permissive=0

resulting in log noise.  Check for INKERNEL_MINFREE_PATH existence
after known to be escalated as root user to suppress noise.

Test: lmkd_unit_test as unprivileged user, there should be no audits.
Change-Id: Ia5c7824e7070c98ee6eea20ca53097e4e56d61b6
2018-04-03 14:41:11 +00:00
Suren Baghdasaryan
b453066e20 lmkd: Fix lmkd-test to work with relative paths
This change allows lmkd-test to work correctly when it's started
using absolute as well as relative path.

Change-Id: Ida58d13d66a224119a363f59cc59289f0167d3c9
2018-03-13 12:34:18 -07:00
Suren Baghdasaryan
e708b6fc68 lmkd: Implement lmkd-test
(cherry pick from commit 5f5b30e58b)

lmkd-test executes alloc-stress native application and monitors kernel
logs for OOM kills.

Bug: 63631020

Change-Id: Ia9441cc5f8e283131f0bc839cb808a911bcdb168
Merged-In: Ia9441cc5f8e283131f0bc839cb808a911bcdb168
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2018-03-09 11:19:24 -08:00
Suren Baghdasaryan
5f5b30e58b lmkd: Implement lmkd-test
lmkd-test executes alloc-stress native application and monitors kernel
logs for OOM kills.

Bug: 63631020

Change-Id: Ia9441cc5f8e283131f0bc839cb808a911bcdb168
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2018-01-31 18:11:38 +00:00