This way you'll get a build time error if you make the usual mistake of
adding to the enum but not adding an entry to the array.
Also improve the unit tests, and fix get_sched_policy_name's incorrect
behavior on invalid inputs.
Bug: N/A
Test: ran tests
Change-Id: Iefcb1ec9ef66267837da7a576c8be3d0cfb16cd0
Just the minimial changes to get this to actually build, because otherwise
we always bog down trying to rewrite everything (when the real answer
is usually "stop using libcutils, it's awful").
This doesn't move a handful of files: two are basically just BSD libc
source, a couple have outstanding code reviews, and one can be deleted
(but I'll do that in a separate change).
I'm also skipping the presubmit hooks because otherwise clang-format
wants to reformat everything. I'll follow up with that...
Bug: N/A
Test: builds
Change-Id: I06403f465b67c8e493bad466dd76b1151eed5993
Not only vendor libs, but also Android libs that are marked as
vendor_available are using SLOG*. Since both pure vendor libs and
Android libs available to vendors are using the same liblog headers for
VNDK, SLOG* needs to be visible via the headers.
Bug: 63088165
Test: BOARD_VNDK_VERSION=current m -j ATFWD-daemon
(or any other vendor modules using SLOG*)
Change-Id: Idfb74887a42d2418d3896bfdf5be3b4fc8e4c27f
Commit 795267d4c7 ("Removed cpusets/schedboost build time dependency.")
turned the cpusets and schedtune options into runtime
decisions.
However the kernel option which is mentioned in the
code comment (CONFIG_SCHEDTUNE) is very misleading
as it doesn't exist (CONFIG_SCHED_TUNE does exist)
and it doesn't describe the real functionality of
the method. schedboost_enabled() will still return
false if CONFIG_SCHED_TUNE is set in the kernel but
CONFIG_CGROUP_SCHEDTUNE is not.
So to clarify this, we need to change the comment
to reflect that CONFIG_CGROUP_SCHEDTUNE, which depends
on CONFIG_SCHED_TUNE, is required.
Signed-off-by: Alex Naidis <alex.naidis@linux.com>
Although prctl is declared as a varargs function, in actuality it takes
unsigned long arguments (after the first int argument). This patch
ensures that the slack value passed to prctl is correctly sized.
Without this change, the 32-bit ARM compiler places the 64-bit slack
value in registers r2 and r3, but prctl expects the first argument to be
in r1. For kernel versions < 4.6, set_sched_policy has not been
correctly setting the timer slack value in 32-bit ARM code.
Test: Run on bullhead device. Verified assembly of libcutils.so
Change-Id: Ie0e22cbf74a74ff168b257b2e58d0c252449d6c9
Add an SP_RT_APP group which will be used to provide minimum
capacity guarantees to RT tasks sensitive to frequency drops
such as synthesizer workloads.
Bug: 33085313
Change-Id: I07cca79e52661d1325a1db9ef3b61eb0f8d20989
Signed-off-by: Joel Fernandes <joelaf@google.com>
Change set_sched_policy to use prctl PR_SET_TIMERSLACK if setting the policy
for the current thread and /proc/<tid>/timerslack_ns is not supported by the
kernel.
Bug: 32972117
Test: Verified that libcutils SchedPolicy tests pass. See details in
testing done comment in
https://android-review.googlesource.com/381303 .
Change-Id: Id70940ed7f9ed94c3d105213f069bf3e5a8d8824
get_sched_policy will first attempt to get the policy from the "schedtune"
subsystem cgroup and, if not set, attempt to get the policy from the
"cpuset" subsystem cgroup. If neither subsystem has a cgroup set,
SP_FOREGROUND is returned.
Bug: 32972117
Test: Verified that SchedPolicy libcutils test passes and that ps displays
the expected policies. See details in testing done comment in
https://android-review.googlesource.com/379426 .
Change-Id: I586a921a38eea99d65590b07ece96c9808a2e56d
- moved __android_log_is_debuggable to a new public header
(log_properties.h)
- vendor version of sched_policy uses ALOG* instead SLOG*
Test: (sanity) liblog-unit-tests
Test: (sanity) libcutils_test (noting b/b/32972117, two tests continue
to fail)
Test: system/core as a whole makes with BOARD_VNDK_VERSION := current
now with no problems.
Test: boots/works on internal marlin
Bug: 33241851
(cherry picked from commit 1f83aa424f)
Merged-In: I5bc1f348dc0f0c8814bec5b5c3d2c52c825ab640
Change-Id: I5bc1f348dc0f0c8814bec5b5c3d2c52c825ab640
tasks in system-background cgroup will be shown as below:
580 580 system 12 -8 1% S 190656K 19408K unk surfaceflinger /system/bin/surfaceflinger
This patch fix this issue.
Change-Id: Ib39ff892010498548d7fbfb4021df62498acd033
Signed-off-by: Ganesh Mahendran <opensource.ganesh@gmail.com>
After removing bg_non_interactive cgroup, there is only a ROOT cgroup.
This CL removes the no-op trying to set cgroup.
It also removes the attempt to open non-exist bg_non_interactive cgroup.
Bug: 36649832
Test: marlin boosts and cgroup ROOT task looks normal
Change-Id: Ibccd6db1499306174c940aec9219b20c1b86173d
These two Soong product_variables were usually controlled by
ENABLE_CPUSETS and ENABLE_SCHEDBOOST in BoardConfig.mk. This change
turns the build time variables into runtime decision by checking if
a special file, "tasks", can be found under the mount points,
/dev/cpuset and /dev/stune, for cpusets and schedboost, respectively.
That special file only exists when the corresponding Linux kernel
configurations, CONFIG_CPUSETS and CONFIG_SCHEDTUNE, are set.
Bug: 34726944
Test: Tested on Sailfish with following configurations
neither cpuset nor schedtune enabled in the kernel
cpuset enabled, but schedtune disabled in the kernel
both cpuset and schedtune enabled in the kernel
Change-Id: I6695b8b32b2fecb4fd995018418bbe2edc5d590f