Commit graph

165 commits

Author SHA1 Message Date
Elliott Hughes
c3a206ccda Revert "[LSC] Add LOCAL_LICENSE_KINDS to system/core"
This reverts commit 187b7d1950.

Reason for revert: system/core is multiple projects, not one.

Change-Id: I790ea41741f8cd9b8b6db2f59a49e71fb0958fd6
2021-02-16 20:01:20 +00:00
Bob Badour
187b7d1950 [LSC] Add LOCAL_LICENSE_KINDS to system/core
Added SPDX-license-identifier-Apache-2.0 to:
  bootstat/Android.bp
  cli-test/Android.bp
  code_coverage/Android.bp
  cpio/Android.bp
  debuggerd/crasher/Android.bp
  debuggerd/proto/Android.bp
  diagnose_usb/Android.bp
  fs_mgr/libdm/Android.bp
  fs_mgr/libfiemap/Android.bp
  fs_mgr/liblp/Android.bp
  fs_mgr/libsnapshot/Android.bp
  fs_mgr/libstorage_literals/Android.bp
  fs_mgr/libvbmeta/Android.bp
  fs_mgr/tests/Android.bp
  fs_mgr/tools/Android.bp
  gatekeeperd/Android.bp
  healthd/Android.bp
  healthd/testdata/Android.bp
  init/Android.bp
  init/Android.mk
  init/sysprop/Android.bp
  init/test_kill_services/Android.bp
  init/test_service/Android.bp
  libappfuse/Android.bp
  libasyncio/Android.bp
  libbinderwrapper/Android.bp
  libcrypto_utils/Android.bp
  libcrypto_utils/tests/Android.bp
  libdiskconfig/Android.bp
  libgrallocusage/Android.bp
  libkeyutils/mini_keyctl/Android.bp
  libmodprobe/Android.bp
  libnetutils/Android.bp
  libpackagelistparser/Android.bp
  libprocessgroup/Android.bp
  libprocessgroup/cgrouprc/Android.bp
  libprocessgroup/cgrouprc_format/Android.bp
  libprocessgroup/profiles/Android.bp
  libprocessgroup/setup/Android.bp
  libqtaguid/Android.bp
  libsparse/Android.bp
  libstats/push_compat/Android.bp
  libsuspend/Android.bp
  libsync/Android.bp
  libsystem/Android.bp
  libsysutils/Android.bp
  libusbhost/Android.bp
  libutils/Android.bp
  libvndksupport/Android.bp
  libvndksupport/tests/Android.bp
  llkd/Android.bp
  llkd/tests/Android.bp
  property_service/libpropertyinfoparser/Android.bp
  property_service/libpropertyinfoserializer/Android.bp
  property_service/property_info_checker/Android.bp
  qemu_pipe/Android.bp
  reboot/Android.bp
  rootdir/Android.bp
  rootdir/Android.mk
  rootdir/avb/Android.bp
  rootdir/avb/Android.mk
  run-as/Android.bp
  sdcard/Android.bp
  set-verity-state/Android.bp
  shell_and_utilities/Android.bp
  storaged/Android.bp
  toolbox/Android.bp
  trusty/apploader/Android.bp
  trusty/confirmationui/Android.bp
  trusty/confirmationui/fuzz/Android.bp
  trusty/coverage/Android.bp
  trusty/fuzz/Android.bp
  trusty/fuzz/test/Android.bp
  trusty/gatekeeper/Android.bp
  trusty/gatekeeper/fuzz/Android.bp
  trusty/keymaster/Android.bp
  trusty/keymaster/fuzz/Android.bp
  trusty/libtrusty/Android.bp
  trusty/libtrusty/tipc-test/Android.bp
  trusty/secure_dpu/Android.bp
  trusty/storage/interface/Android.bp
  trusty/storage/lib/Android.bp
  trusty/storage/proxy/Android.bp
  trusty/storage/tests/Android.bp
  trusty/utils/spiproxyd/Android.bp
  trusty/utils/trusty-ut-ctrl/Android.bp
  usbd/Android.bp
  watchdogd/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD to:
  debuggerd/Android.bp
  fastboot/Android.bp
  libkeyutils/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD
    SPDX-license-identifier-MIT
to:
  Android.bp
  libcutils/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-MIT
to:
  fs_mgr/Android.bp
  fs_mgr/libfs_avb/Android.bp
  trusty/utils/rpmb_dev/Android.bp

Added SPDX-license-identifier-BSD
to:
  fastboot/fuzzy_fastboot/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: I5bd81adb5cdcf2b4dd4141b204eb430ff526af8f
2021-02-16 04:10:03 -08:00
Marco Ballesio
9e628a6b42 libprocessgroup: fix uid/pid hierarchy for recovery mode
configure the cgroup v2 hierarchy for recovery mode, and create uid/pid
groups with attributes following the container cgroup directory.

Bug: 168907513
Test: verified correct pid migration in normal and recovery modes
Change-Id: Idc8b96b4db075383a6a2e523c241b0bc632c7030
2021-02-11 17:03:19 -08:00
Marco Ballesio
a7148f82a1 libprocessgroup: adopt cgroup v2 freezer search path
With the new uid/pid hierarchy the search path looks into uid_0, which
is always present.

Bug: 168907513
Test: verified that the cgroup v2 hierarchy works correctly in normal
mode
Test: verified that the cgroup v2 hierarchy works correctly in recovery
mode

Change-Id: If33594e4891128148da64bed47e68fa74667013d
2021-02-11 17:03:06 -08:00
Marco Ballesio
4dac81680f Revert^4 "libprocessgroup: uid/pid hierarchy for cgroup v2"
This reverts commit 088924af2a.

Bug: 168907513
Test: verified correct function of the cgroup v2 hierarchy in normal and
recovery mode

Change-Id: I6e9d21ebe832326ed5a5b2c356fe8363c1546a80
2021-02-11 15:01:43 -08:00
Marco Ballesio
23fddab32b libprocessgroup: define path for freezer search
This path can be used for clients to verify freezer support on a
specific platform.

Bug: 168058155
Test: verified correct functioning with ActivityManager
Change-Id: Ie15feed274ccbbe31228ee98c50eab3f4dd479a7
2021-02-05 12:20:56 -08:00
Marco Ballesio
079477468f Revert^3 "libprocessgroup: move freezer to uid/pid hierarchy"
This reverts commit 7707909ba2.
Bug: 179006802
Test: verified correct functioning of the freezer after reverting

Change-Id: I848146a18a0879010abf5b00e7081f2771059064
2021-02-05 12:19:58 -08:00
Treehugger Robot
fe13d497f4 Merge "Symbol files describing APIs across updatable components are reviewed" 2021-02-05 03:12:45 +00:00
Treehugger Robot
cfb743e42c Merge "Revert^3 "libprocessgroup: uid/pid hierarchy for cgroup v2"" 2021-02-05 01:59:15 +00:00
Marco Ballesio
088924af2a Revert^3 "libprocessgroup: uid/pid hierarchy for cgroup v2"
a1a0497984

Bug: 151660495
Test: verified proper boot in regular mode and proper working of adb in
recovery

Change-Id: I1276796e982fee932cdea7eb145f20b3f1b3463d
2021-02-04 22:33:34 +00:00
Julien Desprez
427e9f08f9 Remove TEST_MAPPING entry based on go/a-unit-tests update
cc_test_host now all run in presubmit without any need for explicit TEST_MAPPING

Change-Id: I379ef754b4cb645976daedcd04eae58f2eb32a75
Test: presubmit
Bug: 177450457
2021-02-04 16:50:56 +00:00
Jiyong Park
9ae5daba80 Symbol files describing APIs across updatable components are reviewed
The build system will soon require that symbol files describing APIs
across updatable components (e.g. across APEXes or across sytem/vendor)
have the ".map.txt" suffix. This will trigger the NDK API review in the
gerrit so that backwards incompatible changes are prevented.

Bug: N/A
Test: m nothing
Change-Id: I114563782f8e796365ca141eb5d22d2e203a7f55
2021-02-04 21:05:21 +09:00
Rick Yiu
d76053a4c5 libprocessgroup: Add control of printing log in WriteFileAction
If there are known fail pattern, we could disable printing logs to
reduce log spam. Use "LogFailures": true or "LogFailures": false.
Default will be true if not specified.

Bug: 178070122
Test: function works
Change-Id: Ia4081a10daf738294937f459f006fbcc3171481b
2021-01-28 03:26:18 +00:00
Marco Ballesio
7707909ba2 Revert "Revert "libprocessgroup: move freezer to uid/pid hierarchy""
This reverts commit b01aa99408.

Reason for revert: blocking issue was resolved https://partner-android-review.googlesource.com/c/kernel/private/gs-google/+/1846507

Change-Id: If125fe9af53e2b519955f021208d5d5530c6277e
2021-01-27 16:43:07 +00:00
Marco Ballesio
a1a0497984 Revert^2 "libprocessgroup: uid/pid hierarchy for cgroup v2"
4bbabe4ca4

Change-Id: I6742ffd19a6ea1fe3bf6b4386da69f5885b13be4
2021-01-27 06:07:25 +00:00
Jiyong Park
ab8a7d2a03 Cgroup APIs are guarded
The following API was added for the API level 30 and beyond. Currently,
its existence is tested using the null check which is done regardless of
the min sdk version of the compilation unit. (which in turn required us
to mark the API symbol weak regardless of the min sdk version.)

* AGroupController_getFlags

Now, we have a better way of testing the API availability;
__builtin_available. The null check is replaced with the call to the
compiler-provided macro which determines if the code is running in a
version of OS where the API is known to exist.

Bug: 150860940
Bug: 134795810
Test: m

Change-Id: I5d17fc877c553c402a62485b61af574a54658a76
2021-01-12 20:50:27 +09:00
Jiyong Park
2d30fe48d4 Remove __ANDROID_API__ guards
__ANDROID_API__ guards are removed in favor of __INTRODUCED_IN macros.

Currently, __INTRODUCED_IN macro does nothing for these headers (it's
meaningful only to the headers processed by versioner which are limited
to binic headers). The plan is to make the macros to tag the declaration
with the availability attribute. Then, when the min_sdk_version of a
caller is set to an API level that is older than the API level of the
APIs, the compiler will provide them as weak symbols and enforce that
calling the APIs are guarded with a runtime check.

For now, these guards are preventing from making a build system change
to let __ANDROID_API__ track the min_sdk_version property instead of the
sdk_version property. With the build system change, __ANDROID_API__ will
suddenly drop for the native modules where min_sdk_version <
sdk_version, which is the case when the modules are included in APEXes.
As a result, some new APIs will be unavailable at build-time. Dropping
the hand-written guards fixes the problem.

Bug: 163288375
Test: m
Change-Id: If1cc6b9af410f536abe6d777c22711209fa76530
2021-01-12 20:50:27 +09:00
Treehugger Robot
bde5350eed Merge "Revert "libprocessgroup: move freezer to uid/pid hierarchy"" 2021-01-05 23:33:12 +00:00
Marco Ballesio
b01aa99408 Revert "libprocessgroup: move freezer to uid/pid hierarchy"
This reverts commit 1414a0d4d8.

Reason for revert: reversions of CLs from http://b/174776875 removed dependencies for this CL, and made the freezer non-functional. This CL has to be reverted as well

Bug:174776875
Change-Id: Idbd9532374bb661330b3c7546bbdf086a046aba3
2021-01-05 21:36:44 +00:00
Elliott Hughes
21de4e727e Add new owners to various sub-projects.
Test: treehugger
Change-Id: Ia2a99c0499633ccc5d23c37a1ec93867c876d637
2020-12-11 12:45:45 -08:00
Jonglin Lee
ac216acad5 Merge "Revert "libprocessgroup: uid/pid hierarchy for cgroup v2"" 2020-12-04 04:47:39 +00:00
Jonglin Lee
4bbabe4ca4 Revert "libprocessgroup: uid/pid hierarchy for cgroup v2"
Revert "sepolicy: rules for uid/pid cgroups v2 hierarchy"

Revert submission 1511692-cgroup v2 uid/pid hierarchy

Reason for revert: Causing intermittent cgroup kernel panics
Reverted Changes:
I80c2a069b:sepolicy: rules for uid/pid cgroups v2 hierarchy
I73f3e767d:libprocessgroup: uid/pid hierarchy for cgroup v2

Bug: 174776875
Change-Id: I2af586d63bb0312407b90b52909330cde4b7b074
Test: Locally reverted and booted 100 times without kernel panic
2020-12-04 03:12:59 +00:00
Justin Yun
feef4d390f Add product_available to product available modules
vendor_available modules were available to product modules.
However, not all vendor_available modules are required to be
available to product modules. Some modules want to be available only
to product modules but not vendor modules.

To cover the requirement, we separate product_available from
vendor_available.
vendor_available will not provide product available module.

Rename libcutils/include_vndk to libcutils/include_outside_system as
it provides the headers to the modules outside the system partition
including /product.

Bug: 150902910
Test: build
Change-Id: I791b5a6a1dc99442065debfce6fa0f54a335fcea
2020-12-04 09:59:20 +09:00
Marco Ballesio
1414a0d4d8 libprocessgroup: move freezer to uid/pid hierarchy
Migrate the freezer controller as an attribute for the uid/pid hierarchy

Bug: 168907513
Test: manually verified that the freezer behavior was as expected after
applying the enablers in ActivityManager

Signed-off-by: Marco Ballesio <balejs@google.com>
Change-Id: Ica2c4bfd20190fb2f2dc0a530eb47e1a8427c522
2020-12-03 22:00:33 +00:00
Suren Baghdasaryan
756a60459c libprocessgroup: Change per-API level task profiles to override the diffs
Current per-API level task profiles replace the latest task profiles
rather than overriding the diffs. This poses an issue when a new
feature is added which is applicable to older devices as well we
have to change all per-API level profiles. Change the per-API task
profile support to load the latest task profiles first and then override
with per-API task profiles, similar to how vendor task profiles override
system task profiles. This minimizes the changes we need to do to the
per-API level task profiles going forward and is more consistent with
how vendor task profiles work.

Bug: 170507876
Test: boot with per-API task profiles
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I08cc4b374cede7363cf96a30ac96971d49bb7847
2020-12-03 19:39:31 +00:00
Wei Wang
673b6d47bc Merge changes I13c9660a,I41745e7b,I0e6722b8
* changes:
  init.rc: correct the obsolete comment
  Add system-background cpu group
  init.rc: create camera-deamon stune cgroup
2020-12-03 18:57:25 +00:00
Marco Ballesio
4d45b59f80 libprocessgroup: uid/pid hierarchy for cgroup v2
Enable the uid/pid hierarchy for all groups when using cgroup v2. Mount
the hierarchy under the cgroup v2 root. Make sure that all files under
the hierarchy are accessible by the system user.

Test: booted the device, tested the freezer cgroup, manually verified
the working of the freezer from logs and by checking statuses of
processes.

Bug: 168907513
Test: Booted the device, verified no regressions on process group access
Change-Id: I73f3e767d377902af6e12facb503b9136fb39e08
2020-12-02 09:51:42 -08:00
Wei Wang
ab87979a00 Add system-background cpu group
Add system-background cgroup hierarchy for uclamp and cpu bandwidth
tuning.

Bug: 170507876
Bug: 171740453
Test: boot and check cgroup
Change-Id: I41745e7b3ac5c1d7ea7dd77f5db39c6895047446
2020-12-01 19:46:02 -08:00
Suren Baghdasaryan
35221b5338 libprocessgroup: Support per-API level task profiles
When task profiles changes happen, devices released under older API
levels might have to use the same profiles as before. This might be
due to for missing kernel features or some other reasons. Add support
for per-API task profiles to accommodate this scenario. With this
mechanism when ro.product.first_api_level is non-empty, the system
looks for /system/etc/profiles/task_profiles_<api level>.json file
and uses it if it exists. If ro.product.first_api_level is not defined
or per-API task profiles file does not exist the system falls back to
the default /system/etc/profiles/task_profiles.json file.
As before, these task profiles can be competely overwritten using
/vendor/etc/task_profiles.json if needed.

Bug: 172066799
Test: boot with per-API task profiles
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I1671b341b3a0fb5e99d0b0788315c61088326b09
2020-11-23 22:08:41 +00:00
Wei Wang
b90e23efc7 task_profiles.json: use system subgroup for NormalPerformance
Put tasks into a subgroup so that we can set things up e.g. soft cpu
bandwidth and/or uclamp.

Bug: 170507876
Bug: 171740453
Test: boot and check cgroup
Change-Id: Iaeb081bc4f214aa23eb281e0c28a81ea581bb4d1
2020-11-20 10:54:55 -08:00
Rick Yiu
b4a3f080e6 Merge "libprocessgroup: Support write to file feature" 2020-11-04 04:54:42 +00:00
Rick Yiu
bc1ad9671a libprocessgroup: Support write to file feature
There may be some use cases that it needs to write string to a
file. This patch support write "Value" to "FilePath", where
both parameters could use special string "<uid>" and "<pid>" to
represent actual uid and pid.

Bug: 170507963
Test: function works
Change-Id: I543846f523518a9bcb3dd1b3437163a1b3157d95
2020-11-03 20:56:48 +08:00
Yifan Hong
92836b2e95 Merge changes from topic "toybox_vendor_ramdisk"
* changes:
  Add shell_and_utilities_vendor_ramdisk
  Make libraries {vendor_,}ramdisk_available.
2020-11-02 18:33:33 +00:00
Rick Yiu
32809d8231 Merge changes from topic "aosp_use_uclamp"
* changes:
  init: Add cpu controller hierarchy to use utilclamp controller
  libprocessgroup: Replace stune with utilclamp profiles
2020-10-30 07:12:32 +00:00
Suren Baghdasaryan
1b53c2496d libprocessgroup: Replace stune with utilclamp profiles
Replace schedtune out-of-tree controller's usage in the performance
profiles with utilclamp controller. Stop mounting schedtune controller.

Bug: 170507876
Test: cpuctl groups worked
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: Ib7fa6c902581398587c75414845c2ff6c8bdb005
2020-10-29 16:21:09 +00:00
Yifan Hong
67c71a1b4f libprocessgroup_headers: make vendor_ramdisk_available.
Test: pass
Bug: 156098440
Change-Id: I4d66c3e0aa2bbc972d2d6fe16dec95a45bfb2889
2020-10-28 10:57:51 -07:00
Yifan Hong
89d1c19ca0 Make libraries {vendor_,}ramdisk_available.
Test: pass
Bug: 156098440
Change-Id: I07bb2fdc5113a5113b648795a1f60c09f20e12f1
2020-10-28 10:57:51 -07:00
Colin Cross
6a2b16693c Make the connection between implementation and llndk_library explicit
Instead of assuming a module with the .llndk suffix exists, add an
llndk_stubs property to every cc_library module that has a
corresponding llndk_library.  Also rename the llndk_library to have
an explicit .llndk suffix.

Bug: 170784825
Test: no changes to build.ninja (excluding comments) or Android-${TARGET_PRODUCT}.mk
Change-Id: Ifba79a1ae64a67a9d7393dac2fb012cd8af8e149
2020-10-19 13:38:05 -07:00
Dan Shi
67b7dd570f Remove vts10 related configs
Bug: 169582597
Test: build
Change-Id: I38e1e0f8e32b86ab14b905d040c1c62245a1a9e3
2020-10-06 13:52:44 -07:00
Marco Ballesio
43050baa7f libprocessgroup: json prototype for cgroups v2
cgroups v2 support introduces new fields in the json format. Adapt the
proto file accordingly

Bug: 154548692
Test: atest libprocessgroup_proto_test --
Change-Id: I40f8757a8f4e6a0b839caa7faa976dfebf3aac98
2020-08-20 15:53:48 -07:00
Marco Ballesio
1c755e22c8 libprocessgroup: switch freezer to cgroup v2
remove cgroup v1 freezer entries from init.rc, add a new cgroup v2
controller and modify plists to properly interact with it.

Bug: 154548692
Test: manually verified the the cgroup v1 freezer controller isn't
created and a new controller for cgroup v2 is created under the correct
sysfs directory.

Change-Id: I1b811300ade486f88fdbd157255a7f37750cc54d
2020-08-20 15:11:41 -07:00
Marco Ballesio
76eca5b4c1 freezer: allow dynamic changes to freezer.state
create new profiles to allowing thawing and freezing back the freezer
cgroup

Bug: 151225245
Test: Manually verified that using the SetTaskProfiles method on the
profiles thaws and freezes back the freezer cgroup.

Change-Id: I7f3e193ebe79b49c1f6ac52b6138ff4ec26fc570
2020-08-19 13:18:28 -07:00
Suren Baghdasaryan
81b9f0b763 libprocessgroup: Allow vendor profile attributes to override system ones
In the current implementation vendor profile attributes do not override
system ones and instead generate a warning. Fix that by overriding existing
attribute if a new definition is found.

Bug: 160318642
Test: add vendor attributes and confirm no warnings
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I71a2ee4d4b3c585e7c9a01b791e973390d409cbc
2020-07-01 20:44:24 +00:00
Marco Ballesio
f16f9417b0 libprocessgroup: support for cgroup v2 hierarchy
for a first implementation the cgroup v2 freezer controller will be used in a
way similar to cgroup v1, that is a single child group will hold all frozen
processes. Some adjustments are needed for the new structure.

- Add support for cgroup v2 syntax under procfs.
- Separate creation of a directory with ownership/mode changes to allow changes
    after mounting the cgroup kernfs root.
- Allow the creation of sub-groups under a cgroup v2 hierarchy.

Bug: 154548692
Test: manually verified that a proper cgroup v2 hierarchy is created and
accessible

Change-Id: I9af59e8214acaead3f520a94c95e75394c0df948
2020-06-10 09:14:00 -07:00
Yifan Hong
2572f23af8 vts_processgroup_validate_test: make deps static
Test: pass
Fixes: 155959743
Change-Id: I730526955a40ae00a97f487e423a00c743f75d53
2020-05-07 12:41:45 -07:00
Treehugger Robot
f9273c2aa3 Merge "processgroup: Set min_sdk_version" 2020-05-04 15:52:39 +00:00
Suren Baghdasaryan
8c604e8615 task_profiles.json: add a new task profile used by camera HAL
Add new CameraServicePerformance task profile used by camera HAL.

Bug: 155419956
Test: confirm profile applies correctly
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I21cf942eca279a5ad4c1ff75c735560954f4ebc1
2020-05-01 01:05:42 +00:00
Dan Shi
63a07aafcf Add vts_processgroup_validate_test to vts suite
Bug: 154727600
Test: atest vts_processgroup_validate_test
Change-Id: I53bd4f9fd097878deaa77159feb2d48f66c464d1
Merged-In: I53bd4f9fd097878deaa77159feb2d48f66c464d1
2020-04-28 09:58:14 -07:00
Jooyung Han
4f55f3efd3 processgroup: Set min_sdk_version
Modules contributing mainline modules (APK/APEX) should set
min_sdk_version as well as apex_available.

For now setting min_sdk_version doesn't change build outputs.
But build-time checks will be added soon.

Bug: 152655956
Test: m
Change-Id: Idaa27ce24cc13d13145eaef85a08b9033922c7bc
2020-04-23 23:53:19 +09:00
Jiyong Park
e3d371e319 Set apex_available property
The marked library(ies) were available to the APEXes via the
hand-written whitelist in build/soong/apex/apex.go. Trying to remove the
whitelist by adding apex_available property to the Android.bp of the
libraries.

Bug: 150999716
Test: m
Change-Id: Id08058f3105463558c6c82298344a33af0efb2d3
2020-04-08 22:37:42 +09:00