This is an archive of the discontinued LLVM Phabricator instance.

[NFC][sanitizer] Track progress of populating the block
ClosedPublic

Authored by vitalybuka on Nov 23 2021, 6:33 PM.

Details

Summary

In multi-threaded application concurrent StackStore::Store may
finish in order different from assigned Id. So we can't assume
that after we switch writing the next block the previous is done.

The workaround is to count exact number of uptr stored into the block,
including skipped tail/head which were not able to fit entire trace.

Depends on D114490.

Diff Detail

Event Timeline

vitalybuka requested review of this revision.Nov 23 2021, 6:33 PM
vitalybuka created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptNov 23 2021, 6:33 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
dvyukov added inline comments.Nov 24 2021, 6:52 AM
compiler-rt/lib/sanitizer_common/sanitizer_stackdepot.cpp
77–78

= 0

vitalybuka marked an inline comment as done.

0

morehouse accepted this revision.Nov 24 2021, 12:56 PM
morehouse added inline comments.
compiler-rt/lib/sanitizer_common/tests/sanitizer_stack_store_test.cpp
119

12 seems a bit arbitrary. Maybe we can compute the combined sizes of all stack traces stored and divide by kBlockSizeFrames.

This revision is now accepted and ready to land.Nov 24 2021, 12:56 PM
vitalybuka marked an inline comment as done.

calculated total_ready

morehouse accepted this revision.Nov 29 2021, 10:14 AM
vitalybuka edited the summary of this revision. (Show Details)Nov 29 2021, 6:44 PM