mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
perf intel-pt: Fix sample timestamp wrt non-taken branches
The sample timestamp is updated to ensure that the timestamp represents the time of the sample and not a branch that the decoder is still walking towards. The sample timestamp is updated when the decoder returns, but the decoder does not return for non-taken branches. Update the sample timestamp then also. Note that commit3f04d98e97("perf intel-pt: Improve sample timestamp") was also a stable fix and appears, for example, in v4.4 stable tree as commit a4ebb58fd124 ("perf intel-pt: Improve sample timestamp"). Signed-off-by: Adrian Hunter <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: [email protected] # v4.4+ Fixes:3f04d98e97("perf intel-pt: Improve sample timestamp") Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
This commit is contained in:
parent
61b6e08dc8
commit
1b6599a9d8
1 changed files with 4 additions and 1 deletions
|
|
@ -1318,8 +1318,11 @@ static int intel_pt_walk_tnt(struct intel_pt_decoder *decoder)
|
|||
return 0;
|
||||
}
|
||||
decoder->ip += intel_pt_insn.length;
|
||||
if (!decoder->tnt.count)
|
||||
if (!decoder->tnt.count) {
|
||||
decoder->sample_timestamp = decoder->timestamp;
|
||||
decoder->sample_insn_cnt = decoder->timestamp_insn_cnt;
|
||||
return -EAGAIN;
|
||||
}
|
||||
decoder->tnt.payload <<= 1;
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue