Commit abe5a1d3 authored by Adrian Hunter's avatar Adrian Hunter Committed by Arnaldo Carvalho de Melo

perf intel-pt: Decoder to output CBR changes immediately

The core-to-bus ratio (CBR) provides the CPU frequency. With branches
enabled, the decoder was outputting CBR changes only when there was a
branch. That loses the correct time of the change if the trace is not in
context (e.g. not tracing kernel space). Change to output the CBR change
immediately.
Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/20190622093248.581-2-adrian.hunter@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 9f94c7f9
...@@ -2015,16 +2015,8 @@ static int intel_pt_walk_trace(struct intel_pt_decoder *decoder) ...@@ -2015,16 +2015,8 @@ static int intel_pt_walk_trace(struct intel_pt_decoder *decoder)
case INTEL_PT_CBR: case INTEL_PT_CBR:
intel_pt_calc_cbr(decoder); intel_pt_calc_cbr(decoder);
if (!decoder->branch_enable && if (decoder->cbr != decoder->cbr_seen)
decoder->cbr != decoder->cbr_seen) {
decoder->cbr_seen = decoder->cbr;
decoder->state.type = INTEL_PT_CBR_CHG;
decoder->state.from_ip = decoder->ip;
decoder->state.to_ip = 0;
decoder->state.cbr_payload =
decoder->packet.payload;
return 0; return 0;
}
break; break;
case INTEL_PT_MODE_EXEC: case INTEL_PT_MODE_EXEC:
...@@ -2626,8 +2618,12 @@ const struct intel_pt_state *intel_pt_decode(struct intel_pt_decoder *decoder) ...@@ -2626,8 +2618,12 @@ const struct intel_pt_state *intel_pt_decode(struct intel_pt_decoder *decoder)
decoder->sample_tot_cyc_cnt = decoder->tot_cyc_cnt; decoder->sample_tot_cyc_cnt = decoder->tot_cyc_cnt;
} else { } else {
decoder->state.err = 0; decoder->state.err = 0;
if (decoder->cbr != decoder->cbr_seen && decoder->state.type) { if (decoder->cbr != decoder->cbr_seen) {
decoder->cbr_seen = decoder->cbr; decoder->cbr_seen = decoder->cbr;
if (!decoder->state.type) {
decoder->state.from_ip = decoder->ip;
decoder->state.to_ip = 0;
}
decoder->state.type |= INTEL_PT_CBR_CHG; decoder->state.type |= INTEL_PT_CBR_CHG;
decoder->state.cbr_payload = decoder->cbr_payload; decoder->state.cbr_payload = decoder->cbr_payload;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment