Commit graph

90 commits

Author SHA1 Message Date
Adrian Ratiu
a742158667 threads.h: avoid defining gettid on glibc >= 2.32
Glibc >=2.32 exposes a gettid() which clashes with libcutils
thread.h, so add a check to not expose it if building against
newer glibc (ChromiumOS will still use glibc 2.27 besides 2.32).

Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1182060
Test: Builds without errors on both glibc 2.32 and 2.27.

Change-Id: Ib71fa1bc9fa185e3668002407dbed05a80c87740
2021-03-05 09:55:15 +00:00
Florian Mayer
cae942d7ac Do not check for debuggable / profilable for app tracing.
This is undocumented and surprising behaviour.

Bug: 179883548
Change-Id: I373b176d4ed9f6b0e970d055d7e4e2686c6d3991
2021-02-12 16:54:51 +00:00
Mitch Phillips
391157659b [MemInit] Remove process_disable_memory_mitigations
This function is no longer necessary, and uses a deprecated API
(mallopt(M_BIONIC_DISABLE_MEMORY_MITIGATIONS)). This function was
provided originally as part of libcutils because the original API was a
private android_mallopt.

The API is being reborn as a memory-init-specific mallopt. Given that
regular system components and apps will be able to call it directly,
it's not necessary to have a wrapper function in libcutils any more.

Bug: 135772972
Test: Build the device.
Change-Id: I4a3185b99702c8e445de6837b154c4a96c8295a1
2021-01-20 16:07:49 -08:00
Elliott Hughes
dcf81848cb Remove thread_store_set()/thread_store_get().
C++ thread_local is less code to write, and performs better. All known
users have been moved over already.

Test: treehugger
Change-Id: Idaa2a58bf23342dae08dd6b9003d8f532839b351
2020-12-07 10:54:53 -08:00
Elliott Hughes
0675702c62 Make libcutils' thread local stuff more clearly deprecated.
libcutils' thread local stuff is almost unused already, so let's try
harder to prevent new users. (In parallel I'll try to actually move the
four existing users off it, so we can actually remove this.)

Test: treehugger
Change-Id: Ib5445a43cff1f161ce1c7a45959d5b126f6f6980
2020-12-02 11:22:29 -08:00
Steven Moreland
d22659b8ea libcutils: API to disable memory mitigations
Convenience API to disable memory mitigations, where we can specify
logging and also have a single place to update once a related bug is
fixed.

Bug: 166675194
Test: use API to disable memory mitigations
Change-Id: I4a3529ea1911925c49e31cc3809c2743e401c196
2020-10-10 00:16:24 +00:00
Xin Li
0a112d52f8 Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507
Merged-In: Id18cb0e2d2f3e776a42b566c4a1af2e250890896
Change-Id: Iba7cab32ab3aa6f47952c840ff6dc8492e8d0704
2020-08-29 01:42:13 -07:00
Bowgo Tsai
f4bf7f3a94 Add systrace tag for system property
Introduce a new systrace tag, TRACE_TAG_SYSPROP, for use with
system property.

Bug: 147275573
Test: build
Change-Id: I6f85f3f52f6580bab4ff43fc1dc0e87c689b054e
Merged-In: I6f85f3f52f6580bab4ff43fc1dc0e87c689b054e
(cherry picked from commit 573fc58bad)
2020-08-19 12:48:07 +08:00
Elliott Hughes
10b59d4044 Merge "libcutils: reimplement system property functions with libbase." am: 95e79c63a4 am: 854b9898ae
Change-Id: I4f99d73f376e853a0b125439e105ae781af02e30
2020-05-26 18:00:45 +00:00
S Vasudev Prasad
100b08a848 libcutils: reimplement system property functions with libbase.
This makes the system property functions available on the host too, and
ensures a consistent view of system properties between libcutils and
libbase, if you have code running on the host that uses both.

Bug: http://b/151789258
Test: treehugger
Change-Id: Ie524a77d0c392d7b23e9d12becbb1bf53c81eac6
2020-05-21 16:20:16 -07:00
Treehugger Robot
39257c1baa Merge "Fix cutils/ashmem.h copyright header." am: f61377979e am: b40f653314
Change-Id: Id5e9f35b1f1256a426d8b57ff504c076443d1f14
2020-04-28 21:33:04 +00:00
Elliott Hughes
f35feb5389 Fix cutils/ashmem.h copyright header.
The *kernel* header is "GPL-2.0 OR Apache-2.0", but the userspace
libcutils is just Apache-2.0 like all our code.

Test: builds
Change-Id: I25eef8eed16550f4010285479b21b502a2d1fc07
2020-04-28 09:28:29 -07:00
Automerger Merge Worker
bfa910d35e Merge "Always use shared memory for atrace." am: 2ddc5a1932 am: 3d9c20fefd
Change-Id: I8f7cc5b355bee1bbc41ed8ddf5885d9b26382d62
2020-02-27 11:00:50 +00:00
Florian Mayer
fc0adaf89e Always use shared memory for atrace.
Remove ATRACE_SHMEM macro.

Test: atrace ss
      atrace wm
      sanity check output
Bug: 137366208
Change-Id: I1b42243678b9b9a41db18e2ff8cb3cf7bde874de
2020-02-26 15:55:22 +00:00
Treehugger Robot
15c0b798bd Merge "bootstat: enhance last reboot reason property with file backing" am: 7550e6f882 am: ffd276388f am: c0210f1d0e
Change-Id: I6d953d6b9308dc46619e52f81cb5469b22df55d0
2020-02-17 10:12:25 +00:00
Mark Salyzyn
ee016ce0b3 bootstat: enhance last reboot reason property with file backing
Helps with support of recovery and rollback boot reason history, by
also using /metadata/bootstat/persist.sys.boot.reason to file the
reboot reason.

Test: manual
Bug: 129007837
Change-Id: Id1d21c404067414847bef14a0c43f70cafe1a3e2
2020-02-14 13:24:16 -08:00
Automerger Merge Worker
e7fbe55a98 Merge "Use sequence number to check if to reload atrace tags." am: 445234c76c am: d371ad8665 am: 0549118e91
Change-Id: I364d217f7447b7b4f4cf7c042e9f26844e245d46
2020-01-14 10:10:44 +00:00
Florian Mayer
b06766cbbf Use sequence number to check if to reload atrace tags.
This is to deprecate the sysprop change notification in atrace.
After this change, processes will only update their enabled tags
at the first atrace event. Previously we reloaded the tags as a
result of the sysprop changed Binder notification, which woke up
every process in the system.

Test: adb shell su root atrace -t 10 ss
Test: #define ATRACE_SHMEM 0; adb shell su root atrace -t 10 ss

Bug: 137366208

Change-Id: Idffba5fd4ba23fba2f6b9f594365df68ac0c1626
2020-01-13 17:02:58 +00:00
Elliott Hughes
9a767159c0 Merge "Remove unused android_memset16()/android_memset32()." 2019-11-12 19:10:40 +00:00
Elliott Hughes
7b8fcfea0e Remove unused android_memset16()/android_memset32().
Pixelflinger is gone.

Test: treehugger
Change-Id: I6954ae6a860102be0f6d76f33e76ed3210e5c152
2019-11-08 15:59:30 -08:00
Elliott Hughes
d91984a890 libcutils: remove unused socket_set_receive_timeout().
Test: treehugger
Change-Id: I834762fd83bdaa3b714c7531439bf9115a82e342
2019-11-08 15:21:39 -08:00
Tri Vo
92fd3caff7 libcutils: route to /dev/ashmem<boot_id> instead of ashmemd
Having libcutils ask ashmemd for ashmem fds results in unsatisfactory
performance/memory overhead. Introduce a duplicate of /dev/ashmem and
route to it instead.

Our goal remains as before, namely, use SELinux to phase out usage of
ashmem that doesn't go through libcutils.

Bug: 139855428
Test: boot aosp_crosshatch, browse internet, use camera
Change-Id: I02260a9042acb412571b11f1f4c1d8608483064a
2019-09-25 12:50:16 -07:00
Elliott Hughes
13e64377b3 Merge "Reland "libcutils: remove unused "jstring.h"."
am: a22599df58

Change-Id: I7ea8fa894ed60fc64534a6de312258b75b3bff8e
2019-08-12 11:40:28 -07:00
Elliott Hughes
79198d9ade Reland "libcutils: remove unused "jstring.h".
This reverts commit 09ba34925f.

Bug: http://b/139257138
Test: treehugger
Change-Id: Id9b612c5a79b89ed17d2205219af19788ae96c9e
2019-08-12 15:09:20 +00:00
Mason Wang
1967bf3f07 Merge "Revert "libcutils: remove unused "jstring.h".""
am: 4b8e6b673f

Change-Id: I2ec20c825970beefae2c9b2693506c2d7d3165d5
2019-08-11 22:40:42 -07:00
Mason Wang
09ba34925f Revert "libcutils: remove unused "jstring.h"."
This reverts commit aa96e8898c.

Reason for revert: It caused BB, and b/139257138 is for your reference

Change-Id: I93f1d0ba0fa43325e2815e9b2de84bb7cb41c457
2019-08-12 02:16:58 +00:00
Elliott Hughes
94879d3b9f Merge "libcutils: remove unused "jstring.h"."
am: e2adc14803

Change-Id: I2d779ea267d1177ace3d18290f61b9006d86ce25
2019-08-11 08:51:52 -07:00
Elliott Hughes
aa96e8898c libcutils: remove unused "jstring.h".
Test: treehugger
Change-Id: I56989862a51a6c8785f22f783027d50c42be650c
2019-08-08 17:45:48 -07:00
Elliott Hughes
498163c28a Merge "Remove more dead code."
am: 0c2dab9adf

Change-Id: I52dbcba34d893573b3452c7b084af8840e5c1ec1
2019-08-08 12:40:55 -07:00
Elliott Hughes
1547e4a316 Remove more dead code.
Test: treehugger
Change-Id: I2b7f606241cde2c2743d8021fad00d30f7e0b0de
2019-08-07 14:52:16 -07:00
Tim Murray
41f261df25 Merge "cutils: add ashmem_init" am: 55ba959c13
am: 3d213c39e8

Change-Id: Ib9335109c0226c34dce479ee56a5f231d23f8d19
2019-04-05 03:02:02 -07:00
Tim Murray
8879ed7f2a cutils: add ashmem_init
Add a new ashmem_init function that only dlopens libashmemd_client.
This allows the library to be preloaded in the zygote.

Test: boots, works
Bug: 129543489

Change-Id: Ie106791edf381654f085203c266c9f9c0df35cfc
2019-04-04 17:30:25 -07:00
Elliott Hughes
15e370aced Merge "libcutils: android_reboot command should be unsigned." am: e3ec16b9c6 am: cf2f309cff
am: ba78d39cdc

Change-Id: I034c780c6c1166e4c6643ebcc607d3388246ebab
2019-04-02 19:52:28 -07:00
Elliott Hughes
66e5ae0f5a libcutils: android_reboot command should be unsigned.
Hex literals have the type of the first type they fit in. The reboot
constants are large enough that that's `unsigned` rather than `int`.

Bug: http://b/76110968
Test: treehugger
Change-Id: Iac4fe61d1fe572297febf0b57e34d698942469f9
2019-04-02 09:19:46 -07:00
The Android Open Source Project
4d916a1ece DO NOT MERGE - Merge PPRL.190305.001 into master
Bug: 127812889
Change-Id: I16a546dc24d3cf980ad7ab09895c0d97ee436224
2019-03-11 11:57:28 -07:00
Martijn Coenen
538e0b98c4 Update comments on native_handle_create.
To indicate limits.

Test: builds
Change-Id: Id5129a7f6a8f413911544dedeb02bb4e7a2f6e10
2019-03-06 14:22:10 +01:00
Suren Baghdasaryan
1bd127b72e DO NOT MERGE: Revert "Revert "libcutils: Move sched_policy functions into libprocessgroup""
This reverts commit b5394db682.

Reason for revert: AOSP is fixed with new vendor image

Change-Id: Ie1a2e0200600214a65f4fe2250c903c8e8ce0a29
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-01-25 16:49:09 +00:00
Suren Baghdasaryan
b5394db682 DO NOT MERGE: Revert "libcutils: Move sched_policy functions into libprocessgroup"
This reverts commit facd40d0e1.

Reason for revert: Broke AOSP

Change-Id: Id333417d4970ced800ab801bddfed880cafa056d
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-01-23 20:44:09 -08:00
Suren Baghdasaryan
facd40d0e1 libcutils: Move sched_policy functions into libprocessgroup
Move functions operating on cgroups from sched_policy.h in libcutils
into sched_policy_ctrl.h under libprocessgroup. This consolidates
cgroup-related functionality inside libprocessgroup.

Bug: 111307099
Test: builds, boots

Merged-In: Iba75f33281162b889989214d0325a5973d53ed2d
Change-Id: Iba75f33281162b889989214d0325a5973d53ed2d
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-01-22 18:18:48 +00:00
Suren Baghdasaryan
d17e357fa1 libcutils: Move sched_policy functions into libprocessgroup
Move functions operating on cgroups from sched_policy.h in libcutils
into sched_policy_ctrl.h under libprocessgroup. This consolidates
cgroup-related functionality inside libprocessgroup.

Bug: 111307099
Test: builds, boots

Change-Id: Iba75f33281162b889989214d0325a5973d53ed2d
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-01-17 18:18:34 -08:00
Martijn Coenen
20ac1203a3 Export maximum number of fds/ints in a native_handle.
So we can deserialize it consisently and safely.

Bug: 120084106
Test: builds
Change-Id: I0eafff70d3a7e4d732fe600a0052efb90108208d
2019-01-16 08:55:14 -08:00
TreeHugger Robot
1cb870f493 Merge "Add systrace tag for RRO" 2019-01-08 22:33:55 +00:00
Mårten Kongstad
ee9534515e Add systrace tag for RRO
Introduce a new systrace tag, TRACE_TAG_RRO, for use with runtime
resource overlay.

Bug: 119761810
Test: builds
Merged-In: I7b883d107a9ae2b12bbda04b74001a68e2a904aa
Change-Id: I7b883d107a9ae2b12bbda04b74001a68e2a904aa
2019-01-08 14:17:47 -08:00
Martijn Coenen
ad1fded66a Export maximum number of fds/ints in a native_handle. am: 02debfa2df am: 5fa5708025
am: 08ba9b1412

Change-Id: I8a4ebec9c608af10bcb1387fc5dfe9b0b6886f27
2019-01-04 10:58:38 -08:00
Martijn Coenen
08ba9b1412 Export maximum number of fds/ints in a native_handle. am: 02debfa2df
am: 5fa5708025

Change-Id: I7812acbfd43811e332513b9945432d23fba94187
2019-01-04 10:53:26 -08:00
Martijn Coenen
5fa5708025 Export maximum number of fds/ints in a native_handle.
am: 02debfa2df

Change-Id: I36da3de7dcad006ee647163a62b0d5c8819b994e
2019-01-04 10:46:21 -08:00
Mårten Kongstad
61e68cb8d7 Add systrace tag for RRO
Introduce a new systrace tag, TRACE_TAG_RRO, for use with runtime
resource overlay.

Bug: 119761810
Test: builds
Change-Id: I7b883d107a9ae2b12bbda04b74001a68e2a904aa
2019-01-02 13:11:21 -08:00
Tom Cherry
23319ebebf Start using new C++ Fstab class widely
Bug: 62292478
Test: boot
Test: adb-remount-test.sh

Change-Id: Id4715af4c1f03e2cfc67de92d3ea58e933685e51
2018-12-12 17:08:09 +00:00
Martijn Coenen
02debfa2df Export maximum number of fds/ints in a native_handle.
So we can deserialize it consisently and safely.

Bug: 120084106
Test: builds
Change-Id: I0eafff70d3a7e4d732fe600a0052efb90108208d
2018-12-11 11:38:41 +01:00
Elliott Hughes
396bf2109a libcutils: lose socket_peer_is_trusted to ART, the only user.
Bug: N/A
Test: builds
Change-Id: I599270729c2037b2c06d7906a5e5f7362fbbaf08
2018-10-25 13:24:08 -07:00