Commit Graph

9 Commits

Author SHA1 Message Date
Suren Baghdasaryan 014dd7156e lmkd: Log psi averages in killinfo reports
Add psi memory, io and cpu 10sec averages into killinfo reports.

Bug: 205182133
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: Ifbcf47cab291fb20dbf0b5d32f1965f4e6462b49
2022-02-21 20:30:50 -08:00
Suren Baghdasaryan 39b54809fb lmkd: Add thrashing and max_thrashing into killinfo reports
Due to the increased importance of thrashing limits, include current and
max thrashing levels into killinfo reports.

Bug: 195979894
Test: lmkd_unit_test
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I36f947e45e03a4d845d18881e137e4b242aacb65
2021-08-09 15:10:46 -07:00
Suren Baghdasaryan 940e7cf8bd lmkd: Include total GPU memory usage in killinfo reports
/sys/fs/bpf/map_gpu_mem_gpu_mem_total_map BPF map exposes total GPU
allocations size. Include this value into killinfo reports to track GPU
allocation size at the time of the kill.

Bug: 189366037
Test: lmkd_unit_test
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: Icc1ed8ab2593530fa293ff9c82f6c8dc400485f5
2021-06-03 15:56:52 -07:00
Ioannis Ilkos 282437fbbe Reorder swap field in killinfo
Some tools might parse killinfo entries based on the field order. Move
the newly added swap field to the end to ensure compatibility.

Test: build
Change-Id: Id6dad850beba6835f061da95e84190d00a1b26a0
2021-03-04 17:50:05 +00:00
Ioannis Ilkos 4884890305 Log killed process swap size
We already log the rss size for the process. Given lmkd strategies also consider low swap, it will be beneficial to record the swap size too.

Test: build, manual test
Change-Id: I923f733f7a3aa77fc5968827693b0fc085819174
2021-02-26 17:05:35 +00:00
Suren Baghdasaryan d7b4fcb8a5 lmkd: Add lmkd wakeup information into killinfo logs
Oftentimes while investigating bugreports it's unclear whether lmkd
was active between kills. To provide visibility into lmkd activity
adding the following fields into killinfo reports:
MsSinceEvent - number of msecs since the last PSI/vmpressure event
MsSincePrevWakeup - number of msecs since the previous wakeup
WakeupsSinceEvent - number of wakeups since the last PSI/vmpressure
event
SkippedWakeups - number of wakeups that were skipped due to an
incomplete kill

Bug: 162034541
Test: lmkd_unit_test
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I0356c27515132ff0dd309b59a8bf907acbd67cd8
2020-07-24 19:31:03 +00:00
Suren Baghdasaryan 12cacaedc0 lmkd: Change meminfo_log into killinfo_log and log additional fields
meminfo_log is used to log the state of the memory at the time of a kill.
Instead of reporting kill information and meminfo separately let's combine
them into one killinfo_log report. While normal logs can be trimmed by
chatty, meminfo_log uses a separate log context which gives it a better
chance of survival. As a result we will have all the information relevant
to a kill in one report which has higher chance of surviving chatty.

Bug: 74119935
Test: lmkd_unit_test
Change-Id: I83a9c12d538e1fb107721b04fdafc3c6c0d83b60
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-10-01 23:26:56 +00:00
Suren Baghdasaryan 8a3e0c15c1 lmkd: Fix meminfo logs missing SwapTotal and having wrong field order
Previous change If154dc364711bf7c86f32e24ddcd10be359386de called
"lmkd: Do not downgrade/ignore events when swap is full" added SwapTotal
into meminfo structure without adding the field into events.logtag file.
This results in logs which missing field and all fields starting with
"SwapFree" get reordered as a result. Fix this by adding the missing field
into events.logtag.

Bug: 129274901
Test: Confirm correct information in the logcat
Change-Id: Ia4de3790a7e9d49a0e4cba8b3161a715eaf6532e
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-03-25 11:04:11 -07:00
Suren Baghdasaryan 08bfa985d1 lmkd: Add meminfo logging after each kill for easy troubleshooting
While troubleshooting memory pressure related issues it's hard to get a
good view of the memory state when lmkd kill happens. Logging relevant
information from /proc/meminfo file that was used to make a kill decision
is very helpful for further analysis. To do this efficiently we are using
Android Logger event library functions and log the data used for kill
decision after the kill signal was issued.

Test: Run lmkd_unit_test and logcat -b events -v descriptive
Change-Id: Id5de41b9d91a04dd5d3eb9b85d4e1babe9755628
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2018-08-10 14:21:31 -07:00