Skip to content

Commit

Permalink
i#5520 memtrace encodings: Add encoding count to basic_counts
Browse files Browse the repository at this point in the history
Although the encoding records are not directly exposed to analysis
tools, the encoding_is_new field can be used as a proxy to count them.
We do that here for the basic_counts tool.

Issue: #5520
  • Loading branch information
derekbruening committed Oct 4, 2022
1 parent 75969d1 commit d8af05b
Show file tree
Hide file tree
Showing 24 changed files with 67 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Total counts:
.* total function argument markers
.* total function return value markers
.* total other markers
.* total encodings
Thread .* counts:
19 \(fetched\) instructions
19 unique \(fetched\) instructions
Expand All @@ -34,3 +35,4 @@ Thread .* counts:
.* function argument markers
.* function return value markers
.* other markers
.* encodings
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Total counts:
.* total physical address \+ virtual address marker pairs
.* total physical address unavailable markers
.* total other markers
.* total encodings
Thread .* counts:
96 \(fetched\) instructions
96 unique \(fetched\) instructions
Expand All @@ -38,3 +39,4 @@ Thread .* counts:
.* physical address \+ virtual address marker pairs
.* physical address unavailable markers
.* other markers
.* encodings
2 changes: 2 additions & 0 deletions clients/drcachesim/tests/allasm-repstr-basic-counts.templatex
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Total counts:
0 total physical address \+ virtual address marker pairs
0 total physical address unavailable markers
4 total other markers
0 total encodings
Thread [0-9]* counts:
98 \(fetched\) instructions
26 unique \(fetched\) instructions
Expand All @@ -47,3 +48,4 @@ Thread [0-9]* counts:
0 physical address \+ virtual address marker pairs
0 physical address unavailable markers
4 other markers
0 encodings
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Total counts:
.* total physical address \+ virtual address marker pairs
.* total physical address unavailable markers
.* total other markers
.* total encodings
Thread .* counts:
96 \(fetched\) instructions
96 unique \(fetched\) instructions
Expand All @@ -39,3 +40,4 @@ Thread .* counts:
.* physical address \+ virtual address marker pairs
.* physical address unavailable markers
.* other markers
.* encodings
4 changes: 4 additions & 0 deletions clients/drcachesim/tests/basic_counts.templatex
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ Total counts:
.* total physical address \+ virtual address marker pairs
.* total physical address unavailable markers
.* total other markers
.* total encodings
.* total encodings
Thread .* counts:
.* \(fetched\) instructions
.* unique \(fetched\) instructions
Expand All @@ -64,3 +66,5 @@ Thread .* counts:
.* physical address \+ virtual address marker pairs
.* physical address unavailable markers
.* other markers
.* encodings
.* encodings
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Total counts:
.* total physical address \+ virtual address marker pairs
.* total physical address unavailable markers
.* total other markers
.* total encodings
Thread .* counts:
.* \(fetched\) instructions
.* unique \(fetched\) instructions
Expand All @@ -46,3 +47,4 @@ Thread .* counts:
.* physical address \+ virtual address marker pairs
.* physical address unavailable markers
.* other markers
.* encodings
2 changes: 2 additions & 0 deletions clients/drcachesim/tests/filter-no-d.templatex
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Total counts:
0 total physical address \+ virtual address marker pairs
0 total physical address unavailable markers
.* total other markers
.* total encodings
Thread .* counts:
.* \(fetched\) instructions
.* unique \(fetched\) instructions
Expand All @@ -38,6 +39,7 @@ Thread .* counts:
0 physical address \+ virtual address marker pairs
0 physical address unavailable markers
.* other markers
.* encodings

===========================================================================
Trace invariant checks passed\)?
2 changes: 2 additions & 0 deletions clients/drcachesim/tests/filter-no-i.templatex
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Total counts:
0 total physical address \+ virtual address marker pairs
0 total physical address unavailable markers
.* total other markers
.* total encodings
Thread .* counts:
0 \(fetched\) instructions
0 unique \(fetched\) instructions
Expand All @@ -38,6 +39,7 @@ Thread .* counts:
0 physical address \+ virtual address marker pairs
0 physical address unavailable markers
.* other markers
.* encodings

===========================================================================
Trace invariant checks passed\)?
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Total counts:
0 total function argument markers
0 total function return value markers
.* total other markers
.* total encodings
Thread .* counts:
19 \(fetched\) instructions
19 unique \(fetched\) instructions
Expand All @@ -33,3 +34,4 @@ Thread .* counts:
0 function argument markers
0 function return value markers
.* other markers
.* encodings
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Total counts:
.* total physical address \+ virtual address marker pairs
.* total physical address unavailable markers
.* total other markers
.* total encodings
Thread .* counts:
96 \(fetched\) instructions
96 unique \(fetched\) instructions
Expand All @@ -37,6 +38,7 @@ Thread .* counts:
.* physical address \+ virtual address marker pairs
.* physical address unavailable markers
.* other markers
.* encodings
Prefetch operation frequencies:
2 prefetch_read_l1
4 prefetch_read_l2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Total counts:
0 total physical address \+ virtual address marker pairs
0 total physical address unavailable markers
5 total other markers
26 total encodings
Thread [0-9]* counts:
98 \(fetched\) instructions
26 unique \(fetched\) instructions
Expand All @@ -46,3 +47,4 @@ Thread [0-9]* counts:
0 physical address \+ virtual address marker pairs
0 physical address unavailable markers
5 other markers
26 encodings
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Total counts:
.* total physical address \+ virtual address marker pairs
.* total physical address unavailable markers
.* total other markers
.* total encodings
Thread .* counts:
96 \(fetched\) instructions
96 unique \(fetched\) instructions
Expand All @@ -38,3 +39,4 @@ Thread .* counts:
.* physical address \+ virtual address marker pairs
.* physical address unavailable markers
.* other markers
.* encodings
2 changes: 2 additions & 0 deletions clients/drcachesim/tests/offline-basic_counts.templatex
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Total counts:
.* total physical address \+ virtual address marker pairs
.* total physical address unavailable markers
.* total other markers
.* total encodings
Thread .* counts:
.* \(fetched\) instructions
.* unique \(fetched\) instructions
Expand All @@ -63,3 +64,4 @@ Thread .* counts:
.* physical address \+ virtual address marker pairs
.* physical address unavailable markers
.* other markers
.* encodings
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Total counts:
.* total physical address \+ virtual address marker pairs
.* total physical address unavailable markers
.* total other markers
.* total encodings
Thread .* counts:
.* \(fetched\) instructions
.* unique \(fetched\) instructions
Expand All @@ -45,3 +46,4 @@ Thread .* counts:
.* physical address \+ virtual address marker pairs
.* physical address unavailable markers
.* other markers
.* encodings
2 changes: 2 additions & 0 deletions clients/drcachesim/tests/offline-burst_aarch64_sys.templatex
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Total counts:
.* total physical address \+ virtual address marker pairs
.* total physical address unavailable markers
.* total other markers
.* total encodings
Thread .* counts:
.* \(fetched\) instructions
.* unique \(fetched\) instructions
Expand All @@ -42,3 +43,4 @@ Thread .* counts:
.* physical address \+ virtual address marker pairs
.* physical address unavailable markers
.* other markers
.* encodings
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ Total counts:
0 total physical address \+ virtual address marker pairs
0 total physical address unavailable markers
*[0-9]* total other markers
*[0-9]* total encodings
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ Total counts:
0 total physical address \+ virtual address marker pairs
0 total physical address unavailable markers
*[0-9]* total other markers
*[0-9]* total encodings
.*
2 changes: 2 additions & 0 deletions clients/drcachesim/tests/offline-filter-no-d.templatex
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Total counts:
0 total physical address \+ virtual address marker pairs
0 total physical address unavailable markers
.* total other markers
.* total encodings
Thread .* counts:
.* \(fetched\) instructions
.* unique \(fetched\) instructions
Expand All @@ -37,3 +38,4 @@ Thread .* counts:
0 physical address \+ virtual address marker pairs
0 physical address unavailable markers
.* other markers
.* encodings
2 changes: 2 additions & 0 deletions clients/drcachesim/tests/offline-filter-no-i.templatex
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Total counts:
0 total physical address \+ virtual address marker pairs
0 total physical address unavailable markers
.* total other markers
.* total encodings
Thread .* counts:
0 \(fetched\) instructions
0 unique \(fetched\) instructions
Expand All @@ -37,3 +38,4 @@ Thread .* counts:
0 physical address \+ virtual address marker pairs
0 physical address unavailable markers
.* other markers
.* encodings
4 changes: 4 additions & 0 deletions clients/drcachesim/tests/offline-legacy-int-offs.templatex
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Total counts:
0 total physical address \+ virtual address marker pairs
0 total physical address unavailable markers
12 total other markers
8429 total encodings
Thread 552306 counts:
101049 \(fetched\) instructions
6393 unique \(fetched\) instructions
Expand All @@ -39,6 +40,7 @@ Thread 552306 counts:
0 physical address \+ virtual address marker pairs
0 physical address unavailable markers
4 other markers
6393 encodings
Thread 552323 counts:
4674 \(fetched\) instructions
1028 unique \(fetched\) instructions
Expand All @@ -57,6 +59,7 @@ Thread 552323 counts:
0 physical address \+ virtual address marker pairs
0 physical address unavailable markers
4 other markers
1028 encodings
Thread 552324 counts:
3482 \(fetched\) instructions
1008 unique \(fetched\) instructions
Expand All @@ -75,6 +78,7 @@ Thread 552324 counts:
0 physical address \+ virtual address marker pairs
0 physical address unavailable markers
4 other markers
1008 encodings
#else
ERROR: failed to initialize analyzer: Directory setup failed: Failed sanity checks for thread log file .*/drmemtrace.legacy-int-offs/raw/drmemtrace.drmemtrace.signal_invariants..*.raw.gz: Architecture mismatch: trace recorded on x86_64 but tools built for i386
#endif
9 changes: 9 additions & 0 deletions clients/drcachesim/tests/offline-windows-asm.templatex
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Total counts:
0 total physical address \+ virtual address marker pairs
0 total physical address unavailable markers
12 total other markers
21 total encodings
Total windows: 7
Window #0:
15 window \(fetched\) instructions
Expand All @@ -59,6 +60,7 @@ Window #0:
0 window physical address \+ virtual address marker pairs
0 window physical address unavailable markers
6 window other markers
15 window encodings
Window #1:
8 window \(fetched\) instructions
8 window unique \(fetched\) instructions
Expand All @@ -77,6 +79,7 @@ Window #1:
0 window physical address \+ virtual address marker pairs
0 window physical address unavailable markers
1 window other markers
3 window encodings
Window #2:
8 window \(fetched\) instructions
8 window unique \(fetched\) instructions
Expand All @@ -95,6 +98,7 @@ Window #2:
0 window physical address \+ virtual address marker pairs
0 window physical address unavailable markers
1 window other markers
0 window encodings
Window #3:
8 window \(fetched\) instructions
8 window unique \(fetched\) instructions
Expand All @@ -113,6 +117,7 @@ Window #3:
0 window physical address \+ virtual address marker pairs
0 window physical address unavailable markers
1 window other markers
0 window encodings
Window #4:
8 window \(fetched\) instructions
8 window unique \(fetched\) instructions
Expand All @@ -131,6 +136,7 @@ Window #4:
0 window physical address \+ virtual address marker pairs
0 window physical address unavailable markers
1 window other markers
0 window encodings
Window #5:
6 window \(fetched\) instructions
6 window unique \(fetched\) instructions
Expand All @@ -149,6 +155,7 @@ Window #5:
0 window physical address \+ virtual address marker pairs
0 window physical address unavailable markers
1 window other markers
3 window encodings
Window #6:
0 window \(fetched\) instructions
0 window unique \(fetched\) instructions
Expand All @@ -167,6 +174,7 @@ Window #6:
0 window physical address \+ virtual address marker pairs
0 window physical address unavailable markers
1 window other markers
0 window encodings
Thread [0-9]* counts:
15 \(fetched\) instructions
15 unique \(fetched\) instructions
Expand All @@ -185,3 +193,4 @@ Thread [0-9]* counts:
0 physical address \+ virtual address marker pairs
0 physical address unavailable markers
6 other markers
15 encodings
2 changes: 2 additions & 0 deletions clients/drcachesim/tests/scattergather.templatex
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ Total counts:
.* total physical address \+ virtual address marker pairs
.* total physical address unavailable markers
.* total other markers
.* total encodings
Thread .* counts:
.* \(fetched\) instructions
.* unique \(fetched\) instructions
Expand All @@ -183,3 +184,4 @@ Thread .* counts:
.* physical address \+ virtual address marker pairs
.* physical address unavailable markers
.* other markers
.* encodings
11 changes: 10 additions & 1 deletion clients/drcachesim/tools/basic_counts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,16 @@ basic_counts_t::parallel_shard_memref(void *shard_data, const memref_t &memref)
if (type_is_instr(memref.instr.type)) {
++counters->instrs;
counters->unique_pc_addrs.insert(memref.instr.addr);
} else if (memref.data.type == TRACE_TYPE_INSTR_NO_FETCH) {
// The encoding entries aren't exposed at the memref_t level, but
// we use encoding_is_new as a proxy.
if (memref.instr.encoding_is_new)
++counters->encodings;
} else if (memref.instr.type == TRACE_TYPE_INSTR_NO_FETCH) {
++counters->instrs_nofetch;
// The encoding entries aren't exposed at the memref_t level, but
// we use encoding_is_new as a proxy.
if (memref.instr.encoding_is_new)
++counters->encodings;
} else if (type_is_prefetch(memref.data.type)) {
++counters->prefetches;
} else if (memref.data.type == TRACE_TYPE_READ) {
Expand Down Expand Up @@ -217,6 +225,7 @@ basic_counts_t::print_counters(const counters_t &counters, int_least64_t num_thr
std::cerr << std::setw(12) << counters.phys_unavail_markers << prefix
<< " physical address unavailable markers\n";
std::cerr << std::setw(12) << counters.other_markers << prefix << " other markers\n";
std::cerr << std::setw(12) << counters.encodings << prefix << " encodings\n";
}

bool
Expand Down
Loading

0 comments on commit d8af05b

Please sign in to comment.