struct auxtrace_buffer *buffer = ptq->buffer;
struct auxtrace_buffer *old_buffer = ptq->old_buffer;
struct auxtrace_queue *queue;
+ bool might_overlap;
if (ptq->stop) {
b->len = 0;
return -ENOMEM;
}
- if (ptq->pt->snapshot_mode && !buffer->consecutive && old_buffer &&
+ might_overlap = ptq->pt->snapshot_mode || ptq->pt->sampling_mode;
+ if (might_overlap && !buffer->consecutive && old_buffer &&
intel_pt_do_fix_overlap(ptq->pt, old_buffer, buffer))
return -ENOMEM;
}
b->ref_timestamp = buffer->reference;
- if (!old_buffer || ptq->pt->sampling_mode || (ptq->pt->snapshot_mode &&
- !buffer->consecutive)) {
+ if (!old_buffer || (might_overlap && !buffer->consecutive)) {
b->consecutive = false;
b->trace_nr = buffer->buffer_nr + 1;
} else {