Commit graph

66 commits

Author SHA1 Message Date
Elliott Hughes
91e3bd1f33 Document the changed fdsan default from Q to R.
Change-Id: I98c50232184a8bf929579a7a30460dc33555475e
2020-01-16 15:23:58 -08:00
Christopher Ferris
5a3c920051 Add mallopt M_PURGE benchmark.
Update the native allocator documentation to include running of this
benchmark.

Move the malloc_benchmark.cpp to malloc_sql_benchmark.cpp and use
malloc_benchmark.cpp for benchmarking functions from malloc.h.

Bug: 137795072

Test: Ran new benchmark.
Change-Id: I76856de833032da324ad0bc0b6bd85a4ea8c253d
2019-12-05 15:46:22 -08:00
Christopher Ferris
75edf16f4d Update the native allocator document.
Add extra information I've been using to evaluate scudo.

Test: NA
Change-Id: Ie7ee65890b1a3804c38ba38de504144d43e410b2
2019-11-13 14:00:56 -08:00
Elliott Hughes
502dc0b9c3 Update docs/status.md function counts for recent releases.
Test: N/A
Change-Id: I99b7227334d0858f19ec7544a255fe47f265d810
2019-11-12 21:06:07 -08:00
Christopher Ferris
51863b3671 Add section about libmemunreachable tests.
Test: NA
Change-Id: I0dcb8bbb7a598c44201281c7d493023e7d25c153
2019-10-25 15:27:12 -07:00
Christopher Ferris
2f5fc3372a Updated memory_replay description.
The description of memory_replay talks about unzippping the trace
files, but this is no longer necessary. This language has been
updated to reflect this.

Test: NA
Change-Id: Id808f9bd1286284c8de12b19c08eb8677c76dd53
2019-10-17 15:20:55 -07:00
Elliott Hughes
80e9f65c04 Remove __ANDROID_NDK__ from bionic, and document our #defines.
__ANDROID_NDK__ is moving into the NDK's <android/ndk-version.h>
instead.

Test: treehugger
Change-Id: I192016165a929547009d15dbcc30e8f6dad1ac88
2019-10-15 13:30:12 -07:00
Treehugger Robot
5f112cd756 Merge "Link our two main developer-facing docs together." 2019-08-16 02:08:22 +00:00
Elliott Hughes
8f3f191bf3 Link our two main developer-facing docs together.
Bug: http://b/139329827
Test: N/A
Change-Id: I38e05f1a7eaa8ff31b503541e34f2e362cd4722e
2019-08-15 08:19:49 -07:00
Christopher Ferris
aa22c0cb0c Update location of trace files.
Test: NA
Change-Id: I27f98b84b7701b8747d22dbdfbfa074083c36bc1
2019-08-14 15:17:26 -07:00
Christopher Ferris
05197f7d03 Change all references to PSS to RSS.
RSS is the real measurement by which an allocator should be measured
since RSS is the real memory consumed by the process. PSS is a shared
value.

For memory_replay, PSS and RSS should be the same, so this didn't really
matter in practice, but it's better to use the correct name of RSS.

Also, add a small section about fragmentation.

Bug: 138394907

Test: NA
Change-Id: Ic6f982f9c4619f452342e7c105818e33b8b85e44
2019-08-07 15:34:11 -07:00
Elliott Hughes
da32ff104b Merge "Add memfd_create(2) and mlock2(2)." 2019-08-06 17:08:13 +00:00
Elliott Hughes
3d24d2b088 Add memfd_create(2) and mlock2(2).
These are old enough now that the latest devices will have kernels that
support them.

Also add basic doc comments to <sys/mman.h>.

Test: treehugger
Change-Id: I1b5ff5db0b6270f5c374287cac1d6a751a0259f5
2019-08-05 16:31:08 -07:00
Tom Cherry
f0d9271fe2 Update docs for clockwait/clocklock functions
Test: n/a
Change-Id: Ie4853912c9ed63d29121e62406682896012962ec
2019-08-05 14:13:25 -07:00
Elliott Hughes
05b675e8bf Add renameat2.
Bug: http://b/127675384
Test: new tests
Change-Id: Ia2e3d5679180391ca98e62fa429fa11cbf167507
2019-08-02 09:09:59 -07:00
Christopher Ferris
afce4e897f Merge "Add doc describing native allocator." 2019-06-28 19:55:31 +00:00
Christopher Ferris
4316d43f4d Add doc describing native allocator.
This includes tests that a native allocator has to pass, and the ways
to benchmark a native allocator on Android.

Test: NA
Change-Id: I5e1f4b3eea46ee2240e63a487ca3dfabecff81c0
2019-06-28 10:33:53 -07:00
Christopher Ferris
2671de2896 Fix usage of () and [].
The usage was reversed, [] is used for the name and () is used for the
link destination.

Test: NA
Change-Id: I07bf8645a888d5690d6c3d58edc3899b3e287df4
2019-06-27 20:42:38 -07:00
Elliott Hughes
4206711352 threads.h: Add C11 thread support.
FreeBSD, glibc, and musl have all implemented C11 threads at this
point. POSIX is looking at how to align with it. Probably time to jump
on the bandwagon ourselves...

Implemented in the same style as <termios.h> so we can provide this
functionality even on older API levels. This does mean that this is
strictly more expensive than calling pthread functions directly.

Although this isn't in POSIX yet, assume that it's going to be basically
the same as C11 and add the header test anyway. We should revisit this
when POSIX actually adds <threads.h>.

Test: new tests
Change-Id: I8602d67ce71ca7f8ed1529daa0a8ea1feb083dd6
2019-04-24 09:12:29 -07:00
Elliott Hughes
a1fb15bb67 strptime: support everything that strftime supports.
Our strptime was missing `%F`, `%G`, `%g`, `%P`, `%u`, `%V`, and
`%v`. Most of these are already supported upstream (and I've just pulled
their current implementation), but some aren't. We're horribly out of
sync anyway, so I'll upstream the missing pieces and then try to get us
back in sync later.

Test: new tests, but originally found by toybox trying to use %F
Change-Id: Ib1a10801a7a3b9c9189440c3b300109bde535fd9
2019-03-26 19:07:40 -07:00
Elliott Hughes
b282a6d4d3 Document various libc behavior changes.
Test: N/A
Change-Id: I3044c394180058ba500762239b16a4c740caca44
2019-03-20 11:23:53 -07:00
Christopher Ferris
a22f5d5175 Make aligned_alloc match the standard.
Jemalloc does not verify that the size parameter is a multiple of
alignment. Fix this since it only went into P.

Fix the unit tests, and fix malloc debug/malloc hooks to handle this
new restrictive behavior.

Bug: 126944692

Test: Ran bionic unit tests.
Test: Ran bionic unit tests with malloc hooks enabled (no new tests fail).
Test: Ran bionic unit tests with malloc debug enabled (no new tests fail).
Test: Ran malloc debug unit tests.
Change-Id: I4d50785928815679c781ca729f998454d76b9192
2019-03-01 23:56:23 -08:00
Ryan Prichard
9491c54619 Publish the current draft of my ELF TLS doc
I have a script that converts the internal Google Doc to this markdown
file.

Bug: http://b/78026329
Test: review document
Change-Id: I16cfa60f1e480f859eb79cb0e5f0c519f5622cfd
2018-11-09 15:24:16 -08:00
Elliott Hughes
2d0b28bc0d Add getloadavg(3).
Lets us build ninja with bionic.

Bug: N/A
Test: ran tests
Change-Id: I97eef1247d794b58a2b9aee4851551632e5a4e48
2018-10-23 11:23:00 -07:00
Elliott Hughes
b177085ce7 Add reallocarray(3).
Originally a BSD extension, now in glibc too. We've used it internally
for a while.

(cherry-pick of e4b13f7e3ca68edfcc5faedc5e7d4e13c4e8edb9.)

Bug: http://b/112163459
Test: ran tests
Change-Id: I813c3a62b13ddb91ba41e32a5a853d09207ea6bc
Merged-In: I813c3a62b13ddb91ba41e32a5a853d09207ea6bc
2018-09-26 14:24:18 -07:00
Josh Gao
ce9d653b38 Merge changes from topics "fdsan_ziparchive_type", "fdsan_java_socket"
* changes:
  fdsan: improve documentation.
  fdsan: add type for libziparchive's ZipArchive.
  fdsan: add types for Java sockets.
2018-09-20 19:22:03 +00:00
Josh Gao
d747bb8f3f fdsan: improve documentation.
Fix a race condition in the example, and add a linearized version to
make it more clear what's going on.

Test: none
Change-Id: Id9158e4fd407b676ef364e7076985de3ad477457
2018-09-18 13:42:08 -07:00
Elliott Hughes
670ea7aca9 Explicitly say pthread_cancel in the docs.
Bug: http://b/33943372
Test: N/A
Change-Id: If71691f7ff20c9b8c14de15692543bbd858c9aab
2018-09-14 17:05:01 -07:00
Josh Gao
01416ba112 Fix mistake in fdsan documentation.
File descriptors are POSIX, not C.

Test: none
Change-Id: Idc3c32c60f9c61e8e68aabbc4589a6c68e156e4b
2018-09-06 16:23:38 -07:00
Josh Gao
b64196a9bb fdsan: add documentation.
Test: none
Change-Id: I7dabd8f5420c757b6504254a6414da8e877d475e
2018-09-06 14:55:12 -07:00
Elliott Hughes
86bce192e9 Document various post-P bionic changes.
Historically we haven't documented many behavioral changes, but it's
probably useful to record that information before it's lost (even if,
long term, it might be more useful in the man pages or the doc comments).

Bug: N/A
Test: N/A
Change-Id: Iaa4f651fd6576298d848894b61285ef95879deb9
2018-09-05 12:01:15 -07:00
Elliott Hughes
3876ade842 Fill out historical "what was added when" information.
Bug: N/A
Test: N/A
Change-Id: Ifa1807c6bb61dea2a4831785492b13118c66490d
2018-08-30 14:25:32 -07:00
Christopher Ferris
a473be2395 Fix libc assembler documentation.
Test: NA
Change-Id: I71485a3a44a56f2ff7ed590aec171464b57f56f6
2018-08-06 12:18:32 -07:00
Treehugger Robot
782cd01b09 Merge "Revert "Move android-changes-for-ndk-developers.md into docs/."" 2018-08-06 17:27:31 +00:00
Elliott Hughes
74866e160d Revert "Move android-changes-for-ndk-developers.md into docs/."
This reverts commit 1975196c87.

Reason for revert: https://android.googlesource.com/ doesn't follow symlinks :-(

Change-Id: I58038a03388ab5257d301debb494ce354013acfe
2018-08-06 15:40:04 +00:00
Christopher Ferris
65f82092a1 Merge "Add doc about verifying libc assembler routines." 2018-08-02 19:27:05 +00:00
Christopher Ferris
af455ac83d Add doc about verifying libc assembler routines.
Test: NA
Change-Id: Ic3576f9c063a11d5c3f5fdb093b4d9dd2a1f5dd7
2018-08-01 20:17:28 -07:00
Elliott Hughes
1975196c87 Move android-changes-for-ndk-developers.md into docs/.
(But keep a symbolic link so we don't break the web.)

Bug: N/A
Test: N/A
Change-Id: Ib0c8ef80cb4b6836a465d897ffe6d78e11f09f46
2018-08-01 13:07:17 -07:00
Elliott Hughes
a7119af33e Update libc status documentation.
Bug: N/A
Test: N/A
Change-Id: Ied9659f0388a4affa65f0948b3e4a58d0dca5605
2018-07-17 13:26:14 -07:00
Elliott Hughes
07f62385b6 Document FORTIFY.
Hilariously, our blog post didn't actually say how to turn it on :-)

Bug: N/A
Test: N/A
Change-Id: I6e773e88c32a70b0f8b8b6d105fce74d68ebf5cd
2018-05-01 13:13:47 -07:00
Elliott Hughes
61c169e5db Separate the new P functions from the new P behavior in the docs.
Bug: N/A
Test: N/A
Change-Id: If3810a1e4d3ab2a5bd5f83a1ab6bbcc1a729f685
2018-03-01 15:44:42 -08:00
Elliott Hughes
48b688b1b1 Document the strptime %s change.
Bug: https://issuetracker.google.com/37128336
Test: N/A
Change-Id: I9b35c14d84b9f4ec85b9d54af47314d0442ebde2
2018-03-01 15:10:19 -08:00
Elliott Hughes
3e235911c9 Add struct sigaction64 and sigaction64.
Bug: http://b/72493232
Test: ran tests
Change-Id: I47b0560a30aa33a9b1f1978dfb7f84d2e3d389b8
2018-02-01 14:45:15 -08:00
Elliott Hughes
5905d6f879 Add sigset64_t and accompanying functions.
This doesn't address `struct sigaction` and `sigaction`. That will
come later.

Bug: http://b/72493232
Test: ran tests
Change-Id: I4134346757ce3a4dac6feae413361cec16223386
2018-01-30 18:47:16 -08:00
Elliott Hughes
13550b8c57 Update our status in light of recent additions.
Bug: N/A
Test: N/A
Change-Id: Ib0af6ba6bb270b03b3837c7e0fa2f9c02508c924
2018-01-25 22:50:09 -08:00
Elliott Hughes
2237b6b8ec Mention the POSIX header tests in docs/status.md.
Also add a couple of comments in the tests for ease of understanding
when grepping for `__BIONIC__`.

Bug: N/A
Test: N/A
Change-Id: I7833a3ffbcc3badf9cec95f268d11a6d8a5ff9aa
2017-12-13 15:25:55 -08:00
Elliott Hughes
3d98adf9d0 Address review comments from the previous change to this file.
Bug: N/A
Test: N/A
Change-Id: If79f622956c69a6881de237214ca05086dfe8b60
2017-11-29 16:30:37 -08:00
Elliott Hughes
a34817457f Improve the _FILE_OFFSET_BITS docs and link to them.
We're still seeing lots of confusion. People do seem to look as far as
the headers, but stop there. So let's try a bit harder to point them in
the right direction.

Also explicitly state that removing _FILE_OFFSET_BITS=64 is the
behavior-preserving fix for compilation problems when upgrading to NDK
r15 or later.

Bug: N/A
Test: N/A
Change-Id: I2d5c65b2fb5cccb9977901e51fea1ad2ccc0fd95
2017-11-28 15:47:01 -08:00
Elliott Hughes
6347acec09 Document bionic's targetSdkVersion-specific behavior.
Bug: N/A
Test: N/A
Change-Id: I367edc592203e585a1d84a10ff3437ea3f2edd91
2017-11-27 18:12:04 -08:00
Elliott Hughes
37ad959783 More missing _unlocked <stdio.h> functions.
Also simplify trivial one-liners like perror/puts/fputs, and clean up
fread/fwrite slightly.

Fix perror to match POSIX.

Add basic perror and *_unlocked tests.

Bug: N/A
Test: ran tests
Change-Id: I63f83c8e0c15c3c4096509d17421ac331b6fc23d
2017-10-31 13:23:41 -07:00