Skip to content

Conversation

al45tair
Copy link
Contributor

@al45tair al45tair commented Nov 8, 2023

Currently we read many small chunks from the process we're backtracing. If it so happens that it's the local process, that isn't really a big problem, but if it's a remote process, especially on Linux where we have to use the memory server, it's probably a little slow.

Fix by adding a caching layer.

rdar://117681625

Currently we read many small chunks from the process we're backtracing.
If it so happens that it's the local process, that isn't really a big
problem, but if it's a remote process, especially on Linux where we have
to use the memory server, it's probably a little slow.

Fix by adding a caching layer.

rdar://117681625
Because the cache uses the page addresses as its keys, we should have
a precondition to check that we haven't passed an address within a page.
The latter would result in confusing behaviour so it's worth diagnosing
up front.

rdar://117681625
It turns out that .copyBytes() checks that the source doesn't provide more
bytes than the destination will accept.

rdar://117681625
When I rebased, I didn't get the FileImageSource code quite right.

rdar://117681625
@al45tair al45tair added 🍒 release cherry pick Flag: Release branch cherry picks swift 5.9 labels Nov 8, 2023
@al45tair al45tair requested a review from a team as a code owner November 8, 2023 14:16
@al45tair
Copy link
Contributor Author

al45tair commented Nov 8, 2023

Explanation: Improves backtracing performance on Linux by adding a cache.
Original PR: #69510
Risk: Low. We have tests that cover this code.
Reviewed by: @mikeash
Resolves: rdar://117681625
Tests: The existing backtracing tests exercise this code.

@al45tair
Copy link
Contributor Author

al45tair commented Nov 8, 2023

@swift-ci Please test

@al45tair al45tair merged commit ce23dfd into swiftlang:release/5.9 Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 5.9
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants