Commit graph

6 commits

Author SHA1 Message Date
Suren Baghdasaryan
b72c66515b lmkd: Isolate statslog related code from lmkd code
Move statsd related code out of lmkd.c to minimize ifdefs sprinkled around
the code and make it more maintainable.

Bug: 74119935
Test: lmkd_unit_test
Change-Id: Ib22f90fd380b9a31e09ab18ef16787bc07415ddf
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-10-01 16:36:08 +00:00
Jim Blackler
d2da814d1f lmkd: Maintain pid to taskname mapping to amend kill reports.
Required because the kernel cannot always get the taskname safely at
the time the process is killed (due to competition for mm->mmap_sem).

Test: manually
Bug: 130017100
Signed-off-by: Jim Blackler <jimblackler@google.com>
Change-Id: I27a2c3340da321570f0832d58fe9e79ca031620b
2019-09-26 16:27:03 -07:00
Suren Baghdasaryan
ec5e4c6eb1 Add min_score_adj into LmkKillOccurred event
Log min_score_adj when lmkd kills a process to determine the oom_score
levels that lmkd considers during the kill.

Bug: 123024834
Change-Id: I986ae8f2808199b1654bc8d2a32dd88046c79aa3
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-03-05 09:51:06 +00:00
Jim Blackler
1417cdbddb Add start time to LmkKillOccurred
This is to measure an application's behavior with respect to being LMKed
(the longer an app lives before being LMKed, the better).

Bug: 119854389
Test: Manual
Change-Id: I4ef6433391c8758626334731d2b5de038e4468ae
Merged-In: I4ef6433391c8758626334731d2b5de038e4468ae
(cherry picked from I4ef6433391c8758626334731d2b5de038e4468ae)
2019-01-04 11:36:54 +00:00
Yao Chen
389aee1117 Fix the stats log in lmkd
1. let logs be written to statsd directly like all other stats logs.
   + stats log should not write to logd anymore(b/78239479)
2. fixed the log format
   + need to embed the elapsed real time in the log
3. fixed the log context reuse problem
   +reset the log context buffer and internal state before reuse

Bug: 78603347
Bug: 78239479

Test: tested with alloc_stress, and saw logs written to statsd

performance measurement (memory & cpu):
https://paste.googleplex.com/5508158646648832

Change-Id: I345f0eace8ba1687ff480fb88e9abba1d8533f76
2018-05-03 16:04:27 -07:00
Rajeev Kumar
f0216a8ac5 Functions to log stats log from LMKD.
Bug: 72177881
Test: Manual
Change-Id: I0f618013e242fabae785b62eb39f9bfbcaac16da
2018-01-29 15:18:04 -08:00