2 * intel_pt_insn_decoder.h: Intel Processor Trace support
3 * Copyright (c) 2013-2014, Intel Corporation.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 #ifndef INCLUDE__INTEL_PT_INSN_DECODER_H__
17 #define INCLUDE__INTEL_PT_INSN_DECODER_H__
22 #define INTEL_PT_INSN_DESC_MAX 32
23 #define INTEL_PT_INSN_DBG_BUF_SZ 16
25 enum intel_pt_insn_op
{
38 enum intel_pt_insn_branch
{
39 INTEL_PT_BR_NO_BRANCH
,
41 INTEL_PT_BR_CONDITIONAL
,
42 INTEL_PT_BR_UNCONDITIONAL
,
45 struct intel_pt_insn
{
46 enum intel_pt_insn_op op
;
47 enum intel_pt_insn_branch branch
;
50 unsigned char buf
[INTEL_PT_INSN_DBG_BUF_SZ
];
53 int intel_pt_get_insn(const unsigned char *buf
, size_t len
, int x86_64
,
54 struct intel_pt_insn
*intel_pt_insn
);
56 const char *intel_pt_insn_name(enum intel_pt_insn_op op
);
58 int intel_pt_insn_desc(const struct intel_pt_insn
*intel_pt_insn
, char *buf
,
61 size_t intel_pt_insn_max_size(void);
63 int intel_pt_insn_type(enum intel_pt_insn_op op
);