perf intel-pt: Fix CYC timestamps after standalone CBR
commit430635a0efupstream. After a standalone CBR (not associated with TSC), update the cycles reference timestamp and reset the cycle count, so that CYC timestamps are calculated relative to that point with the new frequency. Fixes:cc33618619("perf tools: Add Intel PT support for decoding CYC packets") Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Ian Rogers <irogers@google.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20230403154831.8651-2-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
905f847675
commit
a25a403e4b
@@ -1639,6 +1639,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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user