Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / tools / perf / util / intel-pt-decoder / intel-pt-insn-decoder.h
blob7fb7fe3a156607763fae4af67271f38d27d9804b
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3 * intel_pt_insn_decoder.h: Intel Processor Trace support
4 * Copyright (c) 2013-2014, Intel Corporation.
5 */
7 #ifndef INCLUDE__INTEL_PT_INSN_DECODER_H__
8 #define INCLUDE__INTEL_PT_INSN_DECODER_H__
10 #include <stddef.h>
11 #include <stdint.h>
13 #define INTEL_PT_INSN_DESC_MAX 32
14 #define INTEL_PT_INSN_BUF_SZ 16
16 enum intel_pt_insn_op {
17 INTEL_PT_OP_OTHER,
18 INTEL_PT_OP_CALL,
19 INTEL_PT_OP_RET,
20 INTEL_PT_OP_JCC,
21 INTEL_PT_OP_JMP,
22 INTEL_PT_OP_LOOP,
23 INTEL_PT_OP_IRET,
24 INTEL_PT_OP_INT,
25 INTEL_PT_OP_SYSCALL,
26 INTEL_PT_OP_SYSRET,
27 INTEL_PT_OP_VMENTRY,
28 INTEL_PT_OP_ERETS,
29 INTEL_PT_OP_ERETU,
32 enum intel_pt_insn_branch {
33 INTEL_PT_BR_NO_BRANCH,
34 INTEL_PT_BR_INDIRECT,
35 INTEL_PT_BR_CONDITIONAL,
36 INTEL_PT_BR_UNCONDITIONAL,
39 struct intel_pt_insn {
40 enum intel_pt_insn_op op;
41 enum intel_pt_insn_branch branch;
42 bool emulated_ptwrite;
43 int length;
44 int32_t rel;
45 unsigned char buf[INTEL_PT_INSN_BUF_SZ];
48 int intel_pt_get_insn(const unsigned char *buf, size_t len, int x86_64,
49 struct intel_pt_insn *intel_pt_insn);
51 const char *intel_pt_insn_name(enum intel_pt_insn_op op);
53 int intel_pt_insn_desc(const struct intel_pt_insn *intel_pt_insn, char *buf,
54 size_t buf_len);
56 int intel_pt_insn_type(enum intel_pt_insn_op op);
58 #endif