summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorSandipan Das <sandipan.das@amd.com>2022-08-11 17:59:58 +0530
committerPeter Zijlstra <peterz@infradead.org>2022-08-27 00:05:44 +0200
commitdf3e9612f758fb5f9c251cbe262e3c68ffe67b2c (patch)
tree332c39baad41b137a57aa1b0974fe41ca7ec00bb /tools/perf/scripts/python
parentf9c732249b110fae9ebf4ce33db4cb3a12c6eae3 (diff)
perf/x86: Make branch classifier fusion-aware
With branch fusion and other optimizations, branch sampling hardware in some processors can report a branch from address that points to an instruction preceding the actual branch by several bytes. In such cases, the classifier cannot determine the branch type which leads to failures such as with the recently added test from commit b55878c90ab9 ("perf test: Add test for branch stack sampling"). Branch information is also easier to consume and annotate if branch from addresses always point to branch instructions. Add a new variant of the branch classifier that can account for instruction fusion. If fusion is expected and the current branch from address does not point to a branch instruction, it attempts to find the first branch within the next (MAX_INSN_SIZE - 1) bytes and if found, additionally provides the offset between the reported branch from address and the address of the expected branch instruction. Signed-off-by: Sandipan Das <sandipan.das@amd.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lore.kernel.org/r/b6bb0abaa8a54c0b6d716344700ee11a1793d709.1660211399.git.sandipan.das@amd.com
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions