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>
This commit is contained in:
Adrian Hunter
2019-05-20 14:37:16 +03:00
committed by Arnaldo Carvalho de Melo
parent 9bc668e3bc
commit f3c98c4b5a

View File

@@ -2128,18 +2128,29 @@ static int intel_pt_walk_to_ip(struct intel_pt_decoder *decoder)
switch (decoder->packet.type) { switch (decoder->packet.type) {
case INTEL_PT_TIP_PGD: case INTEL_PT_TIP_PGD:
decoder->continuous_period = false; decoder->continuous_period = false;
__fallthrough; decoder->pge = false;
case INTEL_PT_TIP_PGE: if (intel_pt_have_ip(decoder))
case INTEL_PT_TIP: intel_pt_set_ip(decoder);
decoder->pge = decoder->packet.type != INTEL_PT_TIP_PGD; 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 = true;
if (intel_pt_have_ip(decoder)) if (intel_pt_have_ip(decoder))
intel_pt_set_ip(decoder); intel_pt_set_ip(decoder);
if (!decoder->ip) if (!decoder->ip)
break; 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; return 0;
case INTEL_PT_FUP: case INTEL_PT_FUP: