DynamoRIO / dynamorio

Dynamic Instrumentation Tool Platform
Other
2.63k stars 557 forks source link

i#6643: Support drmemtrace analysis for #instr intervals #6644

Closed abhinav92003 closed 7 months ago

abhinav92003 commented 8 months ago

Adds support to produce trace interval results in the drmemtrace analyzer framework where the intervals are defined by a count of instrs. This is enabled using the new -interval_instr_count flag.

Unlike the timestamp (microseconds) based intervals where we support merging the per-shard intervals generated during parallel mode to create whole-trace intervals, for the #instr intervals we do not support merging. This is because merging #instr intervals is non-trivial. See added TODO comment for current ideas to achieve that in future. In the current version, when trace analysis completes, the print_interval_results() API is called separately for each shard with the interval state snapshots of that shard.

Extends the trace_interval_analysis_unit_tests to test the new feature. Also adds a basic_counts test that uses #instr intervals.

Modifies some existing logic to skip invoking the combine_interval_snapshots API in the serial mode. This way the user can avoid implementing the API if they're interested only in the serial mode.

Unnests some nested structs in trace_interval_analysis_unit_tests to shorten some struct identifiers frequently used to create expected test output objects. This helps fit some expected output entries in one line, making it easier to read.

Issue: #6643