From 9c06d16ca3d230059ccf3b7f270574bc5e8fcfcb Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 4 Oct 2023 23:36:14 +0000 Subject: [PATCH] s/master/main/ Test: treehugger Change-Id: I2c975b2f5f92f23c7357b6f7e785578504298cc6 --- README.md | 4 ++-- android-changes-for-ndk-developers.md | 2 +- benchmarks/README.md | 2 +- docs/fdsan.md | 4 ++-- docs/fdtrack.md | 4 ++-- docs/native_allocator.md | 4 ++-- docs/status.md | 6 +++--- libc/include/android/api-level.h | 6 +++--- libc/include/malloc.h | 8 ++++---- libc/include/stdio.h | 2 +- libc/include/sys/cdefs.h | 4 ++-- libc/include/sys/mman.h | 2 +- libc/include/sys/sendfile.h | 2 +- libc/include/sys/types.h | 2 +- libc/include/unistd.h | 2 +- libc/malloc_debug/Config.cpp | 3 ++- libc/malloc_debug/README.md | 6 +++--- libc/malloc_debug/tests/malloc_debug_config_tests.cpp | 5 +++-- linker/linker.h | 2 +- 19 files changed, 36 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index aafbcff08..9a4493409 100644 --- a/README.md +++ b/README.md @@ -288,14 +288,14 @@ As mentioned above, this is currently a two-step process: Note that if you're actually just trying to expose device-specific headers to build your device drivers, you shouldn't modify bionic. Instead use -`TARGET_DEVICE_KERNEL_HEADERS` and friends described in [config.mk](https://android.googlesource.com/platform/build/+/master/core/config.mk#186). +`TARGET_DEVICE_KERNEL_HEADERS` and friends described in [config.mk](https://android.googlesource.com/platform/build/+/main/core/config.mk#186). ## Updating tzdata This is handled by the libcore team, because they own icu, and that needs to be updated in sync with bionic). See -[system/timezone/README.android](https://android.googlesource.com/platform/system/timezone/+/master/README.android). +[system/timezone/README.android](https://android.googlesource.com/platform/system/timezone/+/main/README.android). ## Verifying changes diff --git a/android-changes-for-ndk-developers.md b/android-changes-for-ndk-developers.md index ab3b24780..ef5d34dce 100644 --- a/android-changes-for-ndk-developers.md +++ b/android-changes-for-ndk-developers.md @@ -7,7 +7,7 @@ See also [bionic status](docs/status.md) for general libc/libm/libdl behavior changes. See also the -[unwinder documentation](https://android.googlesource.com/platform/system/unwinding/+/refs/heads/master/libunwindstack/AndroidVersions.md) +[unwinder documentation](https://android.googlesource.com/platform/system/unwinding/+/refs/heads/main/libunwindstack/AndroidVersions.md) for details about changes in stack unwinding (crash dumps) between different releases. diff --git a/benchmarks/README.md b/benchmarks/README.md index 1fd17a18f..3819b1a12 100644 --- a/benchmarks/README.md +++ b/benchmarks/README.md @@ -185,4 +185,4 @@ Some devices have a `perf-setup.sh` script that locks CPU and GPU frequencies. S benchmarks appear to be using the script. For more information: * run `get_build_var BOARD_PERFSETUP_SCRIPT` * run `m perf-setup` to install the script into `${OUT}/data/local/tmp/perf-setup.sh` - * see: https://android.googlesource.com/platform/platform_testing/+/refs/heads/master/scripts/perf-setup/ + * see: https://android.googlesource.com/platform/platform_testing/+/refs/heads/main/scripts/perf-setup/ diff --git a/docs/fdsan.md b/docs/fdsan.md index 66302999f..f5d1ab528 100644 --- a/docs/fdsan.md +++ b/docs/fdsan.md @@ -46,7 +46,7 @@ Assertion failures are probably the most innocuous result that can arise from th fdsan attempts to detect and/or prevent file descriptor mismanagement by enforcing file descriptor ownership. Like how most memory allocations can have their ownership handled by types such as `std::unique_ptr`, almost all file descriptors can be associated with a unique owner which is responsible for their closure. fdsan provides functions to associate a file descriptor with an owner; if someone tries to close a file descriptor that they don't own, depending on configuration, either a warning is emitted, or the process aborts. -The way this is implemented is by providing functions to set a 64-bit closure tag on a file descriptor. The tag consists of an 8-bit type byte that identifies the type of the owner (`enum android_fdan_owner_type` in [``](https://android.googlesource.com/platform/bionic/+/master/libc/include/android/fdsan.h)), and a 56-bit value. The value should ideally be something that uniquely identifies the object (object address for native objects and `System.identityHashCode` for Java objects), but in cases where it's hard to derive an identifier for the "owner" that should close a file descriptor, even using the same value for all file descriptors in the module can be useful, since it'll catch other code that closes your file descriptors. +The way this is implemented is by providing functions to set a 64-bit closure tag on a file descriptor. The tag consists of an 8-bit type byte that identifies the type of the owner (`enum android_fdan_owner_type` in [``](https://android.googlesource.com/platform/bionic/+/main/libc/include/android/fdsan.h)), and a 56-bit value. The value should ideally be something that uniquely identifies the object (object address for native objects and `System.identityHashCode` for Java objects), but in cases where it's hard to derive an identifier for the "owner" that should close a file descriptor, even using the same value for all file descriptors in the module can be useful, since it'll catch other code that closes your file descriptors. If a file descriptor that's been marked with a tag is closed with an incorrect tag, or without a tag, we know something has gone wrong, and can generate diagnostics or abort. @@ -62,7 +62,7 @@ fdsan has four severity levels: - fatal (`ANDROID_FDSAN_ERROR_LEVEL_FATAL`) - Abort upon detecting an error. -In Android Q, fdsan has a global default of warn-once. fdsan can be made more or less strict at runtime via the `android_fdsan_set_error_level` function in [``](https://android.googlesource.com/platform/bionic/+/master/libc/include/android/fdsan.h). +In Android Q, fdsan has a global default of warn-once. fdsan can be made more or less strict at runtime via the `android_fdsan_set_error_level` function in [``](https://android.googlesource.com/platform/bionic/+/main/libc/include/android/fdsan.h). The likelihood of fdsan catching a file descriptor error is proportional to the percentage of file descriptors in your process that are tagged with an owner. diff --git a/docs/fdtrack.md b/docs/fdtrack.md index 7cf6e1fe5..07c69b322 100644 --- a/docs/fdtrack.md +++ b/docs/fdtrack.md @@ -9,7 +9,7 @@ that's invoked on file descriptor operations, and a library that implements a hook to perform and store backtraces for file descriptor creation. ### bionic hooks -bionic provides a header in the `bionic_libc_platform_headers` header_lib at <[bionic/fdtrack.h](https://android.googlesource.com/platform/bionic/+/refs/heads/master/libc/platform/bionic/fdtrack.h)>. +bionic provides a header in the `bionic_libc_platform_headers` header_lib at <[bionic/fdtrack.h](https://android.googlesource.com/platform/bionic/+/refs/heads/main/libc/platform/bionic/fdtrack.h)>. Register a callback with `android_fdtrack_compare_exchange_hook` to receive callbacks upon file descriptor creation and destruction. This function can be called at any point in order to start capturing events, but be sure to properly @@ -18,7 +18,7 @@ context, but not vfork (bionic tracks whether a thread is vforked, and chooses not to call callbacks when this is the case). ### libfdtrack -[libfdtrack](https://android.googlesource.com/platform/bionic/+/refs/heads/master/libfdtrack) +[libfdtrack](https://android.googlesource.com/platform/bionic/+/refs/heads/main/libfdtrack) implements a library that uses libunwindstack to unwind and store fd creation backtraces. diff --git a/docs/native_allocator.md b/docs/native_allocator.md index 9fc9a31bc..13d973890 100644 --- a/docs/native_allocator.md +++ b/docs/native_allocator.md @@ -323,8 +323,8 @@ one after another. This will cause a lot of threads allocating at the same time. The trace data does not include timestamps, so it is not possible to create a completely accurate replay. -To generate these traces, see the [Malloc Debug documentation](https://android.googlesource.com/platform/bionic/+/master/libc/malloc_debug/README.md), -the option [record\_allocs](https://android.googlesource.com/platform/bionic/+/master/libc/malloc_debug/README.md#record_allocs_total_entries). +To generate these traces, see the [Malloc Debug documentation](https://android.googlesource.com/platform/bionic/+/main/libc/malloc_debug/README.md), +the option [record\_allocs](https://android.googlesource.com/platform/bionic/+/main/libc/malloc_debug/README.md#record_allocs_total_entries). To run these benchmarks, first copy the trace files to the target using these commands: diff --git a/docs/status.md b/docs/status.md index 3b4933b64..a9afe5570 100644 --- a/docs/status.md +++ b/docs/status.md @@ -11,7 +11,7 @@ for changes related to native code loading in various Android releases. ### POSIX You can see the current status with respect to POSIX in the form of tests: -https://android.googlesource.com/platform/bionic/+/master/tests/headers/posix/ +https://android.googlesource.com/platform/bionic/+/main/tests/headers/posix/ Some POSIX functionality is not supported by the Linux kernel, and is guarded with tests for `__linux__`. Other functionality is not @@ -53,7 +53,7 @@ list of POSIX functions implemented by glibc but not by bionic. ### libc -Current libc symbols: https://android.googlesource.com/platform/bionic/+/master/libc/libc.map.txt +Current libc symbols: https://android.googlesource.com/platform/bionic/+/main/libc/libc.map.txt New libc functions in V (API level 35): * `tcgetwinsize`, `tcsetwinsize` (POSIX Issue 8 additions). @@ -299,7 +299,7 @@ ndk-r21$ for i in `ls -1v platforms/android-*/arch-arm/usr/lib/libc.so` ; do \ ### libm -Current libm symbols: https://android.googlesource.com/platform/bionic/+/master/libm/libm.map.txt +Current libm symbols: https://android.googlesource.com/platform/bionic/+/main/libm/libm.map.txt 0 remaining missing C11/POSIX libm functions. diff --git a/libc/include/android/api-level.h b/libc/include/android/api-level.h index 6602e5de2..77ec6530b 100644 --- a/libc/include/android/api-level.h +++ b/libc/include/android/api-level.h @@ -40,7 +40,7 @@ * @brief Functions and constants for dealing with multiple API levels. * * See - * https://android.googlesource.com/platform/bionic/+/master/docs/defines.md. + * https://android.googlesource.com/platform/bionic/+/main/docs/defines.md. */ #include @@ -50,7 +50,7 @@ __BEGIN_DECLS /** * Magic version number for an Android OS build which has not yet turned * into an official release, for comparison against `__ANDROID_API__`. See - * https://android.googlesource.com/platform/bionic/+/master/docs/defines.md. + * https://android.googlesource.com/platform/bionic/+/main/docs/defines.md. */ #define __ANDROID_API_FUTURE__ 10000 @@ -91,7 +91,7 @@ __BEGIN_DECLS * * See android_get_device_api_level(), * android_get_application_target_sdk_version() and - * https://android.googlesource.com/platform/bionic/+/master/docs/defines.md. + * https://android.googlesource.com/platform/bionic/+/main/docs/defines.md. */ #define __ANDROID_API__ __ANDROID_API_FUTURE__ #endif diff --git a/libc/include/malloc.h b/libc/include/malloc.h index 6f992d984..d22b85ce5 100644 --- a/libc/include/malloc.h +++ b/libc/include/malloc.h @@ -361,7 +361,7 @@ int mallopt(int __option, int __value) __INTRODUCED_IN(26); * * Available since API level 28. * - * See also: [extra documentation](https://android.googlesource.com/platform/bionic/+/master/libc/malloc_hooks/README.md) + * See also: [extra documentation](https://android.googlesource.com/platform/bionic/+/main/libc/malloc_hooks/README.md) */ extern void* _Nonnull (*volatile _Nonnull __malloc_hook)(size_t __byte_count, const void* _Nonnull __caller) __INTRODUCED_IN(28); @@ -372,7 +372,7 @@ extern void* _Nonnull (*volatile _Nonnull __malloc_hook)(size_t __byte_count, co * * Available since API level 28. * - * See also: [extra documentation](https://android.googlesource.com/platform/bionic/+/master/libc/malloc_hooks/README.md) + * See also: [extra documentation](https://android.googlesource.com/platform/bionic/+/main/libc/malloc_hooks/README.md) */ extern void* _Nonnull (*volatile _Nonnull __realloc_hook)(void* _Nullable __ptr, size_t __byte_count, const void* _Nonnull __caller) __INTRODUCED_IN(28); @@ -383,7 +383,7 @@ extern void* _Nonnull (*volatile _Nonnull __realloc_hook)(void* _Nullable __ptr, * * Available since API level 28. * - * See also: [extra documentation](https://android.googlesource.com/platform/bionic/+/master/libc/malloc_hooks/README.md) + * See also: [extra documentation](https://android.googlesource.com/platform/bionic/+/main/libc/malloc_hooks/README.md) */ extern void (*volatile _Nonnull __free_hook)(void* _Nullable __ptr, const void* _Nonnull __caller) __INTRODUCED_IN(28); @@ -394,7 +394,7 @@ extern void (*volatile _Nonnull __free_hook)(void* _Nullable __ptr, const void* * * Available since API level 28. * - * See also: [extra documentation](https://android.googlesource.com/platform/bionic/+/master/libc/malloc_hooks/README.md) + * See also: [extra documentation](https://android.googlesource.com/platform/bionic/+/main/libc/malloc_hooks/README.md) */ extern void* _Nonnull (*volatile _Nonnull __memalign_hook)(size_t __alignment, size_t __byte_count, const void* _Nonnull __caller) __INTRODUCED_IN(28); diff --git a/libc/include/stdio.h b/libc/include/stdio.h index 2fc5b21b2..312b356ae 100644 --- a/libc/include/stdio.h +++ b/libc/include/stdio.h @@ -203,7 +203,7 @@ int renameat2(int __old_dir_fd, const char* _Nonnull __old_path, int __new_dir_f int fseek(FILE* _Nonnull __fp, long __offset, int __whence); long ftell(FILE* _Nonnull __fp); -/* See https://android.googlesource.com/platform/bionic/+/master/docs/32-bit-abi.md */ +/* See https://android.googlesource.com/platform/bionic/+/main/docs/32-bit-abi.md */ #if defined(__USE_FILE_OFFSET64) int fgetpos(FILE* _Nonnull __fp, fpos_t* _Nonnull __pos) __RENAME(fgetpos64) __INTRODUCED_IN(24); int fsetpos(FILE* _Nonnull __fp, const fpos_t* _Nonnull __pos) __RENAME(fsetpos64) __INTRODUCED_IN(24); diff --git a/libc/include/sys/cdefs.h b/libc/include/sys/cdefs.h index 4154e62af..a8fb6240a 100644 --- a/libc/include/sys/cdefs.h +++ b/libc/include/sys/cdefs.h @@ -38,7 +38,7 @@ /** * `__BIONIC__` is always defined if you're building with bionic. See - * https://android.googlesource.com/platform/bionic/+/master/docs/defines.md. + * https://android.googlesource.com/platform/bionic/+/main/docs/defines.md. */ #define __BIONIC__ 1 @@ -187,7 +187,7 @@ /* * _FILE_OFFSET_BITS 64 support. - * See https://android.googlesource.com/platform/bionic/+/master/docs/32-bit-abi.md + * See https://android.googlesource.com/platform/bionic/+/main/docs/32-bit-abi.md */ #if !defined(__LP64__) && defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64 # define __USE_FILE_OFFSET64 1 diff --git a/libc/include/sys/mman.h b/libc/include/sys/mman.h index f32ae61a0..823c9ba68 100644 --- a/libc/include/sys/mman.h +++ b/libc/include/sys/mman.h @@ -58,7 +58,7 @@ void* _Nonnull mmap(void* _Nullable __addr, size_t __size, int __prot, int __fla /** * mmap64() is a variant of mmap() that takes a 64-bit offset even on LP32. * - * See https://android.googlesource.com/platform/bionic/+/master/docs/32-bit-abi.md + * See https://android.googlesource.com/platform/bionic/+/main/docs/32-bit-abi.md */ void* _Nonnull mmap64(void* _Nullable __addr, size_t __size, int __prot, int __flags, int __fd, off64_t __offset); diff --git a/libc/include/sys/sendfile.h b/libc/include/sys/sendfile.h index a72091dfb..26522a6e5 100644 --- a/libc/include/sys/sendfile.h +++ b/libc/include/sys/sendfile.h @@ -38,7 +38,7 @@ __BEGIN_DECLS -/* See https://android.googlesource.com/platform/bionic/+/master/docs/32-bit-abi.md */ +/* See https://android.googlesource.com/platform/bionic/+/main/docs/32-bit-abi.md */ #if defined(__USE_FILE_OFFSET64) ssize_t sendfile(int __out_fd, int __in_fd, off_t* _Nullable __offset, size_t __count) __RENAME(sendfile64); #else diff --git a/libc/include/sys/types.h b/libc/include/sys/types.h index f07c8fdef..4622a4eeb 100644 --- a/libc/include/sys/types.h +++ b/libc/include/sys/types.h @@ -96,7 +96,7 @@ typedef __kernel_time_t __time_t; typedef __time_t time_t; /* This historical accident means that we had a 32-bit off_t on 32-bit architectures. */ -/* See https://android.googlesource.com/platform/bionic/+/master/docs/32-bit-abi.md */ +/* See https://android.googlesource.com/platform/bionic/+/main/docs/32-bit-abi.md */ #if defined(__USE_FILE_OFFSET64) || defined(__LP64__) typedef int64_t off_t; typedef off_t loff_t; diff --git a/libc/include/unistd.h b/libc/include/unistd.h index dcad63043..c8cceb21e 100644 --- a/libc/include/unistd.h +++ b/libc/include/unistd.h @@ -265,7 +265,7 @@ int dup3(int __old_fd, int __new_fd, int __flags); int fsync(int __fd); int fdatasync(int __fd); -/* See https://android.googlesource.com/platform/bionic/+/master/docs/32-bit-abi.md */ +/* See https://android.googlesource.com/platform/bionic/+/main/docs/32-bit-abi.md */ #if defined(__USE_FILE_OFFSET64) int truncate(const char* _Nonnull __path, off_t __length) __RENAME(truncate64); off_t lseek(int __fd, off_t __offset, int __whence) __RENAME(lseek64); diff --git a/libc/malloc_debug/Config.cpp b/libc/malloc_debug/Config.cpp index be577bc2f..77d2f02ca 100644 --- a/libc/malloc_debug/Config.cpp +++ b/libc/malloc_debug/Config.cpp @@ -409,7 +409,8 @@ bool Config::VerifyValueEmpty(const std::string& option, const std::string& valu void Config::LogUsage() const { error_log("For malloc debug option descriptions go to:"); - error_log(" https://android.googlesource.com/platform/bionic/+/master/libc/malloc_debug/README.md"); + error_log( + " https://android.googlesource.com/platform/bionic/+/main/libc/malloc_debug/README.md"); } bool Config::GetOption(const char** options_str, std::string* option, std::string* value) { diff --git a/libc/malloc_debug/README.md b/libc/malloc_debug/README.md index fddc4a3de..37fafa76f 100644 --- a/libc/malloc_debug/README.md +++ b/libc/malloc_debug/README.md @@ -170,7 +170,7 @@ backtrace\_max\_size will be backtraced. The backtrace\_size option overrides this option, and should not be used at the same time. This option can also be used in combination with other tools such -as [libmemunreachable](https://android.googlesource.com/platform/system/memory/libmemunreachable/+/master/README.md) +as [libmemunreachable](https://android.googlesource.com/platform/system/memory/libmemunreachable/+/main/README.md) to only get backtraces for sizes of allocations listed as being leaked. ### backtrace\_max\_size=ALLOCATION\_SIZE\_BYTES @@ -183,7 +183,7 @@ backtrace\_max\_size will be backtraced. The backtrace\_size option overrides this option, and should not be used at the same time. This option can also be used in combination with other tools such -as [libmemunreachable](https://android.googlesource.com/platform/system/memory/libmemunreachable/+/master/README.md) +as [libmemunreachable](https://android.googlesource.com/platform/system/memory/libmemunreachable/+/main/README.md) to only get backtraces for sizes of allocations listed as being leaked. ### backtrace\_size=ALLOCATION\_SIZE\_BYTES @@ -192,7 +192,7 @@ that only allocations of size **ALLOCATION\_SIZE\_BYTES** will be backtraced. This option overrides the backtrace\_min\_size and the backtrace\_max\_size. This option can also be used in combination with other tools such -as [libmemunreachable](https://android.googlesource.com/platform/system/memory/libmemunreachable/+/master/README.md) +as [libmemunreachable](https://android.googlesource.com/platform/system/memory/libmemunreachable/+/main/README.md) to only get backtraces for sizes of allocations listed as being leaked. ### backtrace\_full diff --git a/libc/malloc_debug/tests/malloc_debug_config_tests.cpp b/libc/malloc_debug/tests/malloc_debug_config_tests.cpp index bc7af6d2e..a911e76d5 100644 --- a/libc/malloc_debug/tests/malloc_debug_config_tests.cpp +++ b/libc/malloc_debug/tests/malloc_debug_config_tests.cpp @@ -40,8 +40,9 @@ class MallocDebugConfigTest : public ::testing::Test { }; std::string usage_string( - "6 malloc_debug For malloc debug option descriptions go to:\n" - "6 malloc_debug https://android.googlesource.com/platform/bionic/+/master/libc/malloc_debug/README.md\n"); + "6 malloc_debug For malloc debug option descriptions go to:\n" + "6 malloc_debug " + "https://android.googlesource.com/platform/bionic/+/main/libc/malloc_debug/README.md\n"); TEST_F(MallocDebugConfigTest, unknown_option) { diff --git a/linker/linker.h b/linker/linker.h index a80342479..f5bb0ec4d 100644 --- a/linker/linker.h +++ b/linker/linker.h @@ -72,7 +72,7 @@ class VersionTracker { }; static constexpr const char* kBionicChangesUrl = - "https://android.googlesource.com/platform/bionic/+/master/" + "https://android.googlesource.com/platform/bionic/+/main/" "android-changes-for-ndk-developers.md"; soinfo* get_libdl_info(const soinfo& linker_si);