DynamoRIO / dynamorio

Dynamic Instrumentation Tool Platform
Other
2.57k stars 552 forks source link

i#6685: Add core-sharded-on-disk analysis support #6680

Closed derekbruening closed 4 months ago

derekbruening commented 4 months ago

Add core-sharded-on-disk analysis support:

Adds a new filetype OFFLINE_FILE_TYPE_CORE_SHARDED set by record_filter when core-sharded.

Has the scheduler read ahead to the filetype in every input, and arrange to make it available at init time to output streams.

The analyzer looks for the filetype and sets the shard type as core-sharded if set. This is different from a dynamic-scheduling core-sharded as we do not need a 1:1 shard:workers mapping.

Allows header records in reader_t::process_input_entry(), which are now expected with core-sharded-on-disk traces.

Adds core-sharded reader support for seeing only portions of some threads, where we have to relax some tid and pid checks.

Checks in 6 core-sharded-on-disk x64 threadsig traces for use in a test of basic_counts analyzing them. That analysis fails without all of these framework changes.

The changes to the record filter to support generating those traces in the first place will come in separately.

Issue: #6685, #6635 Fixes #6685

derekbruening commented 4 months ago

This has been a real nightmare to get all the modes and tests working: there is some fragility in the infrastructure for sure. Finally have everything passing except the invariant checker pthreads test on the aarch64-sve runner: but I cannot reproduce that failure anywhere else including aarch64 machines I have access to; the failure itself is one I saw a number of commits back on this same test locally and fixed so it is weird it shows up still on this one machine. I don't know that tmate works on self-hosted runners?