[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-6492e5f013d9975d68528150edadead91e97a78a@git.kernel.org>
Date: Mon, 17 Jun 2019 12:41:42 -0700
From: tip-bot for Adrian Hunter <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: yao.jin@...ux.intel.com, adrian.hunter@...el.com,
linux-kernel@...r.kernel.org, jolsa@...hat.com, acme@...hat.com,
mingo@...nel.org, hpa@...or.com, tglx@...utronix.de
Subject: [tip:perf/core] perf intel-pt: Factor out intel_pt_reposition()
Commit-ID: 6492e5f013d9975d68528150edadead91e97a78a
Gitweb: https://git.kernel.org/tip/6492e5f013d9975d68528150edadead91e97a78a
Author: Adrian Hunter <adrian.hunter@...el.com>
AuthorDate: Tue, 4 Jun 2019 16:00:04 +0300
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Mon, 10 Jun 2019 16:20:12 -0300
perf intel-pt: Factor out intel_pt_reposition()
Factor out intel_pt_reposition() so it can be reused.
Signed-off-by: Adrian Hunter <adrian.hunter@...el.com>
Cc: Jin Yao <yao.jin@...ux.intel.com>
Cc: Jiri Olsa <jolsa@...hat.com>
Link: http://lkml.kernel.org/r/20190604130017.31207-7-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/util/intel-pt-decoder/intel-pt-decoder.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c b/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c
index c06dceb774e9..70bff7bb79f3 100644
--- a/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c
+++ b/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c
@@ -494,6 +494,14 @@ static inline void intel_pt_update_sample_time(struct intel_pt_decoder *decoder)
decoder->sample_insn_cnt = decoder->timestamp_insn_cnt;
}
+static void intel_pt_reposition(struct intel_pt_decoder *decoder)
+{
+ decoder->ip = 0;
+ decoder->pkt_state = INTEL_PT_STATE_NO_PSB;
+ decoder->timestamp = 0;
+ decoder->have_tma = false;
+}
+
static int intel_pt_get_data(struct intel_pt_decoder *decoder)
{
struct intel_pt_buffer buffer = { .buf = 0, };
@@ -512,11 +520,8 @@ static int intel_pt_get_data(struct intel_pt_decoder *decoder)
return -ENODATA;
}
if (!buffer.consecutive) {
- decoder->ip = 0;
- decoder->pkt_state = INTEL_PT_STATE_NO_PSB;
+ intel_pt_reposition(decoder);
decoder->ref_timestamp = buffer.ref_timestamp;
- decoder->timestamp = 0;
- decoder->have_tma = false;
decoder->state.trace_nr = buffer.trace_nr;
intel_pt_log("Reference timestamp 0x%" PRIx64 "\n",
decoder->ref_timestamp);
Powered by blists - more mailing lists