提交 599a5beb 编写于 作者: A Adrian Hunter 提交者: Arnaldo Carvalho de Melo

perf intel-pt: Adjust overlap-checking to support sampling mode

Adjust overlap-checking to support sampling mode.
Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/1520431349-30689-10-git-send-email-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 13f89dba
...@@ -230,6 +230,7 @@ static int intel_pt_get_trace(struct intel_pt_buffer *b, void *data) ...@@ -230,6 +230,7 @@ static int intel_pt_get_trace(struct intel_pt_buffer *b, void *data)
struct auxtrace_buffer *buffer = ptq->buffer; struct auxtrace_buffer *buffer = ptq->buffer;
struct auxtrace_buffer *old_buffer = ptq->old_buffer; struct auxtrace_buffer *old_buffer = ptq->old_buffer;
struct auxtrace_queue *queue; struct auxtrace_queue *queue;
bool might_overlap;
if (ptq->stop) { if (ptq->stop) {
b->len = 0; b->len = 0;
...@@ -256,7 +257,8 @@ static int intel_pt_get_trace(struct intel_pt_buffer *b, void *data) ...@@ -256,7 +257,8 @@ static int intel_pt_get_trace(struct intel_pt_buffer *b, void *data)
return -ENOMEM; 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)) intel_pt_do_fix_overlap(ptq->pt, old_buffer, buffer))
return -ENOMEM; return -ENOMEM;
...@@ -269,8 +271,7 @@ static int intel_pt_get_trace(struct intel_pt_buffer *b, void *data) ...@@ -269,8 +271,7 @@ static int intel_pt_get_trace(struct intel_pt_buffer *b, void *data)
} }
b->ref_timestamp = buffer->reference; b->ref_timestamp = buffer->reference;
if (!old_buffer || ptq->pt->sampling_mode || (ptq->pt->snapshot_mode && if (!old_buffer || (might_overlap && !buffer->consecutive)) {
!buffer->consecutive)) {
b->consecutive = false; b->consecutive = false;
b->trace_nr = buffer->buffer_nr + 1; b->trace_nr = buffer->buffer_nr + 1;
} else { } else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册