linux/tools/perf/tests
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
..
attr perf tests: Fix attr tests 2015-04-08 10:49:53 -03:00
attr.c tools: Consolidate types.h 2014-05-01 21:22:39 +02:00
attr.py perf tools: Remove EOL whitespaces 2015-01-21 13:24:31 -03:00
bp_signal_overflow.c perf tools: Enable close-on-exec flag on perf file descriptor 2014-07-18 09:09:34 +02:00
bp_signal.c perf tools: Enable close-on-exec flag on perf file descriptor 2014-07-18 09:09:34 +02:00
Build perf tools: Add a test for decoding of new x86 instructions 2015-09-04 12:01:02 -03:00
builtin-test.c perf tools: Add a test for decoding of new x86 instructions 2015-09-04 12:01:02 -03:00
code-reading.c perf tools: Add reference counting for thread_map object 2015-06-25 15:15:50 -03:00
dso-data.c perf tools: Reference count struct dso 2015-06-08 10:31:40 -03:00
dwarf-unwind.c perf tools: Configurable per thread proc map processing time out 2015-06-19 18:27:13 -03:00
evsel-roundtrip-name.c perf tools: Add parse_events_error interface 2015-04-29 10:37:58 -03:00
evsel-tp-sched.c perf tools: Move pr_* debug macros into debug object 2014-07-17 12:58:39 -03:00
fdarray.c tools lib fd array: Allow associating an integer cookie with each entry 2014-09-25 16:46:55 -03:00
gen-insn-x86-dat.awk perf tools: Add a test for decoding of new x86 instructions 2015-09-04 12:01:02 -03:00
gen-insn-x86-dat.sh perf tools: Add a test for decoding of new x86 instructions 2015-09-04 12:01:02 -03:00
hists_common.c perf tools: Reference count struct dso 2015-06-08 10:31:40 -03:00
hists_common.h perf tests: Define and use symbolic names for fake symbols 2014-06-01 14:35:11 +02:00
hists_cumulate.c perf callchain: Allow disabling call graphs per event 2015-08-12 13:20:28 -03:00
hists_filter.c perf hists: Reducing arguments of hist_entry_iter__add() 2015-05-27 12:21:43 -03:00
hists_link.c perf machine: Protect the machine->threads with a rwlock 2015-05-08 16:19:27 -03:00
hists_output.c perf hists: Reducing arguments of hist_entry_iter__add() 2015-05-27 12:21:43 -03:00
insn-x86-dat-32.c perf tools: Add a test for decoding of new x86 instructions 2015-09-04 12:01:02 -03:00
insn-x86-dat-64.c perf tools: Add a test for decoding of new x86 instructions 2015-09-04 12:01:02 -03:00
insn-x86-dat-src.c perf tools: Add a test for decoding of new x86 instructions 2015-09-04 12:01:02 -03:00
insn-x86.c perf tools: Add a test for decoding of new x86 instructions 2015-09-04 12:01:02 -03:00
keep-tracking.c perf tools: Add reference counting for thread_map object 2015-06-25 15:15:50 -03:00
kmod-path.c perf tools: Deal with kernel module names in '[]' correctly 2015-06-03 10:02:38 -03:00
llvm.c bpf tools: New API to get name from a BPF object 2015-08-31 16:53:15 -03:00
make perf tests: Adding build test for having ending double slash 2015-07-30 12:23:08 -03:00
mmap-basic.c perf tools: Add reference counting for thread_map object 2015-06-25 15:15:50 -03:00
mmap-thread-lookup.c perf tools: Add reference counting for thread_map object 2015-06-25 15:15:50 -03:00
openat-syscall-all-cpus.c perf stat: Make stats work over the thread dimension 2015-06-26 11:20:02 -03:00
openat-syscall-tp-fields.c perf thread_map: Don't access the array entries directly 2015-06-23 18:21:44 -03:00
openat-syscall.c perf stat: Make stats work over the thread dimension 2015-06-26 11:20:02 -03:00
parse-events.c perf tests: Add tests to callgraph and time parse 2015-08-12 13:20:29 -03:00
parse-no-sample-id-all.c perf tools: Move pr_* debug macros into debug object 2014-07-17 12:58:39 -03:00
perf-record.c perf evlist: Introduce poll method for common code idiom 2014-09-25 16:46:55 -03:00
perf-targz-src-pkg perf tools: Add test for building detached source tarballs 2014-01-13 10:06:26 -03:00
perf-time-to-tsc.c perf tools: Add parse_events_error interface 2015-04-29 10:37:58 -03:00
pmu.c perf tools: Add term support for parse_events_error 2015-04-29 10:38:01 -03:00
python-use.c perf tests: Check python path on attr and binding test 2013-01-24 16:40:10 -03:00
rdpmc.c perf test: Use strerror_r instead of strerror 2014-08-15 13:07:28 -03:00
sample-parsing.c perf tests: Fix typo in sample-parsing.c 2015-01-22 17:03:01 -03:00
sw-clock.c perf test: Use strerror_r instead of strerror 2014-08-15 13:07:28 -03:00
switch-tracking.c perf tools: Add reference counting for thread_map object 2015-06-25 15:15:50 -03:00
task-exit.c perf evlist: Introduce poll method for common code idiom 2014-09-25 16:46:55 -03:00
tests.h perf tools: Add a test for decoding of new x86 instructions 2015-09-04 12:01:02 -03:00
thread-map.c perf test: Check for refcnt in thread_map test 2015-07-21 14:20:32 -03:00
thread-mg-share.c perf tools: Use atomic.h for the map_groups refcount 2015-05-15 15:20:44 -03:00
vmlinux-kallsyms.c perf tools: Introduce struct maps 2015-05-27 20:21:41 -03:00