linux-kernel-test/tools/perf
Adrian Hunter 98e4619f2b perf tools: Add a test for decoding of new x86 instructions
Add a new test titled:

	Test x86 instruction decoder - new instructions

The purpose of this test is to check the instruction decoder after new
instructions have been added.  Initially, MPX instructions are tested
which are already supported, but the definitions in x86-opcode-map.txt
will be tweaked in a subsequent patch, after which this test can be run
to verify those changes.

The data for the test comes from assembly language instructions in
insn-x86-dat-src.c which is converted into bytes by the scripts
gen-insn-x86-dat.sh and gen-insn-x86-dat.awk, and included into the test
program insn-x86.c as insn-x86-dat-32.c and insn-x86-dat-64.c.

The conversion is not done as part of the perf tools build because the
test data must be under (git) change control in order for the test to be
repeatably-correct.  Also it may require a recent version of binutils.

Commiter notes:

Using it:

  # perf test decoder
  39: Test x86 instruction decoder - new instructions          : Ok
  # perf test -v decoder
  39: Test x86 instruction decoder - new instructions          :
  --- start ---
  test child forked, pid 21970
  Decoded ok: 0f 31                	rdtsc
  Decoded ok: f3 0f 1b 00          	bndmk  (%eax),%bnd0
  Decoded ok: f3 0f 1b 05 78 56 34 12 	bndmk  0x12345678,%bnd0
  Decoded ok: f3 0f 1b 18          	bndmk  (%eax),%bnd3
  <SNIP>
  Decoded ok: f2 e9 00 00 00 00    	bnd jmpq 402 <main+0x402>
  Decoded ok: f2 e9 00 00 00 00    	bnd jmpq 408 <main+0x408>
  Decoded ok: 67 f2 ff 21          	bnd jmpq *(%ecx)
  Decoded ok: f2 0f 85 00 00 00 00 	bnd jne 413 <main+0x413>
  test child finished with 0
  ---- end ----
  Test x86 instruction decoder - new instructions: Ok
  #

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Qiaowei Ren <qiaowei.ren@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1441196131-20632-3-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-09-04 12:01:02 -03:00
..
arch perf tools: Fix link time error with sample_reg_masks on non x86 2015-09-01 13:04:41 -03:00
bench perf bench futex: Add lock_pi stresser 2015-07-20 17:49:51 -03:00
config perf tools: Support static linking with libdw 2015-08-13 14:49:11 -03:00
Documentation perf record: Add ability to name registers to record 2015-08-31 18:01:33 -03:00
python perf python: Make twatch.py use soft dummy event, freq=0 2015-07-29 10:51:45 -03:00
scripts perf scripts python: Add new compaction-times script 2015-08-28 14:53:40 -03:00
tests perf tools: Add a test for decoding of new x86 instructions 2015-09-04 12:01:02 -03:00
trace/strace/groups perf trace: Support 'strace' syscall event groups 2015-07-20 15:16:32 -03:00
ui perf tools: Rename perf_session_env to perf_env 2015-08-28 14:53:55 -03:00
util perf tools: Display build warning if x86 instruction decoder differs from kernel 2015-09-04 12:01:01 -03:00
.gitignore perf tools: Add Intel PT instruction decoder 2015-08-17 11:11:36 -03:00
Build perf trace: Support 'strace' syscall event groups 2015-07-20 15:16:32 -03:00
builtin-annotate.c perf annotate: Reset the dso find_symbol cache when removing symbols 2015-08-24 13:33:14 -03:00
builtin-bench.c perf bench futex: Add lock_pi stresser 2015-07-20 17:49:51 -03:00
builtin-buildid-cache.c perf buildid: Introduce sysfs/filename__sprintf_build_id 2015-08-28 14:53:50 -03:00
builtin-buildid-list.c perf buildid: Introduce sysfs/filename__sprintf_build_id 2015-08-28 14:53:50 -03:00
builtin-data.c
builtin-diff.c perf callchain: Allow disabling call graphs per event 2015-08-12 13:20:28 -03:00
builtin-evlist.c
builtin-help.c
builtin-inject.c perf tools: Add new PERF_RECORD_SWITCH event 2015-07-23 22:51:13 -03:00
builtin-kmem.c perf kmem: Fill in the missing session freeing after an error occurs 2015-07-01 17:53:49 -03:00
builtin-kvm.c perf kvm: Fill in the missing session freeing after an error occurs 2015-07-01 17:53:49 -03:00
builtin-list.c
builtin-lock.c perf machine: Protect the machine->threads with a rwlock 2015-05-08 16:19:27 -03:00
builtin-mem.c perf mem: Fill in the missing session freeing after an error occurs 2015-07-01 17:53:49 -03:00
builtin-probe.c perf probe: Delete an unnecessary check before the function call "strfilter__delete" 2015-07-06 08:58:36 -03:00
builtin-record.c perf record: Add ability to name registers to record 2015-08-31 18:01:33 -03:00
builtin-report.c perf report: Show call graph from reference events 2015-08-12 13:20:28 -03:00
builtin-sched.c perf sched: Add option to merge like comms to lat output 2015-05-27 12:21:45 -03:00
builtin-script.c perf script: Enable printing of interrupted machine state 2015-08-31 17:51:07 -03:00
builtin-stat.c perf stat: Quieten failed to read counter message 2015-09-02 16:30:47 -03:00
builtin-timechart.c perf tools: Elliminate alignment holes 2015-05-18 10:17:33 -03:00
builtin-top.c Merge branch 'perf/urgent' into perf/core, to pick up fixes before adding more changes 2015-08-20 11:48:56 +02:00
builtin-trace.c tools lib api fs: Move debugfs__strerror_open into tracing_path.c object 2015-09-04 12:00:58 -03:00
builtin.h
command-list.txt
CREDITS
design.txt
Makefile perf build: Fix single target build dependency check 2015-06-22 11:27:09 -03:00
Makefile.perf perf tools: Add Intel PT instruction decoder 2015-08-17 11:11:36 -03:00
MANIFEST perf tools: Copy linux/filter.h to tools/include 2015-09-02 16:30:46 -03:00
perf-archive.sh
perf-completion.sh
perf-read-vdso.c
perf-sys.h perf tools: Move generic barriers out of perf-sys.h 2015-05-08 16:05:08 -03:00
perf-with-kcore.sh perf tools: Fix perf-with-kcore handling of arguments containing spaces 2015-08-06 16:48:27 -03:00
perf.c tools lib api fs: Move tracing_path interface into api/fs/tracing_path.c 2015-09-04 12:00:45 -03:00
perf.h perf record: Add ability to name registers to record 2015-08-31 18:01:33 -03:00