Commit Graph

7 Commits

Author SHA1 Message Date
Ioannis Ilkos dab3944256 Change lmkd defaults for statsd events
LMK events are an important platform memory monitoring signal. Enable
them by default.
Changes:
- Compile lmkd with statsd by default
- Signal lmkd by default

Test: build, statsd cts
Bug: 177985094
Change-Id: I070660767db6e3bc8926ff82b64b99c7ee9a0108
2021-01-20 20:08:19 +00:00
Suren Baghdasaryan 3cc1f13044 lmkd: report kill reason, and meminfo details to statsd for each kill
Information like free memory and swap as well as kill reason would be
useful for understanding regressions in the number of lmk kills in the
field.

Bug: 168117803
Change-Id: Ic46aed3c85b880b32ac5ad61b55f90e0d33517c7
Test: statsd_testdrive 51, load with lmk_unit_test
2020-09-11 14:24:23 +01:00
Ioannis Ilkos 279268a07f Emit swap size in the killed process' statsd atoms
Changes:
- We are already reading /proc/pid/status to resolve the tgid. While we
are at it, also parse RSS and swap values.
- Use the RSS and swap values for non memcg builds when creating the
statsd outputs
- Given we already read RSS, remove the separate read of /proc/pid/statm
that used to get tasksize.

Bug: 163116785
Test: manual, out/host/linux-x86/bin/statsd_testdrive 51
Change-Id: I9d98b9ffe8be0b014bb09174ec9532382cae1f38
2020-08-12 20:24:56 +01:00
Tom Cherry 24b31dced5 Include what you use: <stdio.h> and <unistd.h>
These were transitively included, but no longer are, so they must be
explicitly included.

Exempt-From-Owner-Approval: Janitorial
Test: build
Change-Id: Ic0896401d148b22f33d6edb1fac377208e437565
2020-04-13 15:21:09 -07:00
Tom Cherry 0ebe6800bc Include what you use: <fcntl.h>
This was transitively included, but no longer is, so it must be
explicitly included.

Exempt-From-Owner-Approval: Janitorial
Test: build
Change-Id: I89657fa33df4bc0f92685012b3ab9b24d55d1619
2020-04-13 11:10:12 -07:00
Muhammad Qureshi ed8fe8465a Use generated code for logging events to statsd
Use the autogenerated libstatslog_lmkd to send events to statsd

The logging schema for statsd is changing as part of statsd becoming
a Mainline module in R. The autogenerated code will handle the schema
change.

Bug: 145887874
Test: m -j
Test: atest android.cts.statsd.atom.UidAtomTests#testLmkKillOccurred

Change-Id: Ibae4cd822807369a799d5c1f6a9c51272e38a074
2020-01-13 12:16:47 -08:00
Tom Cherry 43f3d2b190 Build lmkd as C++
Bug: 145669697
Test: build
Change-Id: I4fb2a9a900c8a6915ee84cc3d82434596301b24b
2019-12-13 08:40:30 -08:00