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>
There is little advantage and increasingly much disadvantage to
queueing up fastboot commands before executing them. This change
removes the queue in the most simple way possible to enable further
clean up.
Test: fastboot works
Change-Id: I9abab05df07ed167dbe6a42e1eb9eab8f8d4f157
The units should be byte instead of bit and multiplier are kibibyte
mebibyte gibibyte respectively.
Bug: 114062206
Test: Build and logcat -g
Test: ./logcat-unit-tests
Change-Id: I995faa9a340bb63f48d117a1b8590e5d74ac1bba
Introduce sys.lmk.minfree_levels system property to allow minfree level
reporting. The format for this property is:
<minfree 1>:<oom_adj 1>, <minfree 2>:<oom_adj 2>, ...
Max number of minfree levels is 6 and they are specified in the
increasing order. For example:
sys.lmk.minfree_levels=18432:0,23040:100,27648:200,32256:300,55296:900,80640:906
sys.lmk.minfree_levels updates are ratelimited to once per second in order
to prevent DoS attacks.
Bug: 111521182
Test: getprop sys.lmk.minfree_levels returns expected value
Change-Id: I80d75d6836650b12457d6a99ca88898535837a97
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Convert the last user to a regular std::vector, and then put List.h out
of its misery.
Turns out there's another copy of this ancient header:
system/core/libutils/include/utils/List.h. This one is included in
various places, but most don't actually use it. There seems to
be a case for a tool to detect unused headers...
Test: m
Change-Id: Ie457bf5e06f6082537f5de2e1fefe7f05a1f0792
Partition sizes must be reported with an "0x" prefix for fuzzy_fastboot.
Also, with dynamic partitions, the size of a partition can be 0.
Bug: 78793464
Test: fuzzy_fastboot Conformance.PartitionInfo does not error on
partition sizes when using fastbootd
Change-Id: I4148440bd9ed420878940829618cbf8cee85bf6a
This change moves Transport ownership back out of FastBootDriver.
Callers of set_transport must ensure that the previous transport is
destroyed. In addition, deleting a transport now ensures that it is
closed.
Bug: 78793464
Test: fastboot, fuzzy_fastboot works
Change-Id: I8f9ed2f7d5b09fd0820b2677d087a027378f26db
Move the fd() function to be private since it should not have been
exposed in the first place.
Fix the way logging_test uses CapturedXXX.
Adding this because the new isolated testing doesn't print errors to
stderr so the ASSERT_ EXPECT_ messages can get swallowed. Also, it's easier
to reuse a CapturedXXX object in a test with these functions.
Test: New unit tests pass.
Change-Id: I38b113fc184146ce434802f80a9b7997fa83e78a
Using fdopen with unique_fd correctly is more annoying than it should
be, because fdopen doesn't close the file descriptor received upon
failure, which means you have to something like the following:
unique_fd ufd = ...;
int fd = ufd.release();
FILE* file = fdopen(fd, "...");
if (!file) {
close(fd);
return;
}
Add an android::base::Fdopen that does that dance for you.
Bug: http://b/113880863
Test: treehugger
Change-Id: I6325acf1ff06484005c1053fe09672c5eeeecaa1
KM1/KM2 implementations should treat nullptr and KeymasterBlob{nullptr, 0}
equally when passed in as client_id or app_data. However, trusty KM1
treats them differently.
Bug: 113110105
Bug: 113084196
Change-Id: Ie0e2b5d60d808e4f7a8e48aeb4c694268f9bc0a1
Use a new Windows 10 API, SetThreadDescription(). Background info from a Chrome developer:
https://randomascii.wordpress.com/2015/10/26/thread-naming-in-windows-time-for-something-better/
Test: Win10, Vista, adb shell
Test: Ran windbg -pn adb.exe, used .dump /ma to create a dump, ran
`dx -g @$curprocess.Threads' on the dump and it showed the thread names.
Change-Id: I14ea7121605cb3fa45ce7b59e2ba5882a215b59f
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
The code was passing an fd from adb_open() to android::base::ReadFdToString() which actually
takes a C-Runtime fd (on Windows), so it wasn't working.
The fix is to use APIs that deal with C-Runtime fds:
* unix_open()
* android::base::unique_fd
* unix_lseek() (added in this change)
I also removed an unnecessary call to GetProcessId() since we already have the process id
from the structure returned by CreateProcess().
Test: adb start-server on Win10 and Ubuntu (with a failing server)
Test: mma
Change-Id: Id6e2dd5532a02fe5d9caf96aa007a1b3434a0b59
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>