Commit Graph

1448 Commits

Author SHA1 Message Date
Bart Van Assche 6925bedfa5 statslog: Make this library compatible with the cgroups v2 hierarchy am: 16ba8bc773 am: d3401c8ae9 am: aac55955a2 am: 51feb261e5 am: 77f29486aa
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1975449

Change-Id: Icdd093adfb36cd2e3cbcd42878ff8e681b6264c8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-25 18:10:04 +00:00
Bart Van Assche 77f29486aa statslog: Make this library compatible with the cgroups v2 hierarchy am: 16ba8bc773 am: d3401c8ae9 am: aac55955a2 am: 51feb261e5
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1975449

Change-Id: I4e9e7b9ee5379f6a6438af71527ff9fae07278ae
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-25 17:54:36 +00:00
Bart Van Assche 413d7a6872 statslog: Make this library compatible with the cgroups v2 hierarchy am: 16ba8bc773 am: d3401c8ae9 am: aac55955a2 am: 51feb261e5
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1975449

Change-Id: Ia27d8b95d8c0d05ab873abe90b3a670944ffada9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-25 17:54:22 +00:00
Bart Van Assche 51feb261e5 statslog: Make this library compatible with the cgroups v2 hierarchy am: 16ba8bc773 am: d3401c8ae9 am: aac55955a2
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1975449

Change-Id: I32ab72a005ff992beb9b1daf3b4c07164deea799
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-25 17:38:23 +00:00
Bart Van Assche aac55955a2 statslog: Make this library compatible with the cgroups v2 hierarchy am: 16ba8bc773 am: d3401c8ae9
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1975449

Change-Id: Ic144cf22d834ef77774a2c6f7287d031cf53a993
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-25 17:17:08 +00:00
Bart Van Assche d3401c8ae9 statslog: Make this library compatible with the cgroups v2 hierarchy am: 16ba8bc773
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1975449

Change-Id: I7594f669aa8902b6b066a4a11689faadf08911d4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-25 16:59:36 +00:00
Bart Van Assche b4d26bb22b lmkd: Look up cgroup attribute paths instead of hardcoding these
Retrieve cgroup attribute paths from task_profiles.json instead of
hardcoding these paths.

Bug: 213617178
Test: Tested lmkd in Cuttlefish.
Change-Id: I03f40ac8ccd4635f21432214e1acf997c505d1e9
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-03-24 15:58:02 -07:00
Bart Van Assche 16ba8bc773 statslog: Make this library compatible with the cgroups v2 hierarchy
Call memcg_apps_dir() instead of hard-coding the top-level directory of
the memcg controller.

Bug: 213617178
Test: Verified lmkd operation inside Cuttlefish.
Change-Id: I659610ebdabe3b69b0b1097aa5cf248d6f3273c5
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-03-24 15:58:00 -07:00
Bart Van Assche 6b741fe9cc liblmkd_utils: Use libprocessgroup to create cgroups am: 911f106a4a am: f0544971d4 am: 84dbabc1b2 am: e93c0f63f7 am: 6774c81652
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/2034587

Change-Id: I7f511cc100688b63090a136a64d93c6bbab87da8
2022-03-22 21:48:59 +00:00
Bart Van Assche 6774c81652 liblmkd_utils: Use libprocessgroup to create cgroups am: 911f106a4a am: f0544971d4 am: 84dbabc1b2 am: e93c0f63f7
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/2034587

Change-Id: I23bf6c1cee77729fd043f811fd79be5ba470e9d5
2022-03-22 21:16:22 +00:00
Bart Van Assche ac4c29ccd0 liblmkd_utils: Use libprocessgroup to create cgroups am: 911f106a4a am: f0544971d4 am: 84dbabc1b2 am: e93c0f63f7
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/2034587

Change-Id: I29a594f5572f2c60c773302ace9610a75ed3a7cd
2022-03-22 21:16:15 +00:00
Bart Van Assche e93c0f63f7 liblmkd_utils: Use libprocessgroup to create cgroups am: 911f106a4a am: f0544971d4 am: 84dbabc1b2
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/2034587

Change-Id: Id2891d0b356b986ddaa846e53495a939eb6daaba
2022-03-22 20:38:55 +00:00
Bart Van Assche 84dbabc1b2 liblmkd_utils: Use libprocessgroup to create cgroups am: 911f106a4a am: f0544971d4
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/2034587

Change-Id: I02fe722830a1b5ef282262ac0a2799fbf0f483fe
2022-03-22 20:17:13 +00:00
Bart Van Assche f0544971d4 liblmkd_utils: Use libprocessgroup to create cgroups am: 911f106a4a
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/2034587

Change-Id: I682dfc8e3b463bd5203d5102ec37c2af5422e64f
2022-03-22 20:02:44 +00:00
Bart Van Assche 911f106a4a liblmkd_utils: Use libprocessgroup to create cgroups
Bug: 213617178
Test: Ran lmkd_tests inside Cuttlefish
Change-Id: Ic34b731dfe5d6b1e90d258c2b0af538a216b054a
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-03-21 15:57:37 -07:00
Presubmit Automerger Backend b31f02b28f [automerger skipped] [automerged blank] lmkd: Log psi averages in killinfo reports 2p: 0e0da56b4f am: 1bb11f2730 -s ours am: e7ba6bbd71 -s ours am: 6616cd05fe -s ours
am skip reason: Merged-In Ifbcf47cab291fb20dbf0b5d32f1965f4e6462b49 with SHA-1 014dd7156e is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/memory/lmkd/+/16998403

Change-Id: I0bd24b27736123b1aca0a39aa66272916c8f7ca8
2022-02-25 02:36:19 +00:00
Presubmit Automerger Backend 6616cd05fe [automerger skipped] [automerged blank] lmkd: Log psi averages in killinfo reports 2p: 0e0da56b4f am: 1bb11f2730 -s ours am: e7ba6bbd71 -s ours
am skip reason: Merged-In Ifbcf47cab291fb20dbf0b5d32f1965f4e6462b49 with SHA-1 014dd7156e is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/memory/lmkd/+/16998403

Change-Id: Ieb7ded7e87367494c630725056403a4f59a9e4a4
2022-02-25 00:41:02 +00:00
Presubmit Automerger Backend e7ba6bbd71 [automerger skipped] [automerged blank] lmkd: Log psi averages in killinfo reports 2p: 0e0da56b4f am: 1bb11f2730 -s ours
am skip reason: Merged-In Ifbcf47cab291fb20dbf0b5d32f1965f4e6462b49 with SHA-1 014dd7156e is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/memory/lmkd/+/16998403

Change-Id: I92056854199896a9f6a65780348851f51a36cab7
2022-02-25 00:16:53 +00:00
Presubmit Automerger Backend 1bb11f2730 [automerged blank] lmkd: Log psi averages in killinfo reports 2p: 0e0da56b4f
Blank merge reason: Change-Id Ifbcf47cab291fb20dbf0b5d32f1965f4e6462b49 with SHA-1 014dd7156e is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/memory/lmkd/+/16998403

Bug: 205182133
Change-Id: I117fdb2489a3614d2028cd683b0235c2ab7531f1
Merged-In: Ifbcf47cab291fb20dbf0b5d32f1965f4e6462b49
2022-02-24 04:01:06 +00:00
Suren Baghdasaryan 0e0da56b4f 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>
Signed-off-by: Martin Liu <liumartin@google.com>
Change-Id: Ifbcf47cab291fb20dbf0b5d32f1965f4e6462b49
Merged-In: Ifbcf47cab291fb20dbf0b5d32f1965f4e6462b49
2022-02-24 12:00:44 +08:00
Bart Van Assche 945edaff32 lmkd: Fix a potential buffer overflow am: 5ebc4e8f51 am: 75a98b56ab am: bcc461658b am: b893101ac1 am: 4fe00c065e
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1972105

Change-Id: I1b9e5bab3a54adb08797e7992264da3da8f5c7f5
2022-02-23 21:11:26 +00:00
Bart Van Assche c4b6d2bb8d lmkd: Use std::array<> and remove the ARRAY_SIZE() definition am: 545067957c am: f9489027a1 am: 350a02e15d am: a02c2dc079 am: 7ba01bd357
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1972104

Change-Id: I4e40b1bcbd3e170f34a855ebf2b873b261b8e3a2
2022-02-23 21:11:25 +00:00
Bart Van Assche 17d5071db5 lmkd: Use std::min() and std::max() instead of defining min() and max() macros am: 80a3dba57a am: c53ab08bf5 am: 20f9f7e0b7 am: 65b793bb9a am: cd68af3c9f
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1972103

Change-Id: Ib023c0a12cf68e6c679ed8fb4231ff261d40b03b
2022-02-23 21:11:23 +00:00
Bart Van Assche 2ba8569d10 lmkd: Fix a potential buffer overflow am: 5ebc4e8f51 am: 75a98b56ab am: bcc461658b am: b893101ac1
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1972105

Change-Id: I4121ef4d38d76532f8cb515afdd781046481823d
2022-02-23 20:48:05 +00:00
Bart Van Assche b78bb66077 lmkd: Use std::array<> and remove the ARRAY_SIZE() definition am: 545067957c am: f9489027a1 am: 350a02e15d am: a02c2dc079
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1972104

Change-Id: I9cfde5c013ee1518a77679a0de8baa6c8ff28dad
2022-02-23 20:48:03 +00:00
Bart Van Assche 61823e5c99 lmkd: Use std::min() and std::max() instead of defining min() and max() macros am: 80a3dba57a am: c53ab08bf5 am: 20f9f7e0b7 am: 65b793bb9a
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1972103

Change-Id: If51eb2b10db6b788fd6ce511b81a918dacef04c1
2022-02-23 20:48:02 +00:00
Bart Van Assche 4fe00c065e lmkd: Fix a potential buffer overflow am: 5ebc4e8f51 am: 75a98b56ab am: bcc461658b am: b893101ac1
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1972105

Change-Id: I567efba7b052412d1eecb3e77a53ceeea41fc7c8
2022-02-23 20:21:50 +00:00
Bart Van Assche 7ba01bd357 lmkd: Use std::array<> and remove the ARRAY_SIZE() definition am: 545067957c am: f9489027a1 am: 350a02e15d am: a02c2dc079
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1972104

Change-Id: Idac0ba80ee2e729a66810191c718a445c29dc9b0
2022-02-23 20:21:49 +00:00
Bart Van Assche cd68af3c9f lmkd: Use std::min() and std::max() instead of defining min() and max() macros am: 80a3dba57a am: c53ab08bf5 am: 20f9f7e0b7 am: 65b793bb9a
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1972103

Change-Id: I5eb26426674e154eb725740e28c28c59539286ea
2022-02-23 20:21:48 +00:00
Bart Van Assche b893101ac1 lmkd: Fix a potential buffer overflow am: 5ebc4e8f51 am: 75a98b56ab am: bcc461658b
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1972105

Change-Id: I986dbc2faa98ffa2dd3a849b25fcfd6c955ea56b
2022-02-23 19:45:15 +00:00
Bart Van Assche a02c2dc079 lmkd: Use std::array<> and remove the ARRAY_SIZE() definition am: 545067957c am: f9489027a1 am: 350a02e15d
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1972104

Change-Id: Ibff73f0b29a47624a374d46b92e98124a3d49f19
2022-02-23 19:45:13 +00:00
Bart Van Assche 65b793bb9a lmkd: Use std::min() and std::max() instead of defining min() and max() macros am: 80a3dba57a am: c53ab08bf5 am: 20f9f7e0b7
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1972103

Change-Id: I2de7ccd6d194fa959140a29f4b9963707aa37555
2022-02-23 19:45:12 +00:00
Bart Van Assche bcc461658b lmkd: Fix a potential buffer overflow am: 5ebc4e8f51 am: 75a98b56ab
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1972105

Change-Id: I4778df4e1f58a665beb519f16287e4b84a0849e2
2022-02-23 19:21:31 +00:00
Bart Van Assche 350a02e15d lmkd: Use std::array<> and remove the ARRAY_SIZE() definition am: 545067957c am: f9489027a1
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1972104

Change-Id: If6a3e2e00794ec8df993a6bead87d564a2eea047
2022-02-23 19:21:30 +00:00
Bart Van Assche 20f9f7e0b7 lmkd: Use std::min() and std::max() instead of defining min() and max() macros am: 80a3dba57a am: c53ab08bf5
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1972103

Change-Id: I56abe6f693c848eeae3acc3a39f723746f92b30a
2022-02-23 19:21:29 +00:00
Bart Van Assche 75a98b56ab lmkd: Fix a potential buffer overflow am: 5ebc4e8f51
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1972105

Change-Id: I4dca955fd118a16fc3bd1a37beeb8fe317bcbcc2
2022-02-23 18:55:06 +00:00
Bart Van Assche f9489027a1 lmkd: Use std::array<> and remove the ARRAY_SIZE() definition am: 545067957c
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1972104

Change-Id: Icb6ad2718ff8170bc457268688b9ae94e53a4c1f
2022-02-23 18:55:05 +00:00
Bart Van Assche c53ab08bf5 lmkd: Use std::min() and std::max() instead of defining min() and max() macros am: 80a3dba57a
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1972103

Change-Id: Ifd1a8218fd0d6fbb4bbca9b0cc65b39c8b0e7226
2022-02-23 18:55:04 +00:00
Suren Baghdasaryan 57c84b1272 [automerger skipped] lmkd: Allow killing perceptible apps when recorded stall is too high am: 65e7d14e2a -s ours am: 77d001ed58 -s ours am: 7c4c36107f -s ours am: a4feb98740 -s ours
am skip reason: Merged-In I9713e30d82641d86d1b7edb5e1ba2971b935c898 with SHA-1 5ae47a9563 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/memory/lmkd/+/16853454

Change-Id: I5d4b0a8c86c6e795d9135aeed4a03ec1b4759043
2022-02-23 18:10:04 +00:00
Suren Baghdasaryan 579e923a34 [automerger skipped] lmkd: Allow killing perceptible apps when recorded stall is too high am: 65e7d14e2a -s ours am: 77d001ed58 -s ours am: 7c4c36107f -s ours
am skip reason: Merged-In I9713e30d82641d86d1b7edb5e1ba2971b935c898 with SHA-1 5ae47a9563 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/memory/lmkd/+/16853454

Change-Id: I4407201acba592bb056c1df0ef65bcede8d55b07
2022-02-23 17:20:29 +00:00
Suren Baghdasaryan a4feb98740 [automerger skipped] lmkd: Allow killing perceptible apps when recorded stall is too high am: 65e7d14e2a -s ours am: 77d001ed58 -s ours am: 7c4c36107f -s ours
am skip reason: Merged-In I9713e30d82641d86d1b7edb5e1ba2971b935c898 with SHA-1 5ae47a9563 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/memory/lmkd/+/16853454

Change-Id: I0c1508341ad1a1ed0376b817184b3fa72b1878a6
2022-02-23 17:19:08 +00:00
Bart Van Assche 5ebc4e8f51 lmkd: Fix a potential buffer overflow
Prevent that the statement that writes '\0' past the read data can write
past the end of the buffer.

Bug: 213617178
Test: Compile-tested only.
Change-Id: I6922c343a6bcb52dce0b5cf54f09b2850e9dfde2
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-02-23 17:05:11 +00:00
Bart Van Assche 545067957c lmkd: Use std::array<> and remove the ARRAY_SIZE() definition
Using ARRAY_SIZE() on a pointer yields 1 while applying .size() to a
pointer triggers a compiler error. Hence use .size() instead of
ARRAY_SIZE().

Bug: 213617178
Test: Compile-tested only.
Change-Id: Ie0f9740f59470c943f8d62b9475f7f987ed8707b
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-02-23 17:05:11 +00:00
Bart Van Assche 80a3dba57a lmkd: Use std::min() and std::max() instead of defining min() and max() macros
std::min() and std::max() check whether the argument types match but
min() and max() not. Hence switch to std::min() and std::max().

Bug: 213617178
Test: Compile-tested only.
Change-Id: Iaf1f63360c9360938db56d485dbd1e504129c52d
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-02-23 17:05:10 +00:00
Suren Baghdasaryan 7c4c36107f [automerger skipped] lmkd: Allow killing perceptible apps when recorded stall is too high am: 65e7d14e2a -s ours am: 77d001ed58 -s ours
am skip reason: Merged-In I9713e30d82641d86d1b7edb5e1ba2971b935c898 with SHA-1 5ae47a9563 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/memory/lmkd/+/16853454

Change-Id: I8d5a6c82f6c980ed7ec2488dbc8c2972716456f2
2022-02-22 23:24:33 +00:00
Suren Baghdasaryan 77d001ed58 [automerger skipped] lmkd: Allow killing perceptible apps when recorded stall is too high am: 65e7d14e2a -s ours
am skip reason: Merged-In I9713e30d82641d86d1b7edb5e1ba2971b935c898 with SHA-1 5ae47a9563 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/memory/lmkd/+/16853454

Change-Id: I80f87a21806b6d78063673ff0d8c4b5de329246f
2022-02-22 23:02:14 +00:00
Suren Baghdasaryan ef2f11d531 lmkd: Log psi averages in killinfo reports am: 014dd7156e am: 58fa91d0cf am: 7475f87830 am: b3ffc654fd am: 4609284014
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1992291

Change-Id: I636d0eae306af0748cb8d8b1d925d34207979482
2022-02-22 21:57:19 +00:00
Suren Baghdasaryan 54ca430c49 lmkd: Log psi averages in killinfo reports am: 014dd7156e am: 58fa91d0cf am: 7475f87830 am: b3ffc654fd
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1992291

Change-Id: I3d0e176a88533b2e58a502630bc1a19bd1051ac1
2022-02-22 21:35:20 +00:00
Suren Baghdasaryan 4609284014 lmkd: Log psi averages in killinfo reports am: 014dd7156e am: 58fa91d0cf am: 7475f87830 am: b3ffc654fd
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1992291

Change-Id: Ic7fef56fc049a8bf5b19996874b14d7d8b21efca
2022-02-22 21:14:52 +00:00
Suren Baghdasaryan b3ffc654fd lmkd: Log psi averages in killinfo reports am: 014dd7156e am: 58fa91d0cf am: 7475f87830
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1992291

Change-Id: I19c8d578df21710989921bea09cce98b8c103905
2022-02-22 20:49:54 +00:00