linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: tip-bot for Adrian Hunter <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: acme@redhat.com, hpa@zytor.com, linux-kernel@vger.kernel.org,
	adrian.hunter@intel.com, mingo@kernel.org, tglx@linutronix.de,
	jolsa@redhat.com
Subject: [tip:perf/core] perf intel-pt: Re-factor TIP cases in intel_pt_walk_to_ip
Date: Mon, 17 Jun 2019 12:03:23 -0700	[thread overview]
Message-ID: <tip-f3c98c4b5ac831f29b1cc19fa84d3c8401f846d6@git.kernel.org> (raw)
In-Reply-To: <20190520113728.14389-11-adrian.hunter@intel.com>

Commit-ID:  f3c98c4b5ac831f29b1cc19fa84d3c8401f846d6
Gitweb:     https://git.kernel.org/tip/f3c98c4b5ac831f29b1cc19fa84d3c8401f846d6
Author:     Adrian Hunter <adrian.hunter@intel.com>
AuthorDate: Mon, 20 May 2019 14:37:16 +0300
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 5 Jun 2019 09:47:56 -0300

perf intel-pt: Re-factor TIP cases in intel_pt_walk_to_ip

To make it easier to add new code for different TIP cases, separate each
case.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/20190520113728.14389-11-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 .../perf/util/intel-pt-decoder/intel-pt-decoder.c  | 23 ++++++++++++++++------
 1 file changed, 17 insertions(+), 6 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 a2384a314990..99773445872d 100644
--- a/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c
+++ b/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c
@@ -2128,18 +2128,29 @@ static int intel_pt_walk_to_ip(struct intel_pt_decoder *decoder)
 		switch (decoder->packet.type) {
 		case INTEL_PT_TIP_PGD:
 			decoder->continuous_period = false;
-			__fallthrough;
+			decoder->pge = false;
+			if (intel_pt_have_ip(decoder))
+				intel_pt_set_ip(decoder);
+			if (!decoder->ip)
+				break;
+			decoder->state.type |= INTEL_PT_TRACE_END;
+			return 0;
+
 		case INTEL_PT_TIP_PGE:
+			decoder->pge = true;
+			if (intel_pt_have_ip(decoder))
+				intel_pt_set_ip(decoder);
+			if (!decoder->ip)
+				break;
+			decoder->state.type |= INTEL_PT_TRACE_BEGIN;
+			return 0;
+
 		case INTEL_PT_TIP:
-			decoder->pge = decoder->packet.type != INTEL_PT_TIP_PGD;
+			decoder->pge = true;
 			if (intel_pt_have_ip(decoder))
 				intel_pt_set_ip(decoder);
 			if (!decoder->ip)
 				break;
-			if (decoder->packet.type == INTEL_PT_TIP_PGE)
-				decoder->state.type |= INTEL_PT_TRACE_BEGIN;
-			if (decoder->packet.type == INTEL_PT_TIP_PGD)
-				decoder->state.type |= INTEL_PT_TRACE_END;
 			return 0;
 
 		case INTEL_PT_FUP:

  reply	other threads:[~2019-06-17 19:03 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-20 11:37 [PATCH 00/22] perf intel-pt: Add support for instructions-per-cycle (IPC) Adrian Hunter
2019-05-20 11:37 ` [PATCH 01/22] perf intel-pt: Fix itrace defaults for perf script Adrian Hunter
2019-05-20 13:58   ` Sasha Levin
2019-05-20 14:45   ` Arnaldo Carvalho de Melo
2019-05-31 16:45     ` Arnaldo Carvalho de Melo
2019-06-04 11:32       ` Adrian Hunter
2019-06-04 13:20         ` Arnaldo Carvalho de Melo
2019-05-30  7:53   ` [tip:perf/core] " tip-bot for Adrian Hunter
2019-05-20 11:37 ` [PATCH 02/22] perf auxtrace: " Adrian Hunter
2019-05-30  7:54   ` [tip:perf/core] " tip-bot for Adrian Hunter
2019-05-20 11:37 ` [PATCH 03/22] perf intel-pt: Fix itrace defaults for perf script intel-pt documentation Adrian Hunter
2019-05-30  7:54   ` [tip:perf/core] " tip-bot for Adrian Hunter
2019-05-20 11:37 ` [PATCH 04/22] perf intel-pt: Factor out intel_pt_update_sample_time Adrian Hunter
2019-06-17 18:59   ` [tip:perf/core] " tip-bot for Adrian Hunter
2019-05-20 11:37 ` [PATCH 05/22] perf intel-pt: Accumulate cycle count from CYC packets Adrian Hunter
2019-06-17 18:59   ` [tip:perf/core] " tip-bot for Adrian Hunter
2019-05-20 11:37 ` [PATCH 06/22] perf tools: Add IPC information to perf_sample Adrian Hunter
2019-06-17 19:00   ` [tip:perf/core] " tip-bot for Adrian Hunter
2019-05-20 11:37 ` [PATCH 07/22] perf intel-pt: Add support for samples to contain IPC ratio Adrian Hunter
2019-06-17 19:01   ` [tip:perf/core] " tip-bot for Adrian Hunter
2019-05-20 11:37 ` [PATCH 08/22] perf script: Add output of " Adrian Hunter
2019-06-17 19:01   ` [tip:perf/core] " tip-bot for Adrian Hunter
2019-05-20 11:37 ` [PATCH 09/22] perf intel-pt: Record when decoding PSB+ packets Adrian Hunter
2019-06-17 19:02   ` [tip:perf/core] " tip-bot for Adrian Hunter
2019-05-20 11:37 ` [PATCH 10/22] perf intel-pt: Re-factor TIP cases in intel_pt_walk_to_ip Adrian Hunter
2019-06-17 19:03   ` tip-bot for Adrian Hunter [this message]
2019-05-20 11:37 ` [PATCH 11/22] perf intel-pt: Accumulate cycle count from TSC/TMA/MTC packets Adrian Hunter
2019-06-17 19:04   ` [tip:perf/core] " tip-bot for Adrian Hunter
2019-05-20 11:37 ` [PATCH 12/22] perf intel-pt: Document IPC usage Adrian Hunter
2019-06-17 19:04   ` [tip:perf/core] " tip-bot for Adrian Hunter
2019-05-20 11:37 ` [PATCH 13/22] perf thread-stack: Accumulate IPC information Adrian Hunter
2019-06-17 19:05   ` [tip:perf/core] " tip-bot for Adrian Hunter
2019-05-20 11:37 ` [PATCH 14/22] perf db-export: Add brief documentation Adrian Hunter
2019-06-17 19:06   ` [tip:perf/core] " tip-bot for Adrian Hunter
2019-05-20 11:37 ` [PATCH 15/22] perf db-export: Export IPC information Adrian Hunter
2019-06-17 19:07   ` [tip:perf/core] " tip-bot for Adrian Hunter
2019-05-20 11:37 ` [PATCH 16/22] perf scripts python: export-to-sqlite.py: " Adrian Hunter
2019-06-17 19:07   ` [tip:perf/core] " tip-bot for Adrian Hunter
2019-05-20 11:37 ` [PATCH 17/22] perf scripts python: export-to-postgresql.py: " Adrian Hunter
2019-06-17 19:08   ` [tip:perf/core] " tip-bot for Adrian Hunter
2019-05-20 11:37 ` [PATCH 18/22] perf scripts python: exported-sql-viewer.py: Add IPC information to the Branch reports Adrian Hunter
2019-05-31 16:44   ` Arnaldo Carvalho de Melo
2019-06-03  5:50     ` Adrian Hunter
2019-06-17 19:09   ` [tip:perf/core] " tip-bot for Adrian Hunter
2019-05-20 11:37 ` [PATCH 19/22] perf scripts python: exported-sql-viewer.py: Add CallGraphModelParams Adrian Hunter
2019-06-17 19:09   ` [tip:perf/core] " tip-bot for Adrian Hunter
2019-05-20 11:37 ` [PATCH 20/22] perf scripts python: exported-sql-viewer.py: Add IPC information to Call Graph Graph Adrian Hunter
2019-06-17 19:10   ` [tip:perf/core] " tip-bot for Adrian Hunter
2019-05-20 11:37 ` [PATCH 21/22] perf scripts python: exported-sql-viewer.py: Add IPC information to Call Tree Adrian Hunter
2019-06-17 19:11   ` [tip:perf/core] " tip-bot for Adrian Hunter
2019-05-20 11:37 ` [PATCH 22/22] perf scripts python: exported-sql-viewer.py: Select find text when find bar is activated Adrian Hunter
2019-06-17 19:11   ` [tip:perf/core] " tip-bot for Adrian Hunter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-f3c98c4b5ac831f29b1cc19fa84d3c8401f846d6@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=acme@redhat.com \
    --cc=adrian.hunter@intel.com \
    --cc=hpa@zytor.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).