Skip to content

Commit

Permalink
i#2039 trace trim, part 7: Fix filtered refresh
Browse files Browse the repository at this point in the history
Fixes an issue with refreshing the timestamp when filtering is on
where the first (extended) header flag was cleared on a
filter-discarded buffer.

Tested by running "ctest -V --repeat-until-fail 100 -R burst_threadL0filter".
Previously it failed on the 3rd test; now all 100 pass.

Issue: #2039
  • Loading branch information
derekbruening committed Dec 2, 2022
1 parent faa8e4b commit d1cf481
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions api/docs/debug_memtrace.dox
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ Cheat sheet:
- a* is an arm iflush
- c2* is a marker
- c203* is a cpu id
- c20a* is the cache line size
- c212* is the page size
- c200* is kernel event; c201* is kernel xfer

## Viewing post-processed files
Expand Down
6 changes: 3 additions & 3 deletions clients/drcachesim/tracer/output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -938,9 +938,6 @@ process_and_output_buffer(void *drcontext, bool skip_size_cap)
instru->refresh_unit_header_timestamp(data->buf_base + stamp_offs, min_timestamp);
}

// Clear after we know we're not dropping for align_attach_detach_endpoints.
data->has_thread_header = false;

buf_ptr = BUF_PTR(data->seg_base);
// We may get called with nothing to write: e.g., on a syscall for
// -L0I_filter and -L0D_filter.
Expand All @@ -961,6 +958,9 @@ process_and_output_buffer(void *drcontext, bool skip_size_cap)
return;
}

// Clear after we know we're not dropping the data for non-size-cap reasons.
data->has_thread_header = false;

bool window_changed = false;
if (has_tracing_windows() &&
get_local_window(data) != tracing_window.load(std::memory_order_acquire)) {
Expand Down

0 comments on commit d1cf481

Please sign in to comment.