]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.c
perf script: Fix LBR skid dump problems in brstackinsn
[linux.git] / tools / perf / util / intel-pt-decoder / intel-pt-insn-decoder.c
index 54818828023bf4ad0960165d26afce60fe7166d1..1c0e289f01e6fe077079de8de4ae7f6fe3c43323 100644 (file)
@@ -180,6 +180,14 @@ int intel_pt_get_insn(const unsigned char *buf, size_t len, int x86_64,
        return 0;
 }
 
+int arch_is_branch(const unsigned char *buf, size_t len, int x86_64)
+{
+       struct intel_pt_insn in;
+       if (intel_pt_get_insn(buf, len, x86_64, &in) < 0)
+               return -1;
+       return in.branch != INTEL_PT_BR_NO_BRANCH;
+}
+
 const char *dump_insn(struct perf_insn *x, uint64_t ip __maybe_unused,
                      u8 *inbuf, int inlen, int *lenp)
 {