diff options
author | Adrian Hunter <adrian.hunter@intel.com> | 2018-03-07 17:02:29 +0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-03-08 16:05:58 +0300 |
commit | 599a5beb78ad95181677e7919f54dbd64b404cf7 (patch) | |
tree | 4f421027df008b843a45195e8e018fb351a3ef8d /tools/perf/util/intel-pt.c | |
parent | 13f89dbafe73e56fd317c078bb1d3a45fd94ab7b (diff) | |
download | linux-599a5beb78ad95181677e7919f54dbd64b404cf7.tar.xz |
perf intel-pt: Adjust overlap-checking to support sampling mode
Adjust overlap-checking to support sampling mode.
Signed-off-by: Adrian 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.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/intel-pt.c')
-rw-r--r-- | tools/perf/util/intel-pt.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c index 5c5c155fba78..0effaff57020 100644 --- a/tools/perf/util/intel-pt.c +++ b/tools/perf/util/intel-pt.c @@ -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 *old_buffer = ptq->old_buffer; struct auxtrace_queue *queue; + bool might_overlap; if (ptq->stop) { b->len = 0; @@ -256,7 +257,8 @@ static int intel_pt_get_trace(struct intel_pt_buffer *b, void *data) 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; @@ -269,8 +271,7 @@ static int intel_pt_get_trace(struct intel_pt_buffer *b, void *data) } 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 { |