Commit graph

39235 commits

Author SHA1 Message Date
Elliott Hughes
22743e3a7e Merge "Reduce duplication in the NOTICE file." into main 2023-10-05 00:38:52 +00:00
Treehugger Robot
041ddf78bf Merge "Update the benchmarks/NOTICE file." into main 2023-10-05 00:08:08 +00:00
Elliott Hughes
7ee0b316a5 Update the benchmarks/NOTICE file.
Test: treehugger
Change-Id: I8cbf378dd746da9e97b56a0110f86a7cc4043671
2023-10-04 22:28:49 +00:00
Elliott Hughes
73e37b535a Reduce duplication in the NOTICE file.
Test: treehugger
Change-Id: I8a9c4f22534330dd498636a155b872bd2d2af5b6
2023-10-04 22:28:27 +00:00
Treehugger Robot
ae31683086 Merge "Create a filegroup for versioner dependencies" into main 2023-10-04 01:08:11 +00:00
Elliott Hughes
45c7ae46d5 Merge "riscv64: add vector stpcpy()." into main 2023-10-03 17:49:06 +00:00
Elliott Hughes
3d84338eb7 riscv64: add vector stpcpy().
Bug: https://github.com/google/android-riscv64/issues/107
Test: treehugger
Change-Id: Ic1fb9da974769d2767ea2c092a2e97e095612e6e
2023-10-03 00:39:42 +00:00
Suren Baghdasaryan
706e228154 Merge "Add mmap syscall benchmarks" into main 2023-09-30 20:51:48 +00:00
Spandan Das
8fce52a3b3 Create a filegroup for versioner dependencies
As part of the build, soong runs the following cmd
```
$ versioner -o <out_dir> bionic/libc/include
bionic/libc/versioner-dependencies
```

To migrate this action to Bazel, create a filegroup module for
`bionic/libc/versioner-dependencies`. In Bazel builds, this target will
be copied to the Bazel's sandbox and placed on the include path when
running versioner. This should be a no-op in Soong.

`bionic/libc/versioner-dependencies` is a collection of symlinks, some of
which point to `prebuilts/clang-tools`. Bazel supports incremental
builds with symlinks out-of-the-box, so we do not need to add special
handling for this directory.

Bug: 301169067
Test: m nothing
Change-Id: I7cbb92e2248c194038a5690c81fed945dee61ccc
2023-09-29 23:49:53 +00:00
Elliott Hughes
e7944a5b8b Merge "Don't memset() in the soinfo constructor." into main 2023-09-29 20:52:31 +00:00
Suren Baghdasaryan
9a0a360ed6 Add mmap syscall benchmarks
Add benchmarks to monitor performance of the syscalls which are frequently
used in Android. These benchmarks will help Android kernel team to catch
syscall performance regressions and flagging them early. They can also
be used to compare different kernel versions.
Add mmap/munmap syscall benchmarks as a starting point. mmap and munmap
are among most frequently used syscall in Andoird. Specific parameters
were also chosen based on the frequency of their use in Android.

Bug: 283058897
Test: local build and run
Change-Id: If8e53305174532dd698706ccd20e4b800d8720d7
2023-09-29 20:24:47 +00:00
Elliott Hughes
b003e10f97 Don't memset() in the soinfo constructor.
LinkerBlockAllocator::alloc() always does a memset() anyway, and soinfo
contains non-POD types, so this seems both unnecessary and questionable.

Bug: http://b/298741930
Test: treehugger
Change-Id: I2b5a3858c8506c6086dfd59cbe729afb5b9ffa1c
2023-09-29 17:09:02 +00:00
Christopher Ferris
61cd1428b4 Merge "Match new google benchmark help output." into main 2023-09-29 01:08:43 +00:00
Christopher Ferris
3df5b76a4e Match new google benchmark help output.
Bug: 302324720

Test: Tests pass on a raven device.
Change-Id: I0766c4799c47f58e6cafa340bc8e76f68f4898ee
2023-09-28 13:30:49 -07:00
Treehugger Robot
51be22c28d Merge "Consistently use #if defined(__BIONIC__)." into main 2023-09-28 20:17:02 +00:00
Elliott Hughes
fc1b3b8b7e Merge "Use strerrorname_np() in ASSERT_ERRNO()." into main 2023-09-28 20:03:47 +00:00
Treehugger Robot
760eeffc54 Merge "Remove an obsolete TODO now we have a new clang." into main 2023-09-28 18:27:12 +00:00
Elliott Hughes
e7943f8b95 Consistently use #if defined(__BIONIC__).
Test: treehugger
Change-Id: I844b909404532eb9165cba1ed6f237bdd4a46990
2023-09-28 10:47:51 -07:00
Elliott Hughes
11069030d6 Remove an obsolete TODO now we have a new clang.
Test: treehugger
Change-Id: I19751fe73f4cd3400005d0ccad0bccb0a74f6fc8
2023-09-28 08:22:26 -07:00
Elliott Hughes
d2250edc10 Use strerrorname_np() in ASSERT_ERRNO().
Hopefully this is totally unambiguous and non-confusing output:
```
Expected equality of these values:
  Errno(22)
    Which is: EINVAL
  Errno((*__errno()))
    Which is: ENOSYS
```

Test: treehugger
Change-Id: Iefe6a8a6447e76681c18256d2713e2c527081c75
2023-09-28 08:15:36 -07:00
Elliott Hughes
a67fe1b171 Merge "Add strerrordesc_np() and strerrorname_np()." into main 2023-09-27 22:26:37 +00:00
Elliott Hughes
2109f12c3b Add strerrordesc_np() and strerrorname_np().
strerrordesc_np() isn't very useful (being just another name for
strerror()), but strerrorname_np() lets you get "ENOSYS" for ENOSYS,
which will make some of our test assertion messages clearer when we
switch over from strerror().

This also adds `%#m` formatting to all the relevant functions.

Test: treehugger
Change-Id: Icfe07a39a307d591c3f4f2a09d008dc021643062
2023-09-27 11:21:12 -07:00
Elliott Hughes
8ee1793e50 Merge "Clean up how we skip tests when a syscall isn't in the kernel." into main 2023-09-25 22:37:15 +00:00
Treehugger Robot
732b98203b Merge "<sys/statvfs.h>: add a new mount option." into main 2023-09-23 00:36:55 +00:00
Elliott Hughes
4ae4be9263 Clean up how we skip tests when a syscall isn't in the kernel.
The close_range() test in particular has been confusing a lot of
partners. I think the sys_epoll_test.cpp idiom is the clearest of the
ones in use, so let's use that everywhere. (I haven't actually touched
the SysV IPC tests, because if we do touch them, _deleting_ them --
since all those syscalls are not allowed on Android -- is probably the
change to be made!)

I'm on the fence about factoring this idiom out into a macro. There
should never be too many of these, and we should probably be removing
them? Is anyone still running the current bionic tests on 4.3 kernels
without membarrier(2), and if they are --- why?!

For now though, I haven't removed any of our existing tests; I've just
moved them over to the sys_epoll_test.cpp style.

Test: treehugger
Change-Id: Ie69a0bb8f416c79957188e187610ff8a3c4d1e8f
2023-09-22 17:15:25 -07:00
Elliott Hughes
6711d21230 <sys/statvfs.h>: add a new mount option.
This flag was added as part of
https://sites.google.com/a/chromium.org/dev/chromium-os/chromiumos-design-docs/hardening-against-malicious-stateful-data#TOC-Restricting-symlink-traversal
in 2020.

Annoyingly, these flags are in include/linux/statvfs.h rather than in
the uapi headers, so we don't get them for free.

Test: treehugger
Change-Id: I55c0dcc8a5da17c3efc8938ec04f23f157764d4d
2023-09-22 19:48:05 +00:00
Elliott Hughes
68011a4ac7 Merge "Add ASSERT_ERRNO and EXPECT_ERRNO (and use them)." into main 2023-09-22 14:53:52 +00:00
Elliott Hughes
95646e6666 Add ASSERT_ERRNO and EXPECT_ERRNO (and use them).
We've talked about this many times in the past, but partners struggle to
understand "expected 38, got 22" in these contexts, and I always have to
go and check the header files just to be sure I'm sure.

I actually think the glibc geterrorname_np() function (which would
return "ENOSYS" rather than "Function not implemented") would be more
helpful, but I'll have to go and implement that first, and then come
back.

Being forced to go through all our errno assertions did also make me
want to use a more consistent style for our ENOSYS assertions in
particular --- there's a particularly readable idiom, and I'll also come
back and move more of those checks to the most readable idiom.

I've added a few missing `errno = 0`s before tests, and removed a few
stray `errno = 0`s from tests that don't actually make assertions about
errno, since I had to look at every single reference to errno anyway.

Test: treehugger
Change-Id: Iba7c56f2adc30288c3e00ade106635e515e88179
2023-09-21 14:15:59 -07:00
Treehugger Robot
631dfbb8ad Merge "Add the risc-v TLSDESC relocations." into main 2023-09-15 19:53:19 +00:00
Treehugger Robot
d72f4f8770 Merge "Consistent qualifier ordering." into main 2023-09-15 17:19:08 +00:00
Florian Mayer
6b4e6e470e Merge "Remove ASan test" into main 2023-09-14 19:19:01 +00:00
Elliott Hughes
30088848fc Consistent qualifier ordering.
Change our handful of `constexpr static`s to the much more common
`static constexpr`. It's easier to "follow existing style" when there
aren't two existing styles to copy from, and all else being equal,
"majority wins" :-)

Test: treehugger
Change-Id: Ifbf0f62ab84c9450bf9c2e49e96915c126fd20c4
2023-09-14 18:36:55 +00:00
Elliott Hughes
ba7654ad92 Add the risc-v TLSDESC relocations.
https://github.com/riscv-non-isa/riscv-elf-psabi-doc/issues/94 was
merged.

Bug: https://github.com/google/android-riscv64/issues/3
Test: treehugger
Change-Id: Ifc0c4d7408367f0372cec969d4ee6f84699bee30
2023-09-14 18:02:17 +00:00
Florian Mayer
12e38c23f1 Remove ASan test
ASan for device side is deprecated.
Bug: 300289881

Change-Id: I492ccbbeae43c84b53e92b062048c56ea974308e
2023-09-13 12:29:32 -07:00
Christopher Ferris
a4bcacf79b Merge "Disable warning which is not detecting problems." into main 2023-09-12 23:29:01 +00:00
Christopher Ferris
1de7a480bc Disable warning which is not detecting problems.
A clang update enabled -Wreorder-init-list by default. Since it doesn't
provide any benefit to the bionic code, disable the warning.

Test: Builds without warnings.
Change-Id: I5891527ef532b59dc2a02b39a5896112411d21f5
2023-09-12 13:03:02 -07:00
Christopher Ferris
6d2b71eb45 Merge "Update to v6.5 kernel headers." into main 2023-09-12 18:00:15 +00:00
Elliott Hughes
1bc2339a77 Merge "Remove a stray newline." into main 2023-09-07 21:39:05 +00:00
Elliott Hughes
5dd1582706 Remove a stray newline.
err() not only adds its own newline, it'll add the strerror() output
first, so this stray newline messes up the error message. (Seen running
bionic benchmarks not as root, which causes the std_map benchmarks to
fail, which is especially annoying because it ends the whole benchmark
run, not just the specific benchmark, but that's a less obvious fix, so
I'm just fixing the trivial part here!)

Test: treehugger
Change-Id: I7e87ea4385c410942fbdd14e6fdfddbf7320082a
2023-09-07 18:48:13 +00:00
Christopher Ferris
8666d0462f Update to v6.5 kernel headers.
Kernel headers coming from:

Git: https://android.googlesource.com/kernel/common/
Branch: android-mainline
Tag: android-mainline-6.5

Test: Builds and bionic unit tests pass on raven.
Test: Able to log in to an Android GO 32 bit device.
Change-Id: Ia0397ce27e088bc20338bbd2d125be6f169c4ba0
2023-09-06 19:33:21 -07:00
Treehugger Robot
f3bf97003c Merge "Add doc for sentinel change in preinit_array/init_array/fini_array" into main 2023-09-06 22:49:33 +00:00
Yabin Cui
bd73dcc21a Add doc for sentinel change in preinit_array/init_array/fini_array
Bug: 295944813
Bug: https://github.com/android/ndk/issues/1461
Test: none
Change-Id: I0bc90a312438b14bd3dc8b675e3083ac909f89df
2023-09-06 15:15:37 -07:00
Elliott Hughes
8da1746458 Merge "Greatly reduce the space used by properties filenames." into main 2023-09-06 20:52:37 +00:00
Elliott Hughes
fe9bd312a8 Merge "Punch a hole for clone3(2) use." into main 2023-09-06 18:24:49 +00:00
Elliott Hughes
740956c856 Greatly reduce the space used by properties filenames.
These should never be particularly long, but because this code runs
before we can allocate, they have to be fixed size. Bring that size down
to 128 bytes which should be enough for anyone, and which should let us
add some new filenames in less space than we're currently using for one
filename.

Test: treehugger
Change-Id: I524d7e5ffd415ba0c3d600eb94801a304b1b4bb4
2023-09-06 18:11:50 +00:00
Colin Cross
90eef4250e Merge "Skip sysconf_cache for musl" into main 2023-09-06 17:14:57 +00:00
Elliott Hughes
6f6df7376e Merge "Use a class for system properties filenames." into main 2023-09-05 23:04:42 +00:00
Elliott Hughes
b65dec5629 Punch a hole for clone3(2) use.
With the cgroups support, this is starting to look like something we
might actually want to use one day. Start preparing now.

Test: treehugger
Change-Id: I7c015bbf6b145b66124ee9ce74816c03e51df7c8
2023-09-05 22:58:43 +00:00
Elliott Hughes
906d7d41e4 Merge "Add epoll_pwait2()." into main 2023-09-05 21:48:08 +00:00
Colin Cross
cb5d3c1c33 Skip sysconf_cache for musl
Musl doesn't have the _SC_LEVEL?_?CACHE_SIZE sysconf macros.

Bug: 257334542
Test: m USE_HOST_MUSL=true host-native
Change-Id: I42e65daa9169e129059ddde5eee487ea51e6f143
2023-09-05 13:53:11 -07:00