Linux Perf
intel-pt-insn-decoder.h
Go to the documentation of this file.
1
/*
2
* intel_pt_insn_decoder.h: Intel Processor Trace support
3
* Copyright (c) 2013-2014, Intel Corporation.
4
*
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.
8
*
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
12
* more details.
13
*
14
*/
15
16
#ifndef INCLUDE__INTEL_PT_INSN_DECODER_H__
17
#define INCLUDE__INTEL_PT_INSN_DECODER_H__
18
19
#include <stddef.h>
20
#include <stdint.h>
21
22
#define INTEL_PT_INSN_DESC_MAX 32
23
#define INTEL_PT_INSN_BUF_SZ 16
24
25
enum
intel_pt_insn_op
{
26
INTEL_PT_OP_OTHER
,
27
INTEL_PT_OP_CALL
,
28
INTEL_PT_OP_RET
,
29
INTEL_PT_OP_JCC
,
30
INTEL_PT_OP_JMP
,
31
INTEL_PT_OP_LOOP
,
32
INTEL_PT_OP_IRET
,
33
INTEL_PT_OP_INT
,
34
INTEL_PT_OP_SYSCALL
,
35
INTEL_PT_OP_SYSRET
,
36
};
37
38
enum
intel_pt_insn_branch
{
39
INTEL_PT_BR_NO_BRANCH
,
40
INTEL_PT_BR_INDIRECT
,
41
INTEL_PT_BR_CONDITIONAL
,
42
INTEL_PT_BR_UNCONDITIONAL
,
43
};
44
45
struct
intel_pt_insn
{
46
enum
intel_pt_insn_op
op
;
47
enum
intel_pt_insn_branch
branch
;
48
int
length
;
49
int32_t
rel
;
50
unsigned
char
buf
[
INTEL_PT_INSN_BUF_SZ
];
51
};
52
53
int
intel_pt_get_insn
(
const
unsigned
char
*
buf
,
size_t
len,
int
x86_64,
54
struct
intel_pt_insn
*
intel_pt_insn
);
55
56
const
char
*
intel_pt_insn_name
(
enum
intel_pt_insn_op
op
);
57
58
int
intel_pt_insn_desc
(
const
struct
intel_pt_insn
*
intel_pt_insn
,
char
*
buf
,
59
size_t
buf_len);
60
61
int
intel_pt_insn_type
(
enum
intel_pt_insn_op
op
);
62
63
#endif
INTEL_PT_OP_LOOP
Definition:
intel-pt-insn-decoder.h:31
INTEL_PT_OP_SYSCALL
Definition:
intel-pt-insn-decoder.h:34
INTEL_PT_OP_OTHER
Definition:
intel-pt-insn-decoder.h:26
INTEL_PT_BR_NO_BRANCH
Definition:
intel-pt-insn-decoder.h:39
intel_pt_insn
Definition:
intel-pt-insn-decoder.h:45
intel_pt_insn_op
intel_pt_insn_op
Definition:
intel-pt-insn-decoder.h:25
INTEL_PT_INSN_BUF_SZ
#define INTEL_PT_INSN_BUF_SZ
Definition:
intel-pt-insn-decoder.h:23
INTEL_PT_OP_JMP
Definition:
intel-pt-insn-decoder.h:30
intel_pt_insn::branch
enum intel_pt_insn_branch branch
Definition:
intel-pt-insn-decoder.h:47
intel_pt_insn_desc
int intel_pt_insn_desc(const struct intel_pt_insn *intel_pt_insn, char *buf, size_t buf_len)
Definition:
intel-pt-insn-decoder.c:224
intel_pt_insn_name
const char * intel_pt_insn_name(enum intel_pt_insn_op op)
Definition:
intel-pt-insn-decoder.c:219
INTEL_PT_OP_JCC
Definition:
intel-pt-insn-decoder.h:29
intel_pt_insn::rel
int32_t rel
Definition:
intel-pt-insn-decoder.h:49
INTEL_PT_OP_IRET
Definition:
intel-pt-insn-decoder.h:32
INTEL_PT_BR_UNCONDITIONAL
Definition:
intel-pt-insn-decoder.h:42
intel_pt_get_insn
int intel_pt_get_insn(const unsigned char *buf, size_t len, int x86_64, struct intel_pt_insn *intel_pt_insn)
Definition:
intel-pt-insn-decoder.c:166
intel_pt_insn::length
int length
Definition:
intel-pt-insn-decoder.h:48
intel_pt_insn::buf
unsigned char buf[INTEL_PT_INSN_BUF_SZ]
Definition:
intel-pt-insn-decoder.h:50
intel_pt_insn::op
enum intel_pt_insn_op op
Definition:
intel-pt-insn-decoder.h:46
INTEL_PT_OP_SYSRET
Definition:
intel-pt-insn-decoder.h:35
INTEL_PT_BR_CONDITIONAL
Definition:
intel-pt-insn-decoder.h:41
intel_pt_insn_branch
intel_pt_insn_branch
Definition:
intel-pt-insn-decoder.h:38
INTEL_PT_OP_CALL
Definition:
intel-pt-insn-decoder.h:27
INTEL_PT_BR_INDIRECT
Definition:
intel-pt-insn-decoder.h:40
INTEL_PT_OP_INT
Definition:
intel-pt-insn-decoder.h:33
intel_pt_insn_type
int intel_pt_insn_type(enum intel_pt_insn_op op)
Definition:
intel-pt-insn-decoder.c:244
INTEL_PT_OP_RET
Definition:
intel-pt-insn-decoder.h:28
util
intel-pt-decoder
intel-pt-insn-decoder.h
Generated by
1.8.13