summaryrefslogtreecommitdiffstats
path: root/libsync
Commit message (Collapse)AuthorAgeFilesLines
* Merge libsync_recovery rules into libsync.Tao Bao2018-08-071-10/+2
| | | | | | | | | Statically linking against libsync is no longer a concern, since libsync has supported the modern sync ABI (which is frozen upstream) after the recent cleanup works. Test: `m dist` with aosp_taimen-userdebug Change-Id: Ic162bc7ff7c9dd306658d11d4b71e2d18730a2ee
* Make libadf, libsync_recovery recovery_available.Jerry Zhang2018-08-071-0/+1
| | | | | | Bug: 110380063 Test: `m dist` with aosp_taimen-userdebug Change-Id: Ie3543ff89b6b4f0de04eff0f85f8001f4b27d86a
* NDK: add availability comments to <sync.h>.Elliott Hughes2018-07-271-1/+11
| | | | | | Bug: N/A Test: N/A Change-Id: I0cc16cc9c32c6679098aa875d5f81829215868d4
* Restore the libsync __ANDROID_API__ guardRyan Prichard2018-07-191-0/+5
| | | | | | | | Partially reverts 2a358106b7e554396088506e8e817520e2882aee Bug: http://b/111668906 Test: m Change-Id: Ic35091e10edda12a97992fbeffefda7ddf1305a1
* Merge "libsync: add __INTRODUCED_IN annotations."Elliott Hughes2018-06-151-7/+3
|\
| * libsync: add __INTRODUCED_IN annotations.Elliott Hughes2018-06-141-7/+3
| | | | | | | | | | | | Bug: https://github.com/android-ndk/ndk/issues/706 Test: N/A Change-Id: I8a4f98f2c929e28d81672d7e2e0d5dd63d27c7a6
* | sync: remove legacy sync info APIJesse Hall2018-06-133-20/+52
|/ | | | | | | | | | | | | | | | | | The legacy fence/pt info API has been deprecated for a while. This change removes it from headers, so remaining users will have to switch to the modern API when they're re-compiled. The functions are still provided by libsync.so and tests remain, so existing binaries should continue to work. Eventually these will be removed too, though, once it's reasonable to expect those binaries to have been recompiled. This reverts commit eed25df46a22a143a0341113759894c23a9b6cbf, which reverted the previous attempt in commit 798ba95bda14f9f28561a2a27ba406537f8bb8a8 now that more users of the legacy API have been converted. Bug: 35326015 Test: make checkbuild Test: adb shell dumpsys SurfaceFlinger --latency
* Merge "libsync: OWNERS."Treehugger Robot2018-06-051-0/+3
|\
| * libsync: OWNERS.Elliott Hughes2018-06-051-0/+3
| | | | | | | | | | | | | | | | Based on git shortlog and my memory. Bug: N/A Test: N/A Change-Id: I2e821a1214c349fd75f2971f632de3d30c602b83
* | Revert "sync: remove legacy sync info API"Marissa Wall2018-06-053-52/+20
| | | | | | | | | | | | | | | | | | This reverts commit 798ba95bda14f9f28561a2a27ba406537f8bb8a8. Brodcom uses the sync_fence_info_data directly. https://android-build.googleplex.com/builds/submitted/4821789/elfin-userdebug/latest/view/logs/build_error.log Change-Id: I72fed683397e9b10007b71253e20ded43726d377
* | sync: remove legacy sync info APIJesse Hall2018-05-233-20/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The legacy fence/pt info API has been deprecated for a while. This change removes it from headers, so remaining users will have to switch to the modern API when they're re-compiled. The functions are still provided by libsync.so and tests remain, so existing binaries should continue to work. Eventually these will be removed too, though, once it's reasonable to expect those binaries to have been recompiled. Bug: 35326015 Test: make checkbuild Test: adb shell dumpsys SurfaceFlinger --latency Change-Id: Id086fafe37c2bc1cfdca4a21107bc9208ed61f89
* | Remove obsolete sync_test.cJesse Hall2018-05-232-154/+0
|/ | | | | | | | Tests in this file depends on long out-of-date behavior of the sync api. More current tests are in tests/sync_test.cpp. Test: quis custodiet ipsos custodes? Change-Id: Ia0a0970dde17c1ae4e1d79fac1a9fe3b54e8fcd6
* Add missing @addtogroup tags.Dan Albert2018-04-131-0/+11
| | | | | | | | | | These NDK docs weren't in any groups, so they don't show up in the new site. Test: https://irina-dot-devsite.googleplex.com/ndk/reference/group/logging Test: https://irina-dot-devsite.googleplex.com/ndk/reference/group/sync Bug: http://b/77236573 Change-Id: I300f96585dec94359ecf96fbf39c6dc3ec4579e5
* Merge "libsync: Add fence info tests"Treehugger Robot2017-09-261-0/+35
|\
| * libsync: Add fence info testsAlexandros Frantzis2017-09-261-0/+35
| | | | | | | | | | | | | | | | | | | | This patch adds regression tests to check that the fence info returned by libsync contains valid data. Test: sync-unit-tests Change-Id: I0c57c49b7be563efc9a43f12381059f20e0a4e52 Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
* | sync: store the num_fences from first SYNC_IOC_FILE_INFOSaurabh Shah2017-09-251-0/+2
|/ | | | | | | | | | | | Fixes a bug with the signal time of devices using the modern sync file interface. The bug only affects kernels running an Android kernel 4.9 and later. b/63395253 Test: tests/sync_test.cpp Change-Id: I6fb00bcb8e16a3268c357153edd8e35a44546caa
* Mark libsync as LL-NDKJiyong Park2017-09-152-9/+10
| | | | | | | | | | | | | | | | | | | | libsync is used both by platform (e.g. libui.so) and by same-process HALs (e.g. android.hardware.graphics.mapper@2.0-impl.so). Therefore it is eligible for either VNDK-SP or LL-NDK. Among the two choices, LL-NDK was selected because it is already an NDK and is just a thin wrapper around a few kernel ioctls. However, since libui (which is a vendor_available:true library) is using more symbols that are not available to NDK clients, the extra symbols are exposed as # vndk tag so that they are only available to VNDK clients, but not to NDK clients. Bug: 63866913 Test: BOARD_VNDK_VERSION=current m -j successful (2017 pixel) Test: the built image is bootable Merged-In: I60f883c049bd9b4562e6ce34d34ead47ba28af5f Change-Id: I60f883c049bd9b4562e6ce34d34ead47ba28af5f (cherry picked from commit 058e0919f6aff67d32d00591a7040fc069c6e40f)
* Fix NDK libsync to match ndk/sync.hJesse Hall2017-09-151-2/+2
| | | | | | | | | | | The header names were changed during review, but the library map file wasn't updated. Bug: 62229958 Test: CtsGraphicsTestCases:android.graphics.cts.SyncTest Merged-In: Ie5955865667b35067f1ee209933f159f170419cd Change-Id: Ie5955865667b35067f1ee209933f159f170419cd (cherry picked from commit 59d9ee5d020c54d89cbb520b30fa19765a68646d)
* libsync: Fix a double-free.George Burgess IV2017-09-051-1/+0
| | | | | | | | | | | sync_file_info, the only caller of legacy_fence_info_to_sync_file_info, unconditionally frees legacy_info after legacy_fence_info_to_sync_file_info is called. So, if this calloc fails, we'll end up freeing legacy_info twice. Bug: 27101951 Test: mma. Static analyzer complaint about double-free is gone. Change-Id: I43bf820af9aadf30cb8eabce57416f69a8fccf89
* Merge "Remove LOCAL_CLANG and clang: true"Lennart Wieboldt2017-07-251-1/+0
|\ | | | | | | | | | | am: 80ec81cf4b Change-Id: Ia7f79d8e25ee9870fe44d198568d0e5dabdff811
| * Remove LOCAL_CLANG and clang: trueLennart Wieboldt2017-07-251-1/+0
| | | | | | | | | | | | | | | | clang is the default compiler since Android nougat Test: mma & verified it´s still build with clang Change-Id: I34adaeef2f6558a09f26027271222bad94780507 Signed-off-by: Lennart Wieboldt <lennart.1997@gmx.de>
| * libsync: vendor_availableSteven Moreland2017-04-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By setting vendor_available, the following may become true: * a prebuilt library from this release may be used at runtime by in a later releasse (by vendor code compiled against this release). so this library shouldn't depend on runtime state that may change in the future. * this library may be loaded twice into a single process (potentially an old version and a newer version). The symbols will be isolated using linker namespaces, but this may break assumptions about 1 library in 1 process (your singletons will run twice). Background: This means that these modules may be built and installed twice -- once for the system partition and once for the vendor partition. The system version will build just like today, and will be used by the framework components on /system. The vendor version will build against a reduced set of exports and libraries -- similar to, but separate from, the NDK. This means that all your dependencies must also mark vendor_available. At runtime, /system binaries will load libraries from /system/lib*, while /vendor binaries will load libraries from /vendor/lib*. There are some exceptions in both directions -- bionic(libc,etc) and liblog are always loaded from /system. And SP-HALs (OpenGL, etc) may load /vendor code into /system processes, but the dependencies of those libraries will load from /vendor until it reaches a library that's always on /system. In the SP-HAL case, if both framework and vendor libraries depend on a library of the same name, both versions will be loaded, but they will be isolated from each other. It's possible to compile differently -- reducing your source files, exporting different include directories, etc. For details see: https://android-review.googlesource.com/368372 None of this is enabled unless the device opts into the system/vendor split with BOARD_VNDK_VERSION := current. Bug: 33241851 Test: build and flash internal marlin Test: m -j libsync Test: build with BOARD_VNDK_VERSION := current (cherry picked from commit d0b26edf309cc090569dae65aa3ab6bf8361b020) Merged-In: I5b23d2c1f41b842e5a9b7ea257921133b80c3f98 Change-Id: I5b23d2c1f41b842e5a9b7ea257921133b80c3f98
* | libsync: ndk: Fix compilation in C mode.Alistair Strachan2017-04-141-2/+1
| | | | | | | | | | | | | | | | | | Use of 'inline' without 'static' may allow the C compiler to uninline it within the compilation unit, depending on the C standard level. Always using 'static inline' avoids this problem. Test: build + boot to launcher Change-Id: Ifb6e1fa6b84286067ddc2daca4c8942c410e56ab
* | libsync: vendor_availableSteven Moreland2017-04-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By setting vendor_available, the following may become true: * a prebuilt library from this release may be used at runtime by in a later releasse (by vendor code compiled against this release). so this library shouldn't depend on runtime state that may change in the future. * this library may be loaded twice into a single process (potentially an old version and a newer version). The symbols will be isolated using linker namespaces, but this may break assumptions about 1 library in 1 process (your singletons will run twice). Background: This means that these modules may be built and installed twice -- once for the system partition and once for the vendor partition. The system version will build just like today, and will be used by the framework components on /system. The vendor version will build against a reduced set of exports and libraries -- similar to, but separate from, the NDK. This means that all your dependencies must also mark vendor_available. At runtime, /system binaries will load libraries from /system/lib*, while /vendor binaries will load libraries from /vendor/lib*. There are some exceptions in both directions -- bionic(libc,etc) and liblog are always loaded from /system. And SP-HALs (OpenGL, etc) may load /vendor code into /system processes, but the dependencies of those libraries will load from /vendor until it reaches a library that's always on /system. In the SP-HAL case, if both framework and vendor libraries depend on a library of the same name, both versions will be loaded, but they will be isolated from each other. It's possible to compile differently -- reducing your source files, exporting different include directories, etc. For details see: https://android-review.googlesource.com/368372 None of this is enabled unless the device opts into the system/vendor split with BOARD_VNDK_VERSION := current. Bug: 33241851 Test: build and flash internal marlin Test: m -j libsync Test: build with BOARD_VNDK_VERSION := current Change-Id: I5b23d2c1f41b842e5a9b7ea257921133b80c3f98
* | Remove .(ll)ndk suffix from (ll)ndk_librarySteven Moreland2017-04-101-1/+1
| | | | | | | | | | | | | | | | | | | | Soong handles these automatically now. Bug: 33241851 Test: Android-aosp_arm.mk is the same before/after Test: build.ninja is the same before/after Test: build-aosp_arm.ninja is the same before/after Change-Id: Ia039812817495c00e450eec7292447d5e8f93adb
* | sync: Cache knowledge of kernel uapi versionJesse Hall2017-03-081-21/+95
| | | | | | | | | | | | | | | | | | | | | | Previously all libsync calls would try first the modern/mainline uapi and if that failed try the legacy uapi, or vice versa. This is inefficient, and confusing when looking at strace. With this change, after the first successful syscall, libsync know's what uapi version the kernel supports, and will only try that version in the future. Test: sync-unit-tests on bullhead Change-Id: I8b5de0194da0cfc6c080c0180318e16bb673d3c9
* | sync: rename sync/sync.h to android/sync.hJesse Hall2017-02-235-65/+73
| | | | | | | | | | | | | | | | | | Leave a temporary symlink from the old name to avoid having to change all dependencies simultaneously. Bug: 1901466 Test: m Change-Id: Id210f0091457e52e1a6e048d241a723bdbe8779b
* | sync: move declarations from sync/sync.h to sync.cJesse Hall2017-02-232-53/+39
| | | | | | | | | | | | | | None of these should be needed or used outside of sync.c. Test: lunch bullhead-eng ; m Change-Id: I548a499d0e2ada2ab4987e63a8116327c3be0076
* | sync: implement sync_file_infoJesse Hall2017-02-232-8/+104
| | | | | | | | | | | | | | | | | | Also modifies sync-unit-test to use sync_file_info instead of the deprecated sync_fence_info, but check that they match in several tests. Bug: 35138793 Test: sync-unit-tests on bullhead Change-Id: Ic672d1c89798435a8b71469500e82c770a66bf4d
* | sync: refactor sync_fence_infoJesse Hall2017-02-231-36/+60
| | | | | | | | | | | | | | | | | | Split the sync_fence_info implementation into multiple functions. This clarifies the logic, and allows the parts to be reused in the upcoming sync_file_info function. Test: sync-unit-tests on bullhead Change-Id: I0ea37067dddf41b831670f08eb99e0b7fd52adce
* | sync: Add NDK sync.h and libsyncJesse Hall2017-02-235-61/+338
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new header provides an updated interface to libsync appropriate for the NDK. Clients use existing syscalls where possible (e.g. poll() instead of sync_wait()), and the remaining functions return structures used in mainline Linux kernels rather than the Android staging sync framework. Over time, framework clients will be migrated to using the NDK interface, which will eventually replace the current internal interface. The only difference is the header will be named <android/sync.h> in the NDK and <sync/sync.h> internally. Bug: 35138793 Test: sync-unit-tests on bullhead Change-Id: Ieb3649b80565393e26b604416158438d32c2a256
* | sync: Use correct type in size calculationJesse Hall2017-02-231-1/+1
|/ | | | | | | | | | The previous and current types are the same size, so this wouldn't have caused a bug in practice, but it is confusing, and would have been a problem in the unlikely event we changed the size of one of the types. Test: sync-unit-tests on bullhead Change-Id: Ic43b81f3b4ff214af86b6b6d4d02c648f95d0c4b
* libsync: Replace inserting tuple into unordered_map in favour of pair.mtezych2017-01-301-3/+3
| | | | | | | | Inserting tuple into unordered_map relies on non standard libc++ extension: http://stackoverflow.com/a/21313229 This change removes this dependency. Test: sync-unit-tests (on hikey with SW_SYNC_USER built into kernel)
* libsync: tests: redefine PollOnDestroyedTimeline()Gustavo Padovan2017-01-171-2/+1
| | | | | | | | | | On mainline if the sw_sync timeline is destroyed the fences doesn't not signal or error. So change the test to check if the fence is still there by polling the fence with timeout zero and asserting if it is not signalled. Test: Sync unit tests still passes. Change-Id: Icb8e629018eef35074ae91d0f29ed1f12e90492b
* libsync: tests: remove WaitOnDestroyedTimeline testGustavo Padovan2017-01-171-27/+0
| | | | | | | | The mainline Sync File implementation doesn't have wait ioctl anymore. Only poll is supported now, and we already have a test for that. Test: Sync unit tests still passes. Change-Id: Iadde7b2173024af9b8d20316e640297cf214c645
* libsync: add support to new Sync APIGustavo Padovan2017-01-171-17/+109
| | | | | | | | | | | | | Change libsync functions in a way that it can run dynamically on both APIs. v2: fix whitespace changes and poll return handling v3: handle error cases on sync_wait() Test: Sync unit tests still passes. Change-Id: I743ab92ce39cbfa75dca41dd0a435efa9f2aab66 hange-Id: Ib56f2c6441b41028bc9f66998676790b7713988a
* libsync: open new location of sw_sync fileGustavo Padovan2017-01-171-1/+7
| | | | | | | | | sw_sync file for debug was moved to debugfs. Try to open it and if it fails try to open /dev/sw_sync. Test: Sync unit tests still passes. Change-Id: Ie078fbc2eb5294f28b916a9e65b7fcd3a18a8580 hange-Id: I216874964368d939bed2779d98cd89e527a57d45
* libsync: add new Sync kernel APIGustavo Padovan2017-01-171-0/+60
| | | | | | | | | | Add the new API to the internal sync.h file. As there is two different APIs we will need to discovery dynamically which one to use. v2: Fix Documentation Test: Sync unit tests still passes. Change-Id: I2ab3cd46e48ba5d9c73d54f9583b1a8141566581
* libsync: move kernel headers for sync ioctls to sync.hGustavo Padovan2017-01-172-17/+54
| | | | | | | | This patch moves the legacy API to the internal sync.h header and add documentation to it. Test: Sync unit tests still passes. Change-Id: I9b17eb23af30043b3df5fb9e857affad68ba8521
* Update for kernel headers v4.8.14.Christopher Ferris2016-12-121-2/+10
| | | | | | | | Update sync.c to include the structurs from sw_sync.h. This uapi header has been deleted. Test: Built mips/arm/arm64/x86/x86_64. Built and booted angler. Change-Id: I2495cb17b35f697fb8a2a00f6633ccb53f78293f
* Rely on the platform -std default.Elliott Hughes2016-10-101-1/+0
| | | | | | Bug: http://b/32019064 Test: builds Change-Id: I18a1d816d63b64601485045070851f32d44e85eb
* Merge "Convert to Android.bp"Treehugger Robot2016-08-293-59/+42
|\
| * Convert to Android.bpDan Willemsen2016-08-263-59/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See build/soong/README.md for more information. I tested the following tests on a Nexus9 and linux host, and they continued to pass: /data/nativetest{,64}/bootstat_tests/bootstat_tests out/host/linux-x86/bin/nativetest{,64}/bootstat_tests/bootstat_tests /data/nativetest64/memunreachable_test/memunreachable_test out/host/linux-x86/bin/nativetest{,64}/memunreachable_test/memunreachable_test These continue to fail just like before this change: /data/nativetest{,64}/sync_test/sync_test (was /system/bin/sync_test) /data/nativetest{,64}/sync-unit-test/sync-unit-test /data/nativetest/memunreachable_test/memunreachable_test Test: See above Change-Id: I691e564e0cf008dd363e3746223b153d712e024d
* | Update for kernel headers v4.7.2.Christopher Ferris2016-08-261-1/+15
|/ | | | | | | | | | The new uapi kernel headers added a new SEGV reason code, so add it to the tombstone code. Update sync.c to include the needed data structures itself. Someone else will be fixing this to work on old versus new kernels. Change-Id: Icb27713ea38a20003c7671a9bca262eebd96099b
* libsync: add static library for recoveryGreg Hackmann2016-08-051-0/+12
| | | | | Change-Id: If43188c3b4b16c698c077338ea0ef1dfd16b9c56 Signed-off-by: Greg Hackmann <ghackmann@google.com>
* libsync: remove unused liblog dependencyGreg Hackmann2016-08-051-2/+0
| | | | | Change-Id: I69840ece3f13809b2440edbe6cfa412a56aee4aa Signed-off-by: Greg Hackmann <ghackmann@google.com>
* Cleanup uses of sprintf so we can deprecate it.George Burgess IV2016-03-071-2/+2
| | | | | | | | Also cleans up two instances of open() with useless mode params, and changes a few uses of snprintf to use sizeof(buffer) instead of hardcoded buffer sizes. Change-Id: If11591003d910c995e72ad8f75afd072c255a3c5
* Fix isValid() condition for libsync testsTom Cherry2015-11-051-2/+2
| | | | | | | | Upstream modifications in K3.12 to the sw_sync driver set O_CLOEXEC on the fd's returned by the SW_SYNC_IOC_CREATE_FENCE ioctl, therefore we check the return of fcntl() for a non-negative value instead of strictly 0. Change-Id: If4c82750fcc0aa3a57f243fa2a94691e3150e4a4
* Remove LOCAL_ADDITIONAL_DEPENDENCIES in cases where it's not needed.Elliott Hughes2015-04-021-1/+0
| | | | Change-Id: I720b8ef1050da45a7833adef8219b6acb2cf3a38
* Remove uses of libcxx.mk.Dan Albert2015-03-271-1/+0
| | | | | | This is a no-op. Change-Id: Iecbcd5f6d818abbf98767a2e996c10f454b652e4