From d1cf4812983b8e177d7d98b9807ea33b9aca5086 Mon Sep 17 00:00:00 2001 From: Derek Bruening Date: Fri, 2 Dec 2022 12:21:38 -0500 Subject: [PATCH] i#2039 trace trim, part 7: Fix filtered refresh 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 --- api/docs/debug_memtrace.dox | 2 ++ clients/drcachesim/tracer/output.cpp | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/api/docs/debug_memtrace.dox b/api/docs/debug_memtrace.dox index f841d9e188d..9da0ad59ac4 100644 --- a/api/docs/debug_memtrace.dox +++ b/api/docs/debug_memtrace.dox @@ -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 diff --git a/clients/drcachesim/tracer/output.cpp b/clients/drcachesim/tracer/output.cpp index d6d84d87cfa..bc0bd13c3b8 100644 --- a/clients/drcachesim/tracer/output.cpp +++ b/clients/drcachesim/tracer/output.cpp @@ -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. @@ -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)) {