Linux Perf
insn-x86.c File Reference
#include <linux/types.h>
#include "debug.h"
#include "tests/tests.h"
#include "arch-tests.h"
#include "intel-pt-decoder/insn.h"
#include "intel-pt-decoder/intel-pt-insn-decoder.h"
#include "insn-x86-dat-32.c"
#include "insn-x86-dat-64.c"
Include dependency graph for insn-x86.c:

Go to the source code of this file.

Classes

struct  test_data
 

Functions

static int get_op (const char *op_str)
 
static int get_branch (const char *branch_str)
 
static int test_data_item (struct test_data *dat, int x86_64)
 
static int test_data_set (struct test_data *dat_set, int x86_64)
 
int test__insn_x86 (struct test *test __maybe_unused, int subtest __maybe_unused)
 

Variables

struct test_data test_data_32 []
 
struct test_data test_data_64 []
 

Function Documentation

◆ get_branch()

static int get_branch ( const char *  branch_str)
static

Definition at line 67 of file insn-x86.c.

◆ get_op()

static int get_op ( const char *  op_str)
static

Definition at line 34 of file insn-x86.c.

◆ test__insn_x86()

int test__insn_x86 ( struct test *test  __maybe_unused,
int subtest  __maybe_unused 
)

test__insn_x86 - test x86 instruction decoder - new instructions.

This function implements a test that decodes a selection of instructions and checks the results. The Intel PT function that further categorizes instructions (i.e. intel_pt_get_insn()) is also checked.

The instructions are originally in insn-x86-dat-src.c which has been processed by scripts gen-insn-x86-dat.sh and gen-insn-x86-dat.awk to produce insn-x86-dat-32.c and insn-x86-dat-64.c which are included into this program. i.e. to add new instructions to the test, edit insn-x86-dat-src.c, run the gen-insn-x86-dat.sh script, make perf, and then run the test.

If the test passes %0 is returned, otherwise %-1 is returned. Use the verbose (-v) option to see all the instructions and whether or not they decoded successfuly.

Definition at line 175 of file insn-x86.c.

Here is the call graph for this function:

◆ test_data_item()

static int test_data_item ( struct test_data dat,
int  x86_64 
)
static

Definition at line 94 of file insn-x86.c.

Here is the call graph for this function:

◆ test_data_set()

static int test_data_set ( struct test_data dat_set,
int  x86_64 
)
static

Definition at line 145 of file insn-x86.c.

Here is the call graph for this function:

Variable Documentation

◆ test_data_32

struct test_data test_data_32[]

Definition at line 20 of file insn-x86.c.

◆ test_data_64

struct test_data test_data_64[]

Definition at line 27 of file insn-x86.c.