diff options
Diffstat (limited to 'tools/perf/util/intel-pt-decoder')
4 files changed, 26 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 0ac860c8dd2b..b450178e3420 100644 --- a/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c +++ b/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c @@ -1998,6 +1998,8 @@ static void intel_pt_calc_cbr(struct intel_pt_decoder *decoder)  	decoder->cbr = cbr;  	decoder->cbr_cyc_to_tsc = decoder->max_non_turbo_ratio_fp / cbr; +	decoder->cyc_ref_timestamp = decoder->timestamp; +	decoder->cycle_cnt = 0;  	intel_pt_mtc_cyc_cnt_cbr(decoder);  } @@ -3544,7 +3546,7 @@ static int intel_pt_walk_psb(struct intel_pt_decoder *decoder)  		switch (decoder->packet.type) {  		case INTEL_PT_TIP_PGD:  			decoder->continuous_period = false; -			__fallthrough; +			fallthrough;  		case INTEL_PT_TIP_PGE:  		case INTEL_PT_TIP:  		case INTEL_PT_PTWRITE: @@ -3614,7 +3616,7 @@ static int intel_pt_walk_psb(struct intel_pt_decoder *decoder)  			decoder->pge = false;  			decoder->continuous_period = false;  			intel_pt_clear_tx_flags(decoder); -			__fallthrough; +			fallthrough;  		case INTEL_PT_TNT:  			decoder->have_tma = false; @@ -3978,7 +3980,7 @@ const struct intel_pt_state *intel_pt_decode(struct intel_pt_decoder *decoder)  			decoder->have_last_ip = false;  			decoder->last_ip = 0;  			decoder->ip = 0; -			__fallthrough; +			fallthrough;  		case INTEL_PT_STATE_ERR_RESYNC:  			err = intel_pt_sync_ip(decoder);  			break; diff --git a/tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.c b/tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.c index 22308dd93010..c5d57027ec23 100644 --- a/tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.c +++ b/tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.c @@ -52,6 +52,20 @@ static void intel_pt_insn_decoder(struct insn *insn,  				op = INTEL_PT_OP_VMENTRY;  				branch = INTEL_PT_BR_INDIRECT;  				break; +			case 0xca: +				switch (insn->prefixes.bytes[3]) { +				case 0xf2: /* erets */ +					op = INTEL_PT_OP_ERETS; +					branch = INTEL_PT_BR_INDIRECT; +					break; +				case 0xf3: /* eretu */ +					op = INTEL_PT_OP_ERETU; +					branch = INTEL_PT_BR_INDIRECT; +					break; +				default: +					break; +				} +				break;  			default:  				break;  			} @@ -230,6 +244,8 @@ const char *branch_name[] = {  	[INTEL_PT_OP_SYSCALL]	= "Syscall",  	[INTEL_PT_OP_SYSRET]	= "Sysret",  	[INTEL_PT_OP_VMENTRY]	= "VMentry", +	[INTEL_PT_OP_ERETS]	= "Erets", +	[INTEL_PT_OP_ERETU]	= "Eretu",  };  const char *intel_pt_insn_name(enum intel_pt_insn_op op) @@ -273,6 +289,8 @@ int intel_pt_insn_type(enum intel_pt_insn_op op)  	case INTEL_PT_OP_LOOP:  		return PERF_IP_FLAG_BRANCH | PERF_IP_FLAG_CONDITIONAL;  	case INTEL_PT_OP_IRET: +	case INTEL_PT_OP_ERETS: +	case INTEL_PT_OP_ERETU:  		return PERF_IP_FLAG_BRANCH | PERF_IP_FLAG_RETURN |  		       PERF_IP_FLAG_INTERRUPT;  	case INTEL_PT_OP_INT: diff --git a/tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.h b/tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.h index e3338b56a75f..7fb7fe3a1566 100644 --- a/tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.h +++ b/tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.h @@ -25,6 +25,8 @@ enum intel_pt_insn_op {  	INTEL_PT_OP_SYSCALL,  	INTEL_PT_OP_SYSRET,  	INTEL_PT_OP_VMENTRY, +	INTEL_PT_OP_ERETS, +	INTEL_PT_OP_ERETU,  };  enum intel_pt_insn_branch { diff --git a/tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c b/tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c index 18f97f43e01a..af9710622a1f 100644 --- a/tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c +++ b/tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c @@ -730,7 +730,7 @@ int intel_pt_pkt_desc(const struct intel_pt_pkt *packet, char *buf,  	case INTEL_PT_FUP:  		if (!(packet->count))  			return snprintf(buf, buf_len, "%s no ip", name); -		__fallthrough; +		fallthrough;  	case INTEL_PT_CYC:  	case INTEL_PT_VMCS:  	case INTEL_PT_MTC:  |