Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull perf updates from Ingo Molnar:
 "Kernel side changes:

   - Improve accuracy of perf/sched clock on x86.  (Adrian Hunter)

   - Intel DS and BTS updates.  (Alexander Shishkin)

   - Intel cstate PMU support.  (Kan Liang)

   - Add group read support to perf_event_read().  (Peter Zijlstra)

   - Branch call hardware sampling support, implemented on x86 and
     PowerPC.  (Stephane Eranian)

   - Event groups transactional interface enhancements.  (Sukadev
     Bhattiprolu)

   - Enable proper x86/intel/uncore PMU support on multi-segment PCI
     systems.  (Taku Izumi)

   - ... misc fixes and cleanups.

  The perf tooling team was very busy again with 200+ commits, the full
  diff doesn't fit into lkml size limits.  Here's an (incomplete) list
  of the tooling highlights:

  New features:

   - Change the default event used in all tools (record/top): use the
     most precise "cycles" hw counter available, i.e. when the user
     doesn't specify any event, it will try using cycles:ppp, cycles:pp,
     etc and fall back transparently until it finds a working counter.
     (Arnaldo Carvalho de Melo)

   - Integration of perf with eBPF that, given an eBPF .c source file
     (or .o file built for the 'bpf' target with clang), will get it
     automatically built, validated and loaded into the kernel via the
     sys_bpf syscall, which can then be used and seen using 'perf trace'
     and other tools.

     (Wang Nan)

  Various user interface improvements:

   - Automatic pager invocation on long help output.  (Namhyung Kim)

   - Search for more options when passing args to -h, e.g.: (Arnaldo
     Carvalho de Melo)

        $ perf report -h interface

        Usage: perf report [<options>]

         --gtk    Use the GTK2 interface
         --stdio  Use the stdio interface
         --tui    Use the TUI interface

   - Show ordered command line options when -h is used or when an
     unknown option is specified.  (Arnaldo Carvalho de Melo)

   - If options are passed after -h, show just its descriptions, not all
     options.  (Arnaldo Carvalho de Melo)

   - Implement column based horizontal scrolling in the hists browser
     (top, report), making it possible to use the TUI for things like
     'perf mem report' where there are many more columns than can fit in
     a terminal.  (Arnaldo Carvalho de Melo)

   - Enhance the error reporting of tracepoint event parsing, e.g.:

       $ oldperf record -e sched:sched_switc usleep 1
       event syntax error: 'sched:sched_switc'
                            \___ unknown tracepoint
       Run 'perf list' for a list of valid events

     Now we get the much nicer:

       $ perf record -e sched:sched_switc ls
       event syntax error: 'sched:sched_switc'
                            \___ can't access trace events

       Error: No permissions to read /sys/kernel/debug/tracing/events/sched/sched_switc
       Hint:  Try 'sudo mount -o remount,mode=755 /sys/kernel/debug'

     And after we have those mount point permissions fixed:

       $ perf record -e sched:sched_switc ls
       event syntax error: 'sched:sched_switc'
                            \___ unknown tracepoint

       Error: File /sys/kernel/debug/tracing/events/sched/sched_switc not found.
       Hint:  Perhaps this kernel misses some CONFIG_ setting to enable this feature?.

     I.e.  basically now the event parsing routing uses the strerror_open()
     routines introduced by and used in 'perf trace' work.  (Jiri Olsa)

   - Fail properly when pattern matching fails to find a tracepoint,
     i.e. '-e non:existent' was being correctly handled, with a proper
     error message about that not being a valid event, but '-e
     non:existent*' wasn't, fix it.  (Jiri Olsa)

   - Do event name substring search as last resort in 'perf list'.
     (Arnaldo Carvalho de Melo)

     E.g.:

       # perf list clock

       List of pre-defined events (to be used in -e):

        cpu-clock                                          [Software event]
        task-clock                                         [Software event]

        uncore_cbox_0/clockticks/                          [Kernel PMU event]
        uncore_cbox_1/clockticks/                          [Kernel PMU event]

        kvm:kvm_pvclock_update                             [Tracepoint event]
        kvm:kvm_update_master_clock                        [Tracepoint event]
        power:clock_disable                                [Tracepoint event]
        power:clock_enable                                 [Tracepoint event]
        power:clock_set_rate                               [Tracepoint event]
        syscalls:sys_enter_clock_adjtime                   [Tracepoint event]
        syscalls:sys_enter_clock_getres                    [Tracepoint event]
        syscalls:sys_enter_clock_gettime                   [Tracepoint event]
        syscalls:sys_enter_clock_nanosleep                 [Tracepoint event]
        syscalls:sys_enter_clock_settime                   [Tracepoint event]
        syscalls:sys_exit_clock_adjtime                    [Tracepoint event]
        syscalls:sys_exit_clock_getres                     [Tracepoint event]
        syscalls:sys_exit_clock_gettime                    [Tracepoint event]
        syscalls:sys_exit_clock_nanosleep                  [Tracepoint event]
        syscalls:sys_exit_clock_settime                    [Tracepoint event]

  Intel PT hardware tracing enhancements:

   - Accept a zero --itrace period, meaning "as often as possible".  In
     the case of Intel PT that is the same as a period of 1 and a unit
     of 'instructions' (i.e.  --itrace=i1i).  (Adrian Hunter)

   - Harmonize itrace's synthesized callchains with the existing
     --max-stack tool option.  (Adrian Hunter)

   - Allow time to be displayed in nanoseconds in 'perf script'.
     (Adrian Hunter)

   - Fix potential infinite loop when handling Intel PT timestamps.
     (Adrian Hunter)

   - Slighly improve Intel PT debug logging.  (Adrian Hunter)

   - Warn when AUX data has been lost, just like when processing
     PERF_RECORD_LOST.  (Adrian Hunter)

   - Further document export-to-postgresql.py script.  (Adrian Hunter)

   - Add option to synthesize branch stack from auxtrace data.  (Adrian
     Hunter)

  Misc notable changes:

   - Switch the default callchain output mode to 'graph,0.5,caller', to
     make it look like the default for other tools, reducing the
     learning curve for people used to 'caller' based viewing.  (Arnaldo
     Carvalho de Melo)

   - various call chain usability enhancements.  (Namhyung Kim)

   - Introduce the 'P' event modifier, meaning 'max precision level,
     please', i.e.:

        $ perf record -e cycles:P usleep 1

     Is now similar to:

        $ perf record usleep 1

     Useful, for instance, when specifying multiple events.  (Jiri Olsa)

   - Add 'socket' sort entry, to sort by the processor socket in 'perf
     top' and 'perf report'.  (Kan Liang)

   - Introduce --socket-filter to 'perf report', for filtering by
     processor socket.  (Kan Liang)

   - Add new "Zoom into Processor Socket" operation in the perf hists
     browser, used in 'perf top' and 'perf report'.  (Kan Liang)

   - Allow probing on kmodules without DWARF.  (Masami Hiramatsu)

   - Fix 'perf probe -l' for probes added to kernel module functions.
     (Masami Hiramatsu)

   - Preparatory work for the 'perf stat record' feature that will allow
     generating perf.data files with counting data in addition to the
     sampling mode we have now (Jiri Olsa)

   - Update libtraceevent KVM plugin.  (Paolo Bonzini)

   - ... plus lots of other enhancements that I failed to list properly,
     by: Adrian Hunter, Alexander Shishkin, Andi Kleen, Andrzej Hajda,
     Arnaldo Carvalho de Melo, Dima Kogan, Don Zickus, Geliang Tang, He
     Kuang, Huaitong Han, Ingo Molnar, Jan Stancek, Jiri Olsa, Kan
     Liang, Kirill Tkhai, Masami Hiramatsu, Matt Fleming, Namhyung Kim,
     Paolo Bonzini, Peter Zijlstra, Rabin Vincent, Scott Wood, Stephane
     Eranian, Sukadev Bhattiprolu, Taku Izumi, Vaishali Thakkar, Wang
     Nan, Yang Shi and Yunlong Song"

* 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (260 commits)
  perf unwind: Pass symbol source to libunwind
  tools build: Fix libiberty feature detection
  perf tools: Compile scriptlets to BPF objects when passing '.c' to --event
  perf record: Add clang options for compiling BPF scripts
  perf bpf: Attach eBPF filter to perf event
  perf tools: Make sure fixdep is built before libbpf
  perf script: Enable printing of branch stack
  perf trace: Add cmd string table to decode sys_bpf first arg
  perf bpf: Collect perf_evsel in BPF object files
  perf tools: Load eBPF object into kernel
  perf tools: Create probe points for BPF programs
  perf tools: Enable passing bpf object file to --event
  perf ebpf: Add the libbpf glue
  perf tools: Make perf depend on libbpf
  perf symbols: Fix endless loop in dso__split_kallsyms_for_kcore
  perf tools: Enable pre-event inherit setting by config terms
  perf symbols: we can now read separate debug-info files based on a build ID
  perf symbols: Fix type error when reading a build-id
  perf tools: Search for more options when passing args to -h
  perf stat: Cache aggregated map entries in extra cpumap
  ...
This commit is contained in:
Linus Torvalds
2015-11-03 17:38:09 -08:00
215 changed files with 9967 additions and 2042 deletions

1
tools/build/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
fixdep

1
tools/build/Build Normal file
View File

@@ -0,0 +1 @@
fixdep-y := fixdep.o

View File

@@ -54,15 +54,26 @@ make-cmd = $(call escsq,$(subst \#,\\\#,$(subst $$,$$$$,$(cmd_$(1)))))
# PHONY targets skipped in both cases.
any-prereq = $(filter-out $(PHONY),$?) $(filter-out $(PHONY) $(wildcard $^),$^)
###
# Copy dependency data into .cmd file
# - gcc -M dependency info
# - command line to create object 'cmd_object :='
dep-cmd = $(if $(wildcard $(fixdep)), \
$(fixdep) $(depfile) $@ '$(make-cmd)' > $(dot-target).tmp; \
rm -f $(depfile); \
mv -f $(dot-target).tmp $(dot-target).cmd, \
printf '\# cannot find fixdep (%s)\n' $(fixdep) > $(dot-target).cmd; \
printf '\# using basic dep data\n\n' >> $(dot-target).cmd; \
cat $(depfile) >> $(dot-target).cmd; \
printf '%s\n' 'cmd_$@ := $(make-cmd)' >> $(dot-target).cmd)
###
# if_changed_dep - execute command if any prerequisite is newer than
# target, or command line has changed and update
# dependencies in the cmd file
if_changed_dep = $(if $(strip $(any-prereq) $(arg-check)), \
@set -e; \
$(echo-cmd) $(cmd_$(1)); \
cat $(depfile) > $(dot-target).cmd; \
printf '%s\n' 'cmd_$@ := $(make-cmd)' >> $(dot-target).cmd)
$(echo-cmd) $(cmd_$(1)) && $(dep-cmd))
# if_changed - execute command if any prerequisite is newer than
# target, or command line has changed

View File

@@ -11,8 +11,9 @@ Unlike the kernel we don't have a single build object 'obj-y' list that where
we setup source objects, but we support more. This allows one 'Build' file to
carry a sources list for multiple build objects.
a) Build framework makefiles
----------------------------
Build framework makefiles
-------------------------
The build framework consists of 2 Makefiles:
@@ -23,7 +24,7 @@ While the 'Build.include' file contains just some generic definitions, the
'Makefile.build' file is the makefile used from the outside. It's
interface/usage is following:
$ make -f tools/build/Makefile srctree=$(KSRC) dir=$(DIR) obj=$(OBJECT)
$ make -f tools/build/Makefile.build srctree=$(KSRC) dir=$(DIR) obj=$(OBJECT)
where:
@@ -38,8 +39,9 @@ called $(OBJECT)-in.o:
which includes all compiled sources described in 'Build' makefiles.
a) Build makefiles
------------------
Build makefiles
---------------
The user supplies 'Build' makefiles that contains a objects list, and connects
the build to nested directories.
@@ -95,8 +97,31 @@ It's only a matter of 2 single commands to create the final binaries:
You can check the 'ex' example in 'tools/build/tests/ex' for more details.
b) Rules
--------
Makefile.include
----------------
The tools/build/Makefile.include makefile could be included
via user makefiles to get usefull definitions.
It defines following interface:
- build macro definition:
build := -f $(srctree)/tools/build/Makefile.build dir=. obj
to make it easier to invoke build like:
make $(build)=ex
Fixdep
------
It is necessary to build the fixdep helper before invoking the build.
The Makefile.include file adds the fixdep target, that could be
invoked by the user.
Rules
-----
The build framework provides standard compilation rules to handle .S and .c
compilation.
@@ -104,8 +129,9 @@ compilation.
It's possible to include special rule if needed (like we do for flex or bison
code generation).
c) CFLAGS
---------
CFLAGS
------
It's possible to alter the standard object C flags in the following way:
@@ -115,8 +141,8 @@ It's possible to alter the standard object C flags in the following way:
This C flags changes has the scope of the Build makefile they are defined in.
d) Dependencies
---------------
Dependencies
------------
For each built object file 'a.o' the '.a.cmd' is created and holds:
@@ -130,8 +156,8 @@ All existing '.cmd' files are included in the Build process to follow properly
the dependencies and trigger a rebuild when necessary.
e) Single rules
---------------
Single rules
------------
It's possible to build single object file by choice, like:

43
tools/build/Makefile Normal file
View File

@@ -0,0 +1,43 @@
ifeq ($(srctree),)
srctree := $(patsubst %/,%,$(dir $(shell pwd)))
srctree := $(patsubst %/,%,$(dir $(srctree)))
endif
include $(srctree)/tools//scripts/Makefile.include
define allow-override
$(if $(or $(findstring environment,$(origin $(1))),\
$(findstring command line,$(origin $(1)))),,\
$(eval $(1) = $(2)))
endef
$(call allow-override,CC,$(CROSS_COMPILE)gcc)
$(call allow-override,LD,$(CROSS_COMPILE)ld)
ifeq ($(V),1)
Q =
else
Q = @
endif
export Q srctree CC LD
MAKEFLAGS := --no-print-directory
build := -f $(srctree)/tools/build/Makefile.build dir=. obj
all: fixdep
clean:
$(call QUIET_CLEAN, fixdep)
$(Q)find . -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete
$(Q)rm -f fixdep
$(OUTPUT)fixdep-in.o: FORCE
$(Q)$(MAKE) $(build)=fixdep
$(OUTPUT)fixdep: $(OUTPUT)fixdep-in.o
$(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $<
FORCE:
.PHONY: FORCE

View File

@@ -21,6 +21,13 @@ endif
build-dir := $(srctree)/tools/build
# Define $(fixdep) for dep-cmd function
ifeq ($(OUTPUT),)
fixdep := $(build-dir)/fixdep
else
fixdep := $(OUTPUT)/fixdep
endif
# Generic definitions
include $(build-dir)/Build.include

View File

@@ -53,7 +53,8 @@ FEATURE_TESTS ?= \
libdw-dwarf-unwind \
zlib \
lzma \
get_cpuid
get_cpuid \
bpf
FEATURE_DISPLAY ?= \
dwarf \
@@ -71,7 +72,8 @@ FEATURE_DISPLAY ?= \
libdw-dwarf-unwind \
zlib \
lzma \
get_cpuid
get_cpuid \
bpf
# Set FEATURE_CHECK_(C|LD)FLAGS-all for all FEATURE_TESTS features.
# If in the future we need per-feature checks/flags for features not
@@ -121,8 +123,9 @@ define feature_print_text_code
MSG = $(shell printf '...%30s: %s' $(1) $(2))
endef
FEATURE_DUMP_FILENAME = $(OUTPUT)FEATURE-DUMP$(FEATURE_USER)
FEATURE_DUMP := $(foreach feat,$(FEATURE_DISPLAY),feature-$(feat)($(feature-$(feat))))
FEATURE_DUMP_FILE := $(shell touch $(OUTPUT)FEATURE-DUMP; cat $(OUTPUT)FEATURE-DUMP)
FEATURE_DUMP_FILE := $(shell touch $(FEATURE_DUMP_FILENAME); cat $(FEATURE_DUMP_FILENAME))
ifeq ($(dwarf-post-unwind),1)
FEATURE_DUMP += dwarf-post-unwind($(dwarf-post-unwind-text))
@@ -131,16 +134,16 @@ endif
# The $(feature_display) controls the default detection message
# output. It's set if:
# - detected features differes from stored features from
# last build (in FEATURE-DUMP file)
# last build (in $(FEATURE_DUMP_FILENAME) file)
# - one of the $(FEATURE_DISPLAY) is not detected
# - VF is enabled
ifneq ("$(FEATURE_DUMP)","$(FEATURE_DUMP_FILE)")
$(shell echo "$(FEATURE_DUMP)" > $(OUTPUT)FEATURE-DUMP)
$(shell echo "$(FEATURE_DUMP)" > $(FEATURE_DUMP_FILENAME))
feature_display := 1
endif
feature_display_check = $(eval $(feature_check_code))
feature_display_check = $(eval $(feature_check_display_code))
define feature_display_check_code
ifneq ($(feature-$(1)), 1)
feature_display := 1

View File

@@ -0,0 +1,10 @@
build := -f $(srctree)/tools/build/Makefile.build dir=. obj
ifdef CROSS_COMPILE
fixdep:
else
fixdep:
$(Q)$(MAKE) -C $(srctree)/tools/build fixdep
endif
.PHONY: fixdep

View File

@@ -132,10 +132,10 @@ test-libbfd.bin:
$(BUILD) -DPACKAGE='"perf"' -lbfd -lz -liberty -ldl
test-liberty.bin:
$(CC) -Wall -Werror -o $(OUTPUT)$@ test-libbfd.c -DPACKAGE='"perf"' -lbfd -ldl -liberty
$(CC) $(CFLAGS) -Wall -Werror -o $(OUTPUT)$@ test-libbfd.c -DPACKAGE='"perf"' $(LDFLAGS) -lbfd -ldl -liberty
test-liberty-z.bin:
$(CC) -Wall -Werror -o $(OUTPUT)$@ test-libbfd.c -DPACKAGE='"perf"' -lbfd -ldl -liberty -lz
$(CC) $(CFLAGS) -Wall -Werror -o $(OUTPUT)$@ test-libbfd.c -DPACKAGE='"perf"' $(LDFLAGS) -lbfd -ldl -liberty -lz
test-cplus-demangle.bin:
$(BUILD) -liberty

168
tools/build/fixdep.c Normal file
View File

@@ -0,0 +1,168 @@
/*
* "Optimize" a list of dependencies as spit out by gcc -MD
* for the build framework.
*
* Original author:
* Copyright 2002 by Kai Germaschewski <kai.germaschewski@gmx.de>
*
* This code has been borrowed from kbuild's fixdep (scripts/basic/fixdep.c),
* Please check it for detailed explanation. This fixdep borow only the
* base transformation of dependecies without the CONFIG mangle.
*/
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <limits.h>
char *target;
char *depfile;
char *cmdline;
static void usage(void)
{
fprintf(stderr, "Usage: fixdep <depfile> <target> <cmdline>\n");
exit(1);
}
/*
* Print out the commandline prefixed with cmd_<target filename> :=
*/
static void print_cmdline(void)
{
printf("cmd_%s := %s\n\n", target, cmdline);
}
/*
* Important: The below generated source_foo.o and deps_foo.o variable
* assignments are parsed not only by make, but also by the rather simple
* parser in scripts/mod/sumversion.c.
*/
static void parse_dep_file(void *map, size_t len)
{
char *m = map;
char *end = m + len;
char *p;
char s[PATH_MAX];
int is_target;
int saw_any_target = 0;
int is_first_dep = 0;
while (m < end) {
/* Skip any "white space" */
while (m < end && (*m == ' ' || *m == '\\' || *m == '\n'))
m++;
/* Find next "white space" */
p = m;
while (p < end && *p != ' ' && *p != '\\' && *p != '\n')
p++;
/* Is the token we found a target name? */
is_target = (*(p-1) == ':');
/* Don't write any target names into the dependency file */
if (is_target) {
/* The /next/ file is the first dependency */
is_first_dep = 1;
} else {
/* Save this token/filename */
memcpy(s, m, p-m);
s[p - m] = 0;
/*
* Do not list the source file as dependency,
* so that kbuild is not confused if a .c file
* is rewritten into .S or vice versa. Storing
* it in source_* is needed for modpost to
* compute srcversions.
*/
if (is_first_dep) {
/*
* If processing the concatenation of
* multiple dependency files, only
* process the first target name, which
* will be the original source name,
* and ignore any other target names,
* which will be intermediate temporary
* files.
*/
if (!saw_any_target) {
saw_any_target = 1;
printf("source_%s := %s\n\n",
target, s);
printf("deps_%s := \\\n",
target);
}
is_first_dep = 0;
} else
printf(" %s \\\n", s);
}
/*
* Start searching for next token immediately after the first
* "whitespace" character that follows this token.
*/
m = p + 1;
}
if (!saw_any_target) {
fprintf(stderr, "fixdep: parse error; no targets found\n");
exit(1);
}
printf("\n%s: $(deps_%s)\n\n", target, target);
printf("$(deps_%s):\n", target);
}
static void print_deps(void)
{
struct stat st;
int fd;
void *map;
fd = open(depfile, O_RDONLY);
if (fd < 0) {
fprintf(stderr, "fixdep: error opening depfile: ");
perror(depfile);
exit(2);
}
if (fstat(fd, &st) < 0) {
fprintf(stderr, "fixdep: error fstat'ing depfile: ");
perror(depfile);
exit(2);
}
if (st.st_size == 0) {
fprintf(stderr, "fixdep: %s is empty\n", depfile);
close(fd);
return;
}
map = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
if ((long) map == -1) {
perror("fixdep: mmap");
close(fd);
return;
}
parse_dep_file(map, st.st_size);
munmap(map, st.st_size);
close(fd);
}
int main(int argc, char **argv)
{
if (argc != 4)
usage();
depfile = argv[1];
target = argv[2];
cmdline = argv[3];
print_cmdline();
print_deps();
return 0;
}

View File

@@ -4,6 +4,7 @@ ex-y += b.o
ex-y += b.o
ex-y += empty/
ex-y += empty2/
ex-y += inc.o
libex-y += c.o
libex-y += d.o

View File

@@ -1,19 +1,22 @@
export srctree := ../../../..
export srctree := $(abspath ../../../..)
export CC := gcc
export LD := ld
export AR := ar
build := -f $(srctree)/tools/build/Makefile.build dir=. obj
ex:
include $(srctree)/tools/build/Makefile.include
ex: ex-in.o libex-in.o
gcc -o $@ $^
ex.%: FORCE
ex.%: fixdep FORCE
make -f $(srctree)/tools/build/Makefile.build dir=. $@
ex-in.o: FORCE
ex-in.o: fixdep FORCE
make $(build)=ex
libex-in.o: FORCE
libex-in.o: fixdep FORCE
make $(build)=libex
clean:

View File

@@ -5,6 +5,7 @@ int c(void);
int d(void);
int e(void);
int f(void);
int inc(void);
int main(void)
{
@@ -14,6 +15,7 @@ int main(void)
d();
e();
f();
inc();
return 0;
}

View File

@@ -0,0 +1,8 @@
#ifdef INCLUDE
#include "krava.h"
#endif
int inc(void)
{
return 0;
}

View File

@@ -34,9 +34,36 @@ function test_ex_suffix {
make -C ex V=1 clean > /dev/null 2>&1
rm -f ex.out
}
function test_ex_include {
make -C ex V=1 clean > ex.out 2>&1
# build with krava.h include
touch ex/krava.h
make -C ex V=1 CFLAGS=-DINCLUDE >> ex.out 2>&1
if [ ! -x ./ex/ex ]; then
echo FAILED
exit -1
fi
# build without the include
rm -f ex/krava.h ex/ex
make -C ex V=1 >> ex.out 2>&1
if [ ! -x ./ex/ex ]; then
echo FAILED
exit -1
fi
make -C ex V=1 clean > /dev/null 2>&1
rm -f ex.out
}
echo -n Testing..
test_ex
test_ex_suffix
test_ex_include
echo OK

View File

@@ -43,13 +43,29 @@
#include <linux/types.h>
/*
* Following functions are taken from kernel sources and
* break aliasing rules in their original form.
*
* While kernel is compiled with -fno-strict-aliasing,
* perf uses -Wstrict-aliasing=3 which makes build fail
* under gcc 4.4.
*
* Using extra __may_alias__ type to allow aliasing
* in this case.
*/
typedef __u8 __attribute__((__may_alias__)) __u8_alias_t;
typedef __u16 __attribute__((__may_alias__)) __u16_alias_t;
typedef __u32 __attribute__((__may_alias__)) __u32_alias_t;
typedef __u64 __attribute__((__may_alias__)) __u64_alias_t;
static __always_inline void __read_once_size(const volatile void *p, void *res, int size)
{
switch (size) {
case 1: *(__u8 *)res = *(volatile __u8 *)p; break;
case 2: *(__u16 *)res = *(volatile __u16 *)p; break;
case 4: *(__u32 *)res = *(volatile __u32 *)p; break;
case 8: *(__u64 *)res = *(volatile __u64 *)p; break;
case 1: *(__u8_alias_t *) res = *(volatile __u8_alias_t *) p; break;
case 2: *(__u16_alias_t *) res = *(volatile __u16_alias_t *) p; break;
case 4: *(__u32_alias_t *) res = *(volatile __u32_alias_t *) p; break;
case 8: *(__u64_alias_t *) res = *(volatile __u64_alias_t *) p; break;
default:
barrier();
__builtin_memcpy((void *)res, (const void *)p, size);
@@ -60,10 +76,10 @@ static __always_inline void __read_once_size(const volatile void *p, void *res,
static __always_inline void __write_once_size(volatile void *p, void *res, int size)
{
switch (size) {
case 1: *(volatile __u8 *)p = *(__u8 *)res; break;
case 2: *(volatile __u16 *)p = *(__u16 *)res; break;
case 4: *(volatile __u32 *)p = *(__u32 *)res; break;
case 8: *(volatile __u64 *)p = *(__u64 *)res; break;
case 1: *(volatile __u8_alias_t *) p = *(__u8_alias_t *) res; break;
case 2: *(volatile __u16_alias_t *) p = *(__u16_alias_t *) res; break;
case 4: *(volatile __u32_alias_t *) p = *(__u32_alias_t *) res; break;
case 8: *(volatile __u64_alias_t *) p = *(__u64_alias_t *) res; break;
default:
barrier();
__builtin_memcpy((void *)p, (const void *)res, size);

49
tools/include/linux/err.h Normal file
View File

@@ -0,0 +1,49 @@
#ifndef __TOOLS_LINUX_ERR_H
#define __TOOLS_LINUX_ERR_H
#include <linux/compiler.h>
#include <linux/types.h>
#include <asm/errno.h>
/*
* Original kernel header comment:
*
* Kernel pointers have redundant information, so we can use a
* scheme where we can return either an error code or a normal
* pointer with the same return value.
*
* This should be a per-architecture thing, to allow different
* error and pointer decisions.
*
* Userspace note:
* The same principle works for userspace, because 'error' pointers
* fall down to the unused hole far from user space, as described
* in Documentation/x86/x86_64/mm.txt for x86_64 arch:
*
* 0000000000000000 - 00007fffffffffff (=47 bits) user space, different per mm hole caused by [48:63] sign extension
* ffffffffffe00000 - ffffffffffffffff (=2 MB) unused hole
*
* It should be the same case for other architectures, because
* this code is used in generic kernel code.
*/
#define MAX_ERRNO 4095
#define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO)
static inline void * __must_check ERR_PTR(long error_)
{
return (void *) error_;
}
static inline long __must_check PTR_ERR(__force const void *ptr)
{
return (long) ptr;
}
static inline bool __must_check IS_ERR(__force const void *ptr)
{
return IS_ERR_VALUE((unsigned long)ptr);
}
#endif /* _LINUX_ERR_H */

View File

@@ -0,0 +1,231 @@
/*
* Linux Socket Filter Data Structures
*/
#ifndef __TOOLS_LINUX_FILTER_H
#define __TOOLS_LINUX_FILTER_H
#include <linux/bpf.h>
/* ArgX, context and stack frame pointer register positions. Note,
* Arg1, Arg2, Arg3, etc are used as argument mappings of function
* calls in BPF_CALL instruction.
*/
#define BPF_REG_ARG1 BPF_REG_1
#define BPF_REG_ARG2 BPF_REG_2
#define BPF_REG_ARG3 BPF_REG_3
#define BPF_REG_ARG4 BPF_REG_4
#define BPF_REG_ARG5 BPF_REG_5
#define BPF_REG_CTX BPF_REG_6
#define BPF_REG_FP BPF_REG_10
/* Additional register mappings for converted user programs. */
#define BPF_REG_A BPF_REG_0
#define BPF_REG_X BPF_REG_7
#define BPF_REG_TMP BPF_REG_8
/* BPF program can access up to 512 bytes of stack space. */
#define MAX_BPF_STACK 512
/* Helper macros for filter block array initializers. */
/* ALU ops on registers, bpf_add|sub|...: dst_reg += src_reg */
#define BPF_ALU64_REG(OP, DST, SRC) \
((struct bpf_insn) { \
.code = BPF_ALU64 | BPF_OP(OP) | BPF_X, \
.dst_reg = DST, \
.src_reg = SRC, \
.off = 0, \
.imm = 0 })
#define BPF_ALU32_REG(OP, DST, SRC) \
((struct bpf_insn) { \
.code = BPF_ALU | BPF_OP(OP) | BPF_X, \
.dst_reg = DST, \
.src_reg = SRC, \
.off = 0, \
.imm = 0 })
/* ALU ops on immediates, bpf_add|sub|...: dst_reg += imm32 */
#define BPF_ALU64_IMM(OP, DST, IMM) \
((struct bpf_insn) { \
.code = BPF_ALU64 | BPF_OP(OP) | BPF_K, \
.dst_reg = DST, \
.src_reg = 0, \
.off = 0, \
.imm = IMM })
#define BPF_ALU32_IMM(OP, DST, IMM) \
((struct bpf_insn) { \
.code = BPF_ALU | BPF_OP(OP) | BPF_K, \
.dst_reg = DST, \
.src_reg = 0, \
.off = 0, \
.imm = IMM })
/* Endianess conversion, cpu_to_{l,b}e(), {l,b}e_to_cpu() */
#define BPF_ENDIAN(TYPE, DST, LEN) \
((struct bpf_insn) { \
.code = BPF_ALU | BPF_END | BPF_SRC(TYPE), \
.dst_reg = DST, \
.src_reg = 0, \
.off = 0, \
.imm = LEN })
/* Short form of mov, dst_reg = src_reg */
#define BPF_MOV64_REG(DST, SRC) \
((struct bpf_insn) { \
.code = BPF_ALU64 | BPF_MOV | BPF_X, \
.dst_reg = DST, \
.src_reg = SRC, \
.off = 0, \
.imm = 0 })
#define BPF_MOV32_REG(DST, SRC) \
((struct bpf_insn) { \
.code = BPF_ALU | BPF_MOV | BPF_X, \
.dst_reg = DST, \
.src_reg = SRC, \
.off = 0, \
.imm = 0 })
/* Short form of mov, dst_reg = imm32 */
#define BPF_MOV64_IMM(DST, IMM) \
((struct bpf_insn) { \
.code = BPF_ALU64 | BPF_MOV | BPF_K, \
.dst_reg = DST, \
.src_reg = 0, \
.off = 0, \
.imm = IMM })
#define BPF_MOV32_IMM(DST, IMM) \
((struct bpf_insn) { \
.code = BPF_ALU | BPF_MOV | BPF_K, \
.dst_reg = DST, \
.src_reg = 0, \
.off = 0, \
.imm = IMM })
/* Short form of mov based on type, BPF_X: dst_reg = src_reg, BPF_K: dst_reg = imm32 */
#define BPF_MOV64_RAW(TYPE, DST, SRC, IMM) \
((struct bpf_insn) { \
.code = BPF_ALU64 | BPF_MOV | BPF_SRC(TYPE), \
.dst_reg = DST, \
.src_reg = SRC, \
.off = 0, \
.imm = IMM })
#define BPF_MOV32_RAW(TYPE, DST, SRC, IMM) \
((struct bpf_insn) { \
.code = BPF_ALU | BPF_MOV | BPF_SRC(TYPE), \
.dst_reg = DST, \
.src_reg = SRC, \
.off = 0, \
.imm = IMM })
/* Direct packet access, R0 = *(uint *) (skb->data + imm32) */
#define BPF_LD_ABS(SIZE, IMM) \
((struct bpf_insn) { \
.code = BPF_LD | BPF_SIZE(SIZE) | BPF_ABS, \
.dst_reg = 0, \
.src_reg = 0, \
.off = 0, \
.imm = IMM })
/* Indirect packet access, R0 = *(uint *) (skb->data + src_reg + imm32) */
#define BPF_LD_IND(SIZE, SRC, IMM) \
((struct bpf_insn) { \
.code = BPF_LD | BPF_SIZE(SIZE) | BPF_IND, \
.dst_reg = 0, \
.src_reg = SRC, \
.off = 0, \
.imm = IMM })
/* Memory load, dst_reg = *(uint *) (src_reg + off16) */
#define BPF_LDX_MEM(SIZE, DST, SRC, OFF) \
((struct bpf_insn) { \
.code = BPF_LDX | BPF_SIZE(SIZE) | BPF_MEM, \
.dst_reg = DST, \
.src_reg = SRC, \
.off = OFF, \
.imm = 0 })
/* Memory store, *(uint *) (dst_reg + off16) = src_reg */
#define BPF_STX_MEM(SIZE, DST, SRC, OFF) \
((struct bpf_insn) { \
.code = BPF_STX | BPF_SIZE(SIZE) | BPF_MEM, \
.dst_reg = DST, \
.src_reg = SRC, \
.off = OFF, \
.imm = 0 })
/* Memory store, *(uint *) (dst_reg + off16) = imm32 */
#define BPF_ST_MEM(SIZE, DST, OFF, IMM) \
((struct bpf_insn) { \
.code = BPF_ST | BPF_SIZE(SIZE) | BPF_MEM, \
.dst_reg = DST, \
.src_reg = 0, \
.off = OFF, \
.imm = IMM })
/* Conditional jumps against registers, if (dst_reg 'op' src_reg) goto pc + off16 */
#define BPF_JMP_REG(OP, DST, SRC, OFF) \
((struct bpf_insn) { \
.code = BPF_JMP | BPF_OP(OP) | BPF_X, \
.dst_reg = DST, \
.src_reg = SRC, \
.off = OFF, \
.imm = 0 })
/* Conditional jumps against immediates, if (dst_reg 'op' imm32) goto pc + off16 */
#define BPF_JMP_IMM(OP, DST, IMM, OFF) \
((struct bpf_insn) { \
.code = BPF_JMP | BPF_OP(OP) | BPF_K, \
.dst_reg = DST, \
.src_reg = 0, \
.off = OFF, \
.imm = IMM })
/* Function call */
#define BPF_EMIT_CALL(FUNC) \
((struct bpf_insn) { \
.code = BPF_JMP | BPF_CALL, \
.dst_reg = 0, \
.src_reg = 0, \
.off = 0, \
.imm = ((FUNC) - BPF_FUNC_unspec) })
/* Raw code statement block */
#define BPF_RAW_INSN(CODE, DST, SRC, OFF, IMM) \
((struct bpf_insn) { \
.code = CODE, \
.dst_reg = DST, \
.src_reg = SRC, \
.off = OFF, \
.imm = IMM })
/* Program exit */
#define BPF_EXIT_INSN() \
((struct bpf_insn) { \
.code = BPF_JMP | BPF_EXIT, \
.dst_reg = 0, \
.src_reg = 0, \
.off = 0, \
.imm = 0 })
#endif /* __TOOLS_LINUX_FILTER_H */

View File

@@ -1,2 +1,3 @@
libapi-y += fd/
libapi-y += fs/
libapi-y += cpu.o

View File

@@ -21,12 +21,14 @@ CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
RM = rm -f
build := -f $(srctree)/tools/build/Makefile.build dir=. obj
API_IN := $(OUTPUT)libapi-in.o
export srctree OUTPUT CC LD CFLAGS V
all:
all: $(LIBFILE)
export srctree OUTPUT CC LD CFLAGS V
include $(srctree)/tools/build/Makefile.include
all: fixdep $(LIBFILE)
$(API_IN): FORCE
@$(MAKE) $(build)=libapi

18
tools/lib/api/cpu.c Normal file
View File

@@ -0,0 +1,18 @@
#include <stdio.h>
#include "cpu.h"
#include "fs/fs.h"
int cpu__get_max_freq(unsigned long long *freq)
{
char entry[PATH_MAX];
int cpu;
if (sysfs__read_int("devices/system/cpu/online", &cpu) < 0)
return -1;
snprintf(entry, sizeof(entry),
"devices/system/cpu/cpu%d/cpufreq/cpuinfo_max_freq", cpu);
return sysfs__read_ull(entry, freq);
}

6
tools/lib/api/cpu.h Normal file
View File

@@ -0,0 +1,6 @@
#ifndef __API_CPU__
#define __API_CPU__
int cpu__get_max_freq(unsigned long long *freq);
#endif /* __API_CPU__ */

View File

@@ -1,4 +1,2 @@
libapi-y += fs.o
libapi-y += debugfs.o
libapi-y += findfs.o
libapi-y += tracefs.o
libapi-y += tracing_path.o

View File

@@ -1,129 +0,0 @@
#define _GNU_SOURCE
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <stdbool.h>
#include <sys/vfs.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mount.h>
#include <linux/kernel.h>
#include "debugfs.h"
#include "tracefs.h"
#ifndef DEBUGFS_DEFAULT_PATH
#define DEBUGFS_DEFAULT_PATH "/sys/kernel/debug"
#endif
char debugfs_mountpoint[PATH_MAX + 1] = DEBUGFS_DEFAULT_PATH;
static const char * const debugfs_known_mountpoints[] = {
DEBUGFS_DEFAULT_PATH,
"/debug",
0,
};
static bool debugfs_found;
bool debugfs_configured(void)
{
return debugfs_find_mountpoint() != NULL;
}
/* find the path to the mounted debugfs */
const char *debugfs_find_mountpoint(void)
{
const char *ret;
if (debugfs_found)
return (const char *)debugfs_mountpoint;
ret = find_mountpoint("debugfs", (long) DEBUGFS_MAGIC,
debugfs_mountpoint, PATH_MAX + 1,
debugfs_known_mountpoints);
if (ret)
debugfs_found = true;
return ret;
}
/* mount the debugfs somewhere if it's not mounted */
char *debugfs_mount(const char *mountpoint)
{
/* see if it's already mounted */
if (debugfs_find_mountpoint())
goto out;
/* if not mounted and no argument */
if (mountpoint == NULL) {
/* see if environment variable set */
mountpoint = getenv(PERF_DEBUGFS_ENVIRONMENT);
/* if no environment variable, use default */
if (mountpoint == NULL)
mountpoint = DEBUGFS_DEFAULT_PATH;
}
if (mount(NULL, mountpoint, "debugfs", 0, NULL) < 0)
return NULL;
/* save the mountpoint */
debugfs_found = true;
strncpy(debugfs_mountpoint, mountpoint, sizeof(debugfs_mountpoint));
out:
return debugfs_mountpoint;
}
int debugfs__strerror_open(int err, char *buf, size_t size, const char *filename)
{
char sbuf[128];
switch (err) {
case ENOENT:
if (debugfs_found) {
snprintf(buf, size,
"Error:\tFile %s/%s not found.\n"
"Hint:\tPerhaps this kernel misses some CONFIG_ setting to enable this feature?.\n",
debugfs_mountpoint, filename);
break;
}
snprintf(buf, size, "%s",
"Error:\tUnable to find debugfs\n"
"Hint:\tWas your kernel compiled with debugfs support?\n"
"Hint:\tIs the debugfs filesystem mounted?\n"
"Hint:\tTry 'sudo mount -t debugfs nodev /sys/kernel/debug'");
break;
case EACCES: {
const char *mountpoint = debugfs_mountpoint;
if (!access(debugfs_mountpoint, R_OK) && strncmp(filename, "tracing/", 8) == 0) {
const char *tracefs_mntpoint = tracefs_find_mountpoint();
if (tracefs_mntpoint)
mountpoint = tracefs_mntpoint;
}
snprintf(buf, size,
"Error:\tNo permissions to read %s/%s\n"
"Hint:\tTry 'sudo mount -o remount,mode=755 %s'\n",
debugfs_mountpoint, filename, mountpoint);
}
break;
default:
snprintf(buf, size, "%s", strerror_r(err, sbuf, sizeof(sbuf)));
break;
}
return 0;
}
int debugfs__strerror_open_tp(int err, char *buf, size_t size, const char *sys, const char *name)
{
char path[PATH_MAX];
snprintf(path, PATH_MAX, "tracing/events/%s/%s", sys, name ?: "*");
return debugfs__strerror_open(err, buf, size, path);
}

View File

@@ -1,23 +0,0 @@
#ifndef __API_DEBUGFS_H__
#define __API_DEBUGFS_H__
#include "findfs.h"
#ifndef DEBUGFS_MAGIC
#define DEBUGFS_MAGIC 0x64626720
#endif
#ifndef PERF_DEBUGFS_ENVIRONMENT
#define PERF_DEBUGFS_ENVIRONMENT "PERF_DEBUGFS_DIR"
#endif
bool debugfs_configured(void);
const char *debugfs_find_mountpoint(void);
char *debugfs_mount(const char *mountpoint);
extern char debugfs_mountpoint[];
int debugfs__strerror_open(int err, char *buf, size_t size, const char *filename);
int debugfs__strerror_open_tp(int err, char *buf, size_t size, const char *sys, const char *name);
#endif /* __API_DEBUGFS_H__ */

View File

@@ -1,63 +0,0 @@
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <sys/vfs.h>
#include "findfs.h"
/* verify that a mountpoint is actually the type we want */
int valid_mountpoint(const char *mount, long magic)
{
struct statfs st_fs;
if (statfs(mount, &st_fs) < 0)
return -ENOENT;
else if ((long)st_fs.f_type != magic)
return -ENOENT;
return 0;
}
/* find the path to a mounted file system */
const char *find_mountpoint(const char *fstype, long magic,
char *mountpoint, int len,
const char * const *known_mountpoints)
{
const char * const *ptr;
char format[128];
char type[100];
FILE *fp;
if (known_mountpoints) {
ptr = known_mountpoints;
while (*ptr) {
if (valid_mountpoint(*ptr, magic) == 0) {
strncpy(mountpoint, *ptr, len - 1);
mountpoint[len-1] = 0;
return mountpoint;
}
ptr++;
}
}
/* give up and parse /proc/mounts */
fp = fopen("/proc/mounts", "r");
if (fp == NULL)
return NULL;
snprintf(format, 128, "%%*s %%%ds %%99s %%*s %%*d %%*d\n", len);
while (fscanf(fp, format, mountpoint, type) == 2) {
if (strcmp(type, fstype) == 0)
break;
}
fclose(fp);
if (strcmp(type, fstype) != 0)
return NULL;
return mountpoint;
}

View File

@@ -1,23 +0,0 @@
#ifndef __API_FINDFS_H__
#define __API_FINDFS_H__
#include <stdbool.h>
#define _STR(x) #x
#define STR(x) _STR(x)
/*
* On most systems <limits.h> would have given us this, but not on some systems
* (e.g. GNU/Hurd).
*/
#ifndef PATH_MAX
#define PATH_MAX 4096
#endif
const char *find_mountpoint(const char *fstype, long magic,
char *mountpoint, int len,
const char * const *known_mountpoints);
int valid_mountpoint(const char *mount, long magic);
#endif /* __API_FINDFS_H__ */

View File

@@ -1,7 +1,6 @@
/* TODO merge/factor in debugfs.c here */
#include <ctype.h>
#include <errno.h>
#include <limits.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
@@ -11,10 +10,29 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/mount.h>
#include "debugfs.h"
#include "fs.h"
#define _STR(x) #x
#define STR(x) _STR(x)
#ifndef SYSFS_MAGIC
#define SYSFS_MAGIC 0x62656572
#endif
#ifndef PROC_SUPER_MAGIC
#define PROC_SUPER_MAGIC 0x9fa0
#endif
#ifndef DEBUGFS_MAGIC
#define DEBUGFS_MAGIC 0x64626720
#endif
#ifndef TRACEFS_MAGIC
#define TRACEFS_MAGIC 0x74726163
#endif
static const char * const sysfs__fs_known_mountpoints[] = {
"/sys",
0,
@@ -25,19 +43,48 @@ static const char * const procfs__known_mountpoints[] = {
0,
};
#ifndef DEBUGFS_DEFAULT_PATH
#define DEBUGFS_DEFAULT_PATH "/sys/kernel/debug"
#endif
static const char * const debugfs__known_mountpoints[] = {
DEBUGFS_DEFAULT_PATH,
"/debug",
0,
};
#ifndef TRACEFS_DEFAULT_PATH
#define TRACEFS_DEFAULT_PATH "/sys/kernel/tracing"
#endif
static const char * const tracefs__known_mountpoints[] = {
TRACEFS_DEFAULT_PATH,
"/sys/kernel/debug/tracing",
"/tracing",
"/trace",
0,
};
struct fs {
const char *name;
const char * const *mounts;
char path[PATH_MAX + 1];
char path[PATH_MAX];
bool found;
long magic;
};
enum {
FS__SYSFS = 0,
FS__PROCFS = 1,
FS__SYSFS = 0,
FS__PROCFS = 1,
FS__DEBUGFS = 2,
FS__TRACEFS = 3,
};
#ifndef TRACEFS_MAGIC
#define TRACEFS_MAGIC 0x74726163
#endif
static struct fs fs__entries[] = {
[FS__SYSFS] = {
.name = "sysfs",
@@ -49,6 +96,16 @@ static struct fs fs__entries[] = {
.mounts = procfs__known_mountpoints,
.magic = PROC_SUPER_MAGIC,
},
[FS__DEBUGFS] = {
.name = "debugfs",
.mounts = debugfs__known_mountpoints,
.magic = DEBUGFS_MAGIC,
},
[FS__TRACEFS] = {
.name = "tracefs",
.mounts = tracefs__known_mountpoints,
.magic = TRACEFS_MAGIC,
},
};
static bool fs__read_mounts(struct fs *fs)
@@ -159,14 +216,54 @@ static const char *fs__mountpoint(int idx)
return fs__get_mountpoint(fs);
}
#define FS__MOUNTPOINT(name, idx) \
const char *name##__mountpoint(void) \
{ \
return fs__mountpoint(idx); \
static const char *mount_overload(struct fs *fs)
{
size_t name_len = strlen(fs->name);
/* "PERF_" + name + "_ENVIRONMENT" + '\0' */
char upper_name[5 + name_len + 12 + 1];
snprintf(upper_name, name_len, "PERF_%s_ENVIRONMENT", fs->name);
mem_toupper(upper_name, name_len);
return getenv(upper_name) ?: *fs->mounts;
}
FS__MOUNTPOINT(sysfs, FS__SYSFS);
FS__MOUNTPOINT(procfs, FS__PROCFS);
static const char *fs__mount(int idx)
{
struct fs *fs = &fs__entries[idx];
const char *mountpoint;
if (fs__mountpoint(idx))
return (const char *)fs->path;
mountpoint = mount_overload(fs);
if (mount(NULL, mountpoint, fs->name, 0, NULL) < 0)
return NULL;
return fs__check_mounts(fs) ? fs->path : NULL;
}
#define FS(name, idx) \
const char *name##__mountpoint(void) \
{ \
return fs__mountpoint(idx); \
} \
\
const char *name##__mount(void) \
{ \
return fs__mount(idx); \
} \
\
bool name##__configured(void) \
{ \
return name##__mountpoint() != NULL; \
}
FS(sysfs, FS__SYSFS);
FS(procfs, FS__PROCFS);
FS(debugfs, FS__DEBUGFS);
FS(tracefs, FS__TRACEFS);
int filename__read_int(const char *filename, int *value)
{
@@ -185,6 +282,50 @@ int filename__read_int(const char *filename, int *value)
return err;
}
int filename__read_ull(const char *filename, unsigned long long *value)
{
char line[64];
int fd = open(filename, O_RDONLY), err = -1;
if (fd < 0)
return -1;
if (read(fd, line, sizeof(line)) > 0) {
*value = strtoull(line, NULL, 10);
if (*value != ULLONG_MAX)
err = 0;
}
close(fd);
return err;
}
int sysfs__read_ull(const char *entry, unsigned long long *value)
{
char path[PATH_MAX];
const char *sysfs = sysfs__mountpoint();
if (!sysfs)
return -1;
snprintf(path, sizeof(path), "%s/%s", sysfs, entry);
return filename__read_ull(path, value);
}
int sysfs__read_int(const char *entry, int *value)
{
char path[PATH_MAX];
const char *sysfs = sysfs__mountpoint();
if (!sysfs)
return -1;
snprintf(path, sizeof(path), "%s/%s", sysfs, entry);
return filename__read_int(path, value);
}
int sysctl__read_int(const char *sysctl, int *value)
{
char path[PATH_MAX];

View File

@@ -1,17 +1,33 @@
#ifndef __API_FS__
#define __API_FS__
#ifndef SYSFS_MAGIC
#define SYSFS_MAGIC 0x62656572
#include <stdbool.h>
/*
* On most systems <limits.h> would have given us this, but not on some systems
* (e.g. GNU/Hurd).
*/
#ifndef PATH_MAX
#define PATH_MAX 4096
#endif
#ifndef PROC_SUPER_MAGIC
#define PROC_SUPER_MAGIC 0x9fa0
#endif
#define FS(name) \
const char *name##__mountpoint(void); \
const char *name##__mount(void); \
bool name##__configured(void); \
FS(sysfs)
FS(procfs)
FS(debugfs)
FS(tracefs)
#undef FS
const char *sysfs__mountpoint(void);
const char *procfs__mountpoint(void);
int filename__read_int(const char *filename, int *value);
int filename__read_ull(const char *filename, unsigned long long *value);
int sysctl__read_int(const char *sysctl, int *value);
int sysfs__read_int(const char *entry, int *value);
int sysfs__read_ull(const char *entry, unsigned long long *value);
#endif /* __API_FS__ */

View File

@@ -1,78 +0,0 @@
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <stdbool.h>
#include <sys/vfs.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mount.h>
#include <linux/kernel.h>
#include "tracefs.h"
#ifndef TRACEFS_DEFAULT_PATH
#define TRACEFS_DEFAULT_PATH "/sys/kernel/tracing"
#endif
char tracefs_mountpoint[PATH_MAX + 1] = TRACEFS_DEFAULT_PATH;
static const char * const tracefs_known_mountpoints[] = {
TRACEFS_DEFAULT_PATH,
"/sys/kernel/debug/tracing",
"/tracing",
"/trace",
0,
};
static bool tracefs_found;
bool tracefs_configured(void)
{
return tracefs_find_mountpoint() != NULL;
}
/* find the path to the mounted tracefs */
const char *tracefs_find_mountpoint(void)
{
const char *ret;
if (tracefs_found)
return (const char *)tracefs_mountpoint;
ret = find_mountpoint("tracefs", (long) TRACEFS_MAGIC,
tracefs_mountpoint, PATH_MAX + 1,
tracefs_known_mountpoints);
if (ret)
tracefs_found = true;
return ret;
}
/* mount the tracefs somewhere if it's not mounted */
char *tracefs_mount(const char *mountpoint)
{
/* see if it's already mounted */
if (tracefs_find_mountpoint())
goto out;
/* if not mounted and no argument */
if (mountpoint == NULL) {
/* see if environment variable set */
mountpoint = getenv(PERF_TRACEFS_ENVIRONMENT);
/* if no environment variable, use default */
if (mountpoint == NULL)
mountpoint = TRACEFS_DEFAULT_PATH;
}
if (mount(NULL, mountpoint, "tracefs", 0, NULL) < 0)
return NULL;
/* save the mountpoint */
tracefs_found = true;
strncpy(tracefs_mountpoint, mountpoint, sizeof(tracefs_mountpoint));
out:
return tracefs_mountpoint;
}

View File

@@ -1,21 +0,0 @@
#ifndef __API_TRACEFS_H__
#define __API_TRACEFS_H__
#include "findfs.h"
#ifndef TRACEFS_MAGIC
#define TRACEFS_MAGIC 0x74726163
#endif
#ifndef PERF_TRACEFS_ENVIRONMENT
#define PERF_TRACEFS_ENVIRONMENT "PERF_TRACEFS_DIR"
#endif
bool tracefs_configured(void);
const char *tracefs_find_mountpoint(void);
int tracefs_valid_mountpoint(const char *debugfs);
char *tracefs_mount(const char *mountpoint);
extern char tracefs_mountpoint[];
#endif /* __API_DEBUGFS_H__ */

View File

@@ -0,0 +1,135 @@
#ifndef _GNU_SOURCE
# define _GNU_SOURCE
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include "fs.h"
#include "tracing_path.h"
char tracing_mnt[PATH_MAX] = "/sys/kernel/debug";
char tracing_path[PATH_MAX] = "/sys/kernel/debug/tracing";
char tracing_events_path[PATH_MAX] = "/sys/kernel/debug/tracing/events";
static void __tracing_path_set(const char *tracing, const char *mountpoint)
{
snprintf(tracing_mnt, sizeof(tracing_mnt), "%s", mountpoint);
snprintf(tracing_path, sizeof(tracing_path), "%s/%s",
mountpoint, tracing);
snprintf(tracing_events_path, sizeof(tracing_events_path), "%s/%s%s",
mountpoint, tracing, "events");
}
static const char *tracing_path_tracefs_mount(void)
{
const char *mnt;
mnt = tracefs__mount();
if (!mnt)
return NULL;
__tracing_path_set("", mnt);
return mnt;
}
static const char *tracing_path_debugfs_mount(void)
{
const char *mnt;
mnt = debugfs__mount();
if (!mnt)
return NULL;
__tracing_path_set("tracing/", mnt);
return mnt;
}
const char *tracing_path_mount(void)
{
const char *mnt;
mnt = tracing_path_tracefs_mount();
if (mnt)
return mnt;
mnt = tracing_path_debugfs_mount();
return mnt;
}
void tracing_path_set(const char *mntpt)
{
__tracing_path_set("tracing/", mntpt);
}
char *get_tracing_file(const char *name)
{
char *file;
if (asprintf(&file, "%s/%s", tracing_path, name) < 0)
return NULL;
return file;
}
void put_tracing_file(char *file)
{
free(file);
}
static int strerror_open(int err, char *buf, size_t size, const char *filename)
{
char sbuf[128];
switch (err) {
case ENOENT:
/*
* We will get here if we can't find the tracepoint, but one of
* debugfs or tracefs is configured, which means you probably
* want some tracepoint which wasn't compiled in your kernel.
* - jirka
*/
if (debugfs__configured() || tracefs__configured()) {
snprintf(buf, size,
"Error:\tFile %s/%s not found.\n"
"Hint:\tPerhaps this kernel misses some CONFIG_ setting to enable this feature?.\n",
tracing_events_path, filename);
break;
}
snprintf(buf, size, "%s",
"Error:\tUnable to find debugfs/tracefs\n"
"Hint:\tWas your kernel compiled with debugfs/tracefs support?\n"
"Hint:\tIs the debugfs/tracefs filesystem mounted?\n"
"Hint:\tTry 'sudo mount -t debugfs nodev /sys/kernel/debug'");
break;
case EACCES: {
snprintf(buf, size,
"Error:\tNo permissions to read %s/%s\n"
"Hint:\tTry 'sudo mount -o remount,mode=755 %s'\n",
tracing_events_path, filename, tracing_mnt);
}
break;
default:
snprintf(buf, size, "%s", strerror_r(err, sbuf, sizeof(sbuf)));
break;
}
return 0;
}
int tracing_path__strerror_open_tp(int err, char *buf, size_t size, const char *sys, const char *name)
{
char path[PATH_MAX];
snprintf(path, PATH_MAX, "%s/%s", sys, name ?: "*");
return strerror_open(err, buf, size, path);
}

View File

@@ -0,0 +1,16 @@
#ifndef __API_FS_TRACING_PATH_H
#define __API_FS_TRACING_PATH_H
#include <linux/types.h>
extern char tracing_path[];
extern char tracing_events_path[];
void tracing_path_set(const char *mountpoint);
const char *tracing_path_mount(void);
char *get_tracing_file(const char *name);
void put_tracing_file(char *file);
int tracing_path__strerror_open_tp(int err, char *buf, size_t size, const char *sys, const char *name);
#endif /* __API_FS_TRACING_PATH_H */

View File

@@ -64,8 +64,9 @@ srctree := $(patsubst %/,%,$(dir $(srctree)))
#$(info Determined 'srctree' to be $(srctree))
endif
FEATURE_DISPLAY = libelf libelf-getphdrnum libelf-mmap bpf
FEATURE_TESTS = libelf bpf
FEATURE_USER = .libbpf
FEATURE_TESTS = libelf libelf-getphdrnum libelf-mmap bpf
FEATURE_DISPLAY = libelf bpf
INCLUDES = -I. -I$(srctree)/tools/include -I$(srctree)/arch/$(ARCH)/include/uapi -I$(srctree)/include/uapi
FEATURE_CHECK_CFLAGS-bpf = $(INCLUDES)
@@ -122,8 +123,10 @@ endif
# the same command line setup.
MAKEOVERRIDES=
all:
export srctree OUTPUT CC LD CFLAGS V
build := -f $(srctree)/tools/build/Makefile.build dir=. obj
include $(srctree)/tools/build/Makefile.include
BPF_IN := $(OUTPUT)libbpf-in.o
LIB_FILE := $(addprefix $(OUTPUT),$(LIB_FILE))
@@ -132,7 +135,7 @@ CMD_TARGETS = $(LIB_FILE)
TARGETS = $(CMD_TARGETS)
all: $(VERSION_FILES) all_cmd
all: fixdep $(VERSION_FILES) all_cmd
all_cmd: $(CMD_TARGETS)

View File

@@ -93,8 +93,10 @@ else
print_install = echo ' INSTALL '$1' to $(DESTDIR_SQ)$2';
endif
all:
export srctree OUTPUT CC LD CFLAGS V
build := -f $(srctree)/tools/build/Makefile.build dir=. obj
include $(srctree)/tools/build/Makefile.include
do_compile_shared_library = \
($(print_shared_lib_compile) \
@@ -109,7 +111,7 @@ CMD_TARGETS = $(LIB_FILE)
TARGETS = $(CMD_TARGETS)
all: all_cmd
all: fixdep all_cmd
all_cmd: $(CMD_TARGETS)

View File

@@ -2,6 +2,12 @@
#include <stdio.h>
#include <stdlib.h>
u8 kallsyms2elf_type(char type)
{
type = tolower(type);
return (type == 't' || type == 'w') ? STT_FUNC : STT_OBJECT;
}
int kallsyms__parse(const char *filename, void *arg,
int (*process_symbol)(void *arg, const char *name,
char type, u64 start))

View File

@@ -9,7 +9,7 @@
#define KSYM_NAME_LEN 256
#endif
static inline u8 kallsyms2elf_type(char type)
static inline u8 kallsyms2elf_binding(char type)
{
if (type == 'W')
return STB_WEAK;
@@ -17,6 +17,8 @@ static inline u8 kallsyms2elf_type(char type)
return isupper(type) ? STB_GLOBAL : STB_LOCAL;
}
u8 kallsyms2elf_type(char type);
int kallsyms__parse(const char *filename, void *arg,
int (*process_symbol)(void *arg, const char *name,
char type, u64 start));

View File

@@ -848,6 +848,7 @@ static void free_arg(struct print_arg *arg)
free(arg->bitmask.bitmask);
break;
case PRINT_DYNAMIC_ARRAY:
case PRINT_DYNAMIC_ARRAY_LEN:
free(arg->dynarray.index);
break;
case PRINT_OP:
@@ -2728,6 +2729,42 @@ process_dynamic_array(struct event_format *event, struct print_arg *arg, char **
return EVENT_ERROR;
}
static enum event_type
process_dynamic_array_len(struct event_format *event, struct print_arg *arg,
char **tok)
{
struct format_field *field;
enum event_type type;
char *token;
if (read_expect_type(EVENT_ITEM, &token) < 0)
goto out_free;
arg->type = PRINT_DYNAMIC_ARRAY_LEN;
/* Find the field */
field = pevent_find_field(event, token);
if (!field)
goto out_free;
arg->dynarray.field = field;
arg->dynarray.index = 0;
if (read_expected(EVENT_DELIM, ")") < 0)
goto out_err;
type = read_token(&token);
*tok = token;
return type;
out_free:
free_token(token);
out_err:
*tok = NULL;
return EVENT_ERROR;
}
static enum event_type
process_paren(struct event_format *event, struct print_arg *arg, char **tok)
{
@@ -2975,6 +3012,10 @@ process_function(struct event_format *event, struct print_arg *arg,
free_token(token);
return process_dynamic_array(event, arg, tok);
}
if (strcmp(token, "__get_dynamic_array_len") == 0) {
free_token(token);
return process_dynamic_array_len(event, arg, tok);
}
func = find_func_handler(event->pevent, token);
if (func) {
@@ -3655,14 +3696,25 @@ eval_num_arg(void *data, int size, struct event_format *event, struct print_arg
goto out_warning_op;
}
break;
case PRINT_DYNAMIC_ARRAY_LEN:
offset = pevent_read_number(pevent,
data + arg->dynarray.field->offset,
arg->dynarray.field->size);
/*
* The total allocated length of the dynamic array is
* stored in the top half of the field, and the offset
* is in the bottom half of the 32 bit field.
*/
val = (unsigned long long)(offset >> 16);
break;
case PRINT_DYNAMIC_ARRAY:
/* Without [], we pass the address to the dynamic data */
offset = pevent_read_number(pevent,
data + arg->dynarray.field->offset,
arg->dynarray.field->size);
/*
* The actual length of the dynamic array is stored
* in the top half of the field, and the offset
* The total allocated length of the dynamic array is
* stored in the top half of the field, and the offset
* is in the bottom half of the 32 bit field.
*/
offset &= 0xffff;
@@ -4853,8 +4905,8 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct event
else
ls = 2;
if (*(ptr+1) == 'F' ||
*(ptr+1) == 'f') {
if (*(ptr+1) == 'F' || *(ptr+1) == 'f' ||
*(ptr+1) == 'S' || *(ptr+1) == 's') {
ptr++;
show_func = *ptr;
} else if (*(ptr+1) == 'M' || *(ptr+1) == 'm') {

View File

@@ -294,6 +294,7 @@ enum print_arg_type {
PRINT_OP,
PRINT_FUNC,
PRINT_BITMASK,
PRINT_DYNAMIC_ARRAY_LEN,
};
struct print_arg {

View File

@@ -124,7 +124,10 @@ static const char *disassemble(unsigned char *insn, int len, uint64_t rip,
_ER(WBINVD, 54) \
_ER(XSETBV, 55) \
_ER(APIC_WRITE, 56) \
_ER(INVPCID, 58)
_ER(INVPCID, 58) \
_ER(PML_FULL, 62) \
_ER(XSAVES, 63) \
_ER(XRSTORS, 64)
#define SVM_EXIT_REASONS \
_ER(EXIT_READ_CR0, 0x000) \
@@ -352,15 +355,18 @@ static int kvm_nested_vmexit_handler(struct trace_seq *s, struct pevent_record *
union kvm_mmu_page_role {
unsigned word;
struct {
unsigned glevels:4;
unsigned level:4;
unsigned cr4_pae:1;
unsigned quadrant:2;
unsigned pad_for_nice_hex_output:6;
unsigned direct:1;
unsigned access:3;
unsigned invalid:1;
unsigned cr4_pge:1;
unsigned nxe:1;
unsigned cr0_wp:1;
unsigned smep_and_not_wp:1;
unsigned smap_and_not_wp:1;
unsigned pad_for_nice_hex_output:8;
unsigned smm:8;
};
};
@@ -385,15 +391,18 @@ static int kvm_mmu_print_role(struct trace_seq *s, struct pevent_record *record,
if (pevent_is_file_bigendian(event->pevent) ==
pevent_is_host_bigendian(event->pevent)) {
trace_seq_printf(s, "%u/%u q%u%s %s%s %spge %snxe",
trace_seq_printf(s, "%u q%u%s %s%s %spae %snxe %swp%s%s%s",
role.level,
role.glevels,
role.quadrant,
role.direct ? " direct" : "",
access_str[role.access],
role.invalid ? " invalid" : "",
role.cr4_pge ? "" : "!",
role.nxe ? "" : "!");
role.cr4_pae ? "" : "!",
role.nxe ? "" : "!",
role.cr0_wp ? "" : "!",
role.smep_and_not_wp ? " smep" : "",
role.smap_and_not_wp ? " smap" : "",
role.smm ? " smm" : "");
} else
trace_seq_printf(s, "WORD: %08x", role.word);

View File

@@ -671,6 +671,7 @@ The letters are:
e synthesize tracing error events
d create a debug log
g synthesize a call chain (use with i or x)
l synthesize last branch entries (use with i or x)
"Instructions" events look like they were recorded by "perf record -e
instructions".
@@ -707,12 +708,26 @@ on the sample is *not* adjusted and reflects the last known value of TSC.
For Intel PT, the default period is 100us.
Setting it to a zero period means "as often as possible".
In the case of Intel PT that is the same as a period of 1 and a unit of
'instructions' (i.e. --itrace=i1i).
Also the call chain size (default 16, max. 1024) for instructions or
transactions events can be specified. e.g.
--itrace=ig32
--itrace=xg32
Also the number of last branch entries (default 64, max. 1024) for instructions or
transactions events can be specified. e.g.
--itrace=il10
--itrace=xl10
Note that last branch entries are cleared for each sample, so there is no overlap
from one sample to the next.
To disable trace decoding entirely, use the option --no-itrace.
@@ -749,3 +764,32 @@ perf inject also accepts the --itrace option in which case tracing data is
removed and replaced with the synthesized events. e.g.
perf inject --itrace -i perf.data -o perf.data.new
Below is an example of using Intel PT with autofdo. It requires autofdo
(https://github.com/google/autofdo) and gcc version 5. The bubble
sort example is from the AutoFDO tutorial (https://gcc.gnu.org/wiki/AutoFDO/Tutorial)
amended to take the number of elements as a parameter.
$ gcc-5 -O3 sort.c -o sort_optimized
$ ./sort_optimized 30000
Bubble sorting array of 30000 elements
2254 ms
$ cat ~/.perfconfig
[intel-pt]
mispred-all
$ perf record -e intel_pt//u ./sort 3000
Bubble sorting array of 3000 elements
58 ms
[ perf record: Woken up 2 times to write data ]
[ perf record: Captured and wrote 3.939 MB perf.data ]
$ perf inject -i perf.data -o inj --itrace=i100usle --strip
$ ./create_gcov --binary=./sort --profile=inj --gcov=sort.gcov -gcov_version=1
$ gcc-5 -O3 -fauto-profile=sort.gcov sort.c -o sort_autofdo
$ ./sort_autofdo 30000
Bubble sorting array of 30000 elements
2155 ms
Note there is currently no advantage to using Intel PT instead of LBR, but
that may change in the future if greater use is made of the data.

View File

@@ -6,6 +6,7 @@
e synthesize error events
d create a debug log
g synthesize a call chain (use with i or x)
l synthesize last branch entries (use with i or x)
The default is all events i.e. the same as --itrace=ibxe
@@ -20,3 +21,6 @@
Also the call chain size (default 16, max. 1024) for instructions or
transactions events can be specified.
Also the number of last branch entries (default 64, max. 1024) for
instructions or transactions events can be specified.

View File

@@ -82,7 +82,7 @@ Be multi thread instead of multi process
Specify number of groups
-l::
--loop=::
--nr_loops=::
Specify number of loops
Example of *messaging*
@@ -139,64 +139,48 @@ Suite for evaluating performance of simple memory copy in various ways.
Options of *memcpy*
^^^^^^^^^^^^^^^^^^^
-l::
--length::
Specify length of memory to copy (default: 1MB).
--size::
Specify size of memory to copy (default: 1MB).
Available units are B, KB, MB, GB and TB (case insensitive).
-r::
--routine::
Specify routine to copy (default: default).
Available routines are depend on the architecture.
-f::
--function::
Specify function to copy (default: default).
Available functions are depend on the architecture.
On x86-64, x86-64-unrolled, x86-64-movsq and x86-64-movsb are supported.
-i::
--iterations::
-l::
--nr_loops::
Repeat memcpy invocation this number of times.
-c::
--cycle::
--cycles::
Use perf's cpu-cycles event instead of gettimeofday syscall.
-o::
--only-prefault::
Show only the result with page faults before memcpy.
-n::
--no-prefault::
Show only the result without page faults before memcpy.
*memset*::
Suite for evaluating performance of simple memory set in various ways.
Options of *memset*
^^^^^^^^^^^^^^^^^^^
-l::
--length::
Specify length of memory to set (default: 1MB).
--size::
Specify size of memory to set (default: 1MB).
Available units are B, KB, MB, GB and TB (case insensitive).
-r::
--routine::
Specify routine to set (default: default).
Available routines are depend on the architecture.
-f::
--function::
Specify function to set (default: default).
Available functions are depend on the architecture.
On x86-64, x86-64-unrolled, x86-64-stosq and x86-64-stosb are supported.
-i::
--iterations::
-l::
--nr_loops::
Repeat memset invocation this number of times.
-c::
--cycle::
--cycles::
Use perf's cpu-cycles event instead of gettimeofday syscall.
-o::
--only-prefault::
Show only the result with page faults before memset.
-n::
--no-prefault::
Show only the result without page faults before memset.
SUITES FOR 'numa'
~~~~~~~~~~~~~~~~~
*mem*::

View File

@@ -50,6 +50,9 @@ OPTIONS
include::itrace.txt[]
--strip::
Use with --itrace to strip out non-synthesized events.
SEE ALSO
--------
linkperf:perf-record[1], linkperf:perf-report[1], linkperf:perf-archive[1]

View File

@@ -30,6 +30,7 @@ counted. The following modifiers exist:
G - guest counting (in KVM guests)
H - host counting (not in KVM guests)
p - precise level
P - use maximum detected precise level
S - read sample value (PERF_SAMPLE_READ)
D - pin the event to the PMU
@@ -125,6 +126,8 @@ To limit the list use:
. If none of the above is matched, it will apply the supplied glob to all
events, printing the ones that match.
. As a last resort, it will do a substring search in all event names.
One or more types can be used at the same time, listing the events for the
types specified.

View File

@@ -144,7 +144,7 @@ OPTIONS
--call-graph::
Setup and enable call-graph (stack chain/backtrace) recording,
implies -g.
implies -g. Default is "fp".
Allows specifying "fp" (frame pointer) or "dwarf"
(DWARF's CFI - Call Frame Information) or "lbr"
@@ -154,13 +154,18 @@ OPTIONS
In some systems, where binaries are build with gcc
--fomit-frame-pointer, using the "fp" method will produce bogus
call graphs, using "dwarf", if available (perf tools linked to
the libunwind library) should be used instead.
the libunwind or libdw library) should be used instead.
Using the "lbr" method doesn't require any compiler options. It
will produce call graphs from the hardware LBR registers. The
main limition is that it is only available on new Intel
platforms, such as Haswell. It can only get user call chain. It
doesn't work with branch stack sampling at the same time.
When "dwarf" recording is used, perf also records (user) stack dump
when sampled. Default size of the stack dump is 8192 (bytes).
User can change the size by passing the size after comma like
"--call-graph dwarf,4096".
-q::
--quiet::
Don't print any message, useful for scripting.
@@ -236,6 +241,7 @@ following filters are defined:
- any_call: any function call or system call
- any_ret: any function return or system call return
- ind_call: any indirect branch
- call: direct calls, including far (to/from kernel) calls
- u: only when the branch target is at the user level
- k: only when the branch target is in the kernel
- hv: only when the target is at the hypervisor level
@@ -308,6 +314,12 @@ This option sets the time out limit. The default value is 500 ms.
Record context switch events i.e. events of type PERF_RECORD_SWITCH or
PERF_RECORD_SWITCH_CPU_WIDE.
--clang-path::
Path to clang binary to use for compiling BPF scriptlets.
--clang-opt::
Options passed to clang when compiling BPF scriptlets.
SEE ALSO
--------
linkperf:perf-stat[1], linkperf:perf-list[1]

View File

@@ -29,7 +29,7 @@ OPTIONS
--show-nr-samples::
Show the number of samples for each symbol
--showcpuutilization::
--show-cpu-utilization::
Show sample percentage for different cpu modes.
-T::
@@ -68,7 +68,7 @@ OPTIONS
--sort=::
Sort histogram entries by given key(s) - multiple keys can be specified
in CSV format. Following sort keys are available:
pid, comm, dso, symbol, parent, cpu, srcline, weight, local_weight.
pid, comm, dso, symbol, parent, cpu, socket, srcline, weight, local_weight.
Each key has following meaning:
@@ -79,6 +79,7 @@ OPTIONS
- parent: name of function matched to the parent regex filter. Unmatched
entries are displayed as "[other]".
- cpu: cpu number the task ran at the time of sample
- socket: processor socket number the task ran at the time of sample
- srcline: filename and line number executed at the time of sample. The
DWARF debugging info must be provided.
- srcfile: file name of the source file of the same. Requires dwarf
@@ -168,30 +169,40 @@ OPTIONS
--dump-raw-trace::
Dump raw trace in ASCII.
-g [type,min[,limit],order[,key][,branch]]::
--call-graph::
Display call chains using type, min percent threshold, optional print
limit and order.
type can be either:
-g::
--call-graph=<print_type,threshold[,print_limit],order,sort_key,branch>::
Display call chains using type, min percent threshold, print limit,
call order, sort key and branch. Note that ordering of parameters is not
fixed so any parement can be given in an arbitraty order. One exception
is the print_limit which should be preceded by threshold.
print_type can be either:
- flat: single column, linear exposure of call chains.
- graph: use a graph tree, displaying absolute overhead rates.
- graph: use a graph tree, displaying absolute overhead rates. (default)
- fractal: like graph, but displays relative rates. Each branch of
the tree is considered as a new profiled object. +
the tree is considered as a new profiled object.
- none: disable call chain display.
threshold is a percentage value which specifies a minimum percent to be
included in the output call graph. Default is 0.5 (%).
print_limit is only applied when stdio interface is used. It's to limit
number of call graph entries in a single hist entry. Note that it needs
to be given after threshold (but not necessarily consecutive).
Default is 0 (unlimited).
order can be either:
- callee: callee based call graph.
- caller: inverted caller based call graph.
Default is 'caller' when --children is used, otherwise 'callee'.
key can be:
- function: compare on functions
sort_key can be:
- function: compare on functions (default)
- address: compare on individual code addresses
branch can be:
- branch: include last branch information in callgraph
when available. Usually more convenient to use --branch-history
for this.
Default: fractal,0.5,callee,function.
- branch: include last branch information in callgraph when available.
Usually more convenient to use --branch-history for this.
--children::
Accumulate callchain of children to parent entry so that then can
@@ -204,6 +215,8 @@ OPTIONS
beyond the specified depth will be ignored. This is a trade-off
between information loss and faster processing especially for
workloads that can have a very long callchain stack.
Note that when using the --itrace option the synthesized callchain size
will override this value if the synthesized callchain size is bigger.
Default: 127
@@ -349,6 +362,9 @@ include::itrace.txt[]
This option extends the perf report to show reference callgraphs,
which collected by reference event, in no callgraph event.
--socket-filter::
Only report the samples on the processor socket that match with this filter
include::callchain-overhead-calculation.txt[]
SEE ALSO

View File

@@ -112,11 +112,11 @@ OPTIONS
--debug-mode::
Do various checks like samples ordering and lost events.
-f::
-F::
--fields::
Comma separated list of fields to print. Options are:
comm, tid, pid, time, cpu, event, trace, ip, sym, dso, addr, symoff,
srcline, period, iregs, flags.
srcline, period, iregs, brstack, brstacksym, flags.
Field list can be prepended with the type, trace, sw or hw,
to indicate to which event type the field list applies.
e.g., -f sw:comm,tid,time,ip,sym and -f trace:time,cpu,trace
@@ -175,6 +175,16 @@ OPTIONS
Finally, a user may not set fields to none for all event types.
i.e., -f "" is not allowed.
The brstack output includes branch related information with raw addresses using the
/v/v/v/v/ syntax in the following order:
FROM: branch source instruction
TO : branch target instruction
M/P/-: M=branch target mispredicted or branch direction was mispredicted, P=target predicted or direction predicted, -=not supported
X/- : X=branch inside a transactional region, -=not in transaction region or not supported
A/- : A=TSX abort entry, -=not aborted region or not supported
The brstacksym is identical to brstack, except that the FROM and TO addresses are printed in a symbolic form if possible.
-k::
--vmlinux=<file>::
vmlinux pathname
@@ -249,6 +259,9 @@ include::itrace.txt[]
--full-source-path::
Show the full path for source files for srcline output.
--ns::
Use 9 decimal places when displaying time (i.e. show the nanoseconds)
SEE ALSO
--------
linkperf:perf-record[1], linkperf:perf-script-perl[1],

View File

@@ -128,8 +128,9 @@ perf stat --repeat 10 --null --sync --pre 'make -s O=defconfig-build/clean' -- m
-I msecs::
--interval-print msecs::
Print count deltas every N milliseconds (minimum: 100ms)
example: perf stat -I 1000 -e cycles -a sleep 5
Print count deltas every N milliseconds (minimum: 10ms)
The overhead percentage could be high in some cases, for instance with small, sub 100ms intervals. Use with caution.
example: 'perf stat -I 1000 -e cycles -a sleep 5'
--per-socket::
Aggregate counts per processor socket for system-wide mode measurements. This

View File

@@ -160,9 +160,10 @@ Default is to monitor all CPUS.
-g::
Enables call-graph (stack chain/backtrace) recording.
--call-graph::
--call-graph [mode,type,min[,limit],order[,key][,branch]]::
Setup and enable call-graph (stack chain/backtrace) recording,
implies -g.
implies -g. See `--call-graph` section in perf-record and
perf-report man pages for details.
--children::
Accumulate callchain of children to parent entry so that then can

View File

@@ -27,6 +27,14 @@ OPTIONS
Setup buildid cache directory. It has higher priority than
buildid.dir config file option.
-v::
--version::
Display perf version.
-h::
--help::
Run perf help command.
DESCRIPTION
-----------
Performance counters for Linux are a new kernel-based subsystem

View File

@@ -17,6 +17,7 @@ tools/build
tools/arch/x86/include/asm/atomic.h
tools/arch/x86/include/asm/rmwcc.h
tools/lib/traceevent
tools/lib/bpf
tools/lib/api
tools/lib/bpf
tools/lib/hweight.c
@@ -41,6 +42,7 @@ tools/include/asm-generic/bitops.h
tools/include/linux/atomic.h
tools/include/linux/bitops.h
tools/include/linux/compiler.h
tools/include/linux/filter.h
tools/include/linux/hash.h
tools/include/linux/kernel.h
tools/include/linux/list.h
@@ -49,6 +51,7 @@ tools/include/linux/poison.h
tools/include/linux/rbtree.h
tools/include/linux/rbtree_augmented.h
tools/include/linux/types.h
tools/include/linux/err.h
include/asm-generic/bitops/arch_hweight.h
include/asm-generic/bitops/const_hweight.h
include/asm-generic/bitops/fls64.h
@@ -67,6 +70,8 @@ arch/*/lib/memset*.S
include/linux/poison.h
include/linux/hw_breakpoint.h
include/uapi/linux/perf_event.h
include/uapi/linux/bpf.h
include/uapi/linux/bpf_common.h
include/uapi/linux/const.h
include/uapi/linux/swab.h
include/uapi/linux/hw_breakpoint.h

View File

@@ -75,6 +75,8 @@ include config/utilities.mak
# Define NO_LZMA if you do not want to support compressed (xz) kernel modules
#
# Define NO_AUXTRACE if you do not want AUX area tracing support
#
# Define NO_LIBBPF if you do not want BPF support
# As per kernel Makefile, avoid funny character set dependencies
unexport LC_ALL
@@ -145,6 +147,7 @@ AWK = awk
LIB_DIR = $(srctree)/tools/lib/api/
TRACE_EVENT_DIR = $(srctree)/tools/lib/traceevent/
BPF_DIR = $(srctree)/tools/lib/bpf/
# include config/Makefile by default and rule out
# non-config cases
@@ -180,6 +183,7 @@ strip-libs = $(filter-out -l%,$(1))
ifneq ($(OUTPUT),)
TE_PATH=$(OUTPUT)
BPF_PATH=$(OUTPUT)
ifneq ($(subdir),)
LIB_PATH=$(OUTPUT)/../lib/api/
else
@@ -188,6 +192,7 @@ endif
else
TE_PATH=$(TRACE_EVENT_DIR)
LIB_PATH=$(LIB_DIR)
BPF_PATH=$(BPF_DIR)
endif
LIBTRACEEVENT = $(TE_PATH)libtraceevent.a
@@ -199,6 +204,8 @@ LIBTRACEEVENT_DYNAMIC_LIST_LDFLAGS = -Xlinker --dynamic-list=$(LIBTRACEEVENT_DYN
LIBAPI = $(LIB_PATH)libapi.a
export LIBAPI
LIBBPF = $(BPF_PATH)libbpf.a
# python extension build directories
PYTHON_EXTBUILD := $(OUTPUT)python_ext_build/
PYTHON_EXTBUILD_LIB := $(PYTHON_EXTBUILD)lib/
@@ -251,6 +258,9 @@ export PERL_PATH
LIB_FILE=$(OUTPUT)libperf.a
PERFLIBS = $(LIB_FILE) $(LIBAPI) $(LIBTRACEEVENT)
ifndef NO_LIBBPF
PERFLIBS += $(LIBBPF)
endif
# We choose to avoid "if .. else if .. else .. endif endif"
# because maintaining the nesting to match is a pain. If
@@ -297,16 +307,16 @@ strip: $(PROGRAMS) $(OUTPUT)perf
PERF_IN := $(OUTPUT)perf-in.o
export srctree OUTPUT RM CC LD AR CFLAGS V BISON FLEX AWK
build := -f $(srctree)/tools/build/Makefile.build dir=. obj
include $(srctree)/tools/build/Makefile.include
$(PERF_IN): $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h FORCE
$(PERF_IN): prepare FORCE
$(Q)$(MAKE) $(build)=perf
$(OUTPUT)perf: $(PERFLIBS) $(PERF_IN) $(LIBTRACEEVENT_DYNAMIC_LIST)
$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(LIBTRACEEVENT_DYNAMIC_LIST_LDFLAGS) \
$(PERF_IN) $(LIBS) -o $@
$(GTK_IN): FORCE
$(GTK_IN): fixdep FORCE
$(Q)$(MAKE) $(build)=gtk
$(OUTPUT)libperf-gtk.so: $(GTK_IN) $(PERFLIBS)
@@ -349,27 +359,27 @@ endif
__build-dir = $(subst $(OUTPUT),,$(dir $@))
build-dir = $(if $(__build-dir),$(__build-dir),.)
single_dep: $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h
prepare: $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h fixdep
$(OUTPUT)%.o: %.c single_dep FORCE
$(OUTPUT)%.o: %.c prepare FORCE
$(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@
$(OUTPUT)%.i: %.c single_dep FORCE
$(OUTPUT)%.i: %.c prepare FORCE
$(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@
$(OUTPUT)%.s: %.c single_dep FORCE
$(OUTPUT)%.s: %.c prepare FORCE
$(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@
$(OUTPUT)%-bison.o: %.c single_dep FORCE
$(OUTPUT)%-bison.o: %.c prepare FORCE
$(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@
$(OUTPUT)%-flex.o: %.c single_dep FORCE
$(OUTPUT)%-flex.o: %.c prepare FORCE
$(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@
$(OUTPUT)%.o: %.S single_dep FORCE
$(OUTPUT)%.o: %.S prepare FORCE
$(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@
$(OUTPUT)%.i: %.S single_dep FORCE
$(OUTPUT)%.i: %.S prepare FORCE
$(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@
$(OUTPUT)perf-%: %.o $(PERFLIBS)
@@ -389,7 +399,7 @@ $(patsubst perf-%,%.o,$(PROGRAMS)): $(wildcard */*.h)
LIBPERF_IN := $(OUTPUT)libperf-in.o
$(LIBPERF_IN): FORCE
$(LIBPERF_IN): fixdep FORCE
$(Q)$(MAKE) $(build)=libperf
$(LIB_FILE): $(LIBPERF_IN)
@@ -397,10 +407,10 @@ $(LIB_FILE): $(LIBPERF_IN)
LIBTRACEEVENT_FLAGS += plugin_dir=$(plugindir_SQ)
$(LIBTRACEEVENT): FORCE
$(LIBTRACEEVENT): fixdep FORCE
$(Q)$(MAKE) -C $(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) O=$(OUTPUT) $(OUTPUT)libtraceevent.a
libtraceevent_plugins: FORCE
libtraceevent_plugins: fixdep FORCE
$(Q)$(MAKE) -C $(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) O=$(OUTPUT) plugins
$(LIBTRACEEVENT_DYNAMIC_LIST): libtraceevent_plugins
@@ -413,13 +423,20 @@ $(LIBTRACEEVENT)-clean:
install-traceevent-plugins: $(LIBTRACEEVENT)
$(Q)$(MAKE) -C $(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) O=$(OUTPUT) install_plugins
$(LIBAPI): FORCE
$(LIBAPI): fixdep FORCE
$(Q)$(MAKE) -C $(LIB_DIR) O=$(OUTPUT) $(OUTPUT)libapi.a
$(LIBAPI)-clean:
$(call QUIET_CLEAN, libapi)
$(Q)$(MAKE) -C $(LIB_DIR) O=$(OUTPUT) clean >/dev/null
$(LIBBPF): fixdep FORCE
$(Q)$(MAKE) -C $(BPF_DIR) O=$(OUTPUT) $(OUTPUT)libbpf.a
$(LIBBPF)-clean:
$(call QUIET_CLEAN, libbpf)
$(Q)$(MAKE) -C $(BPF_DIR) O=$(OUTPUT) clean >/dev/null
help:
@echo 'Perf make targets:'
@echo ' doc - make *all* documentation (see below)'
@@ -459,7 +476,7 @@ INSTALL_DOC_TARGETS += quick-install-doc quick-install-man quick-install-html
$(DOC_TARGETS):
$(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) $(@:doc=all)
TAG_FOLDERS= . ../lib/traceevent ../lib/api ../lib/symbol
TAG_FOLDERS= . ../lib/traceevent ../lib/api ../lib/symbol ../include ../lib/bpf
TAG_FILES= ../../include/uapi/linux/perf_event.h
TAGS:
@@ -567,7 +584,7 @@ config-clean:
$(call QUIET_CLEAN, config)
$(Q)$(MAKE) -C $(srctree)/tools/build/feature/ clean >/dev/null
clean: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean config-clean
clean: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean config-clean
$(call QUIET_CLEAN, core-objs) $(RM) $(LIB_FILE) $(OUTPUT)perf-archive $(OUTPUT)perf-with-kcore $(LANG_BINDINGS)
$(Q)find . -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete
$(Q)$(RM) $(OUTPUT).config-detected
@@ -591,6 +608,6 @@ FORCE:
.PHONY: all install clean config-clean strip install-gtk
.PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell
.PHONY: $(GIT-HEAD-PHONY) TAGS tags cscope FORCE single_dep
.PHONY: $(GIT-HEAD-PHONY) TAGS tags cscope FORCE prepare
.PHONY: libtraceevent_plugins

View File

@@ -128,9 +128,8 @@ static const char *normalize_arch(char *arch)
return arch;
}
static int perf_session_env__lookup_binutils_path(struct perf_env *env,
const char *name,
const char **path)
static int perf_env__lookup_binutils_path(struct perf_env *env,
const char *name, const char **path)
{
int idx;
const char *arch, *cross_env;
@@ -206,7 +205,7 @@ out_error:
return -1;
}
int perf_session_env__lookup_objdump(struct perf_env *env)
int perf_env__lookup_objdump(struct perf_env *env)
{
/*
* For live mode, env->arch will be NULL and we can use
@@ -215,6 +214,5 @@ int perf_session_env__lookup_objdump(struct perf_env *env)
if (env->arch == NULL)
return 0;
return perf_session_env__lookup_binutils_path(env, "objdump",
&objdump_path);
return perf_env__lookup_binutils_path(env, "objdump", &objdump_path);
}

View File

@@ -1,10 +1,10 @@
#ifndef ARCH_PERF_COMMON_H
#define ARCH_PERF_COMMON_H
#include "../util/session.h"
#include "../util/env.h"
extern const char *objdump_path;
int perf_session_env__lookup_objdump(struct perf_env *env);
int perf_env__lookup_objdump(struct perf_env *env);
#endif /* ARCH_PERF_COMMON_H */

View File

@@ -1,2 +1,2 @@
libperf-y += util/
libperf-$(CONFIG_DWARF_UNWIND) += tests/
libperf-y += tests/

View File

@@ -2,3 +2,4 @@ ifndef NO_DWARF
PERF_HAVE_DWARF_REGS := 1
endif
HAVE_KVM_STAT_SUPPORT := 1
PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET := 1

View File

@@ -0,0 +1,19 @@
#ifndef ARCH_TESTS_H
#define ARCH_TESTS_H
/* Tests */
int test__rdpmc(void);
int test__perf_time_to_tsc(void);
int test__insn_x86(void);
int test__intel_cqm_count_nmi_context(void);
#ifdef HAVE_DWARF_UNWIND_SUPPORT
struct thread;
struct perf_sample;
int test__arch_unwind_sample(struct perf_sample *sample,
struct thread *thread);
#endif
extern struct test arch_tests[];
#endif

View File

@@ -1,2 +1,8 @@
libperf-y += regs_load.o
libperf-y += dwarf-unwind.o
libperf-$(CONFIG_DWARF_UNWIND) += regs_load.o
libperf-$(CONFIG_DWARF_UNWIND) += dwarf-unwind.o
libperf-y += arch-tests.o
libperf-y += rdpmc.o
libperf-y += perf-time-to-tsc.o
libperf-$(CONFIG_AUXTRACE) += insn-x86.o
libperf-y += intel-cqm.o

View File

@@ -0,0 +1,34 @@
#include <string.h>
#include "tests/tests.h"
#include "arch-tests.h"
struct test arch_tests[] = {
{
.desc = "x86 rdpmc test",
.func = test__rdpmc,
},
{
.desc = "Test converting perf time to TSC",
.func = test__perf_time_to_tsc,
},
#ifdef HAVE_DWARF_UNWIND_SUPPORT
{
.desc = "Test dwarf unwind",
.func = test__dwarf_unwind,
},
#endif
#ifdef HAVE_AUXTRACE_SUPPORT
{
.desc = "Test x86 instruction decoder - new instructions",
.func = test__insn_x86,
},
#endif
{
.desc = "Test intel cqm nmi context read",
.func = test__intel_cqm_count_nmi_context,
},
{
.func = NULL,
},
};

View File

@@ -5,6 +5,7 @@
#include "event.h"
#include "debug.h"
#include "tests/tests.h"
#include "arch-tests.h"
#define STACK_SIZE 8192

View File

@@ -0,0 +1,75 @@
#!/bin/awk -f
# gen-insn-x86-dat.awk: script to convert data for the insn-x86 test
# Copyright (c) 2015, Intel Corporation.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free Software Foundation.
#
# This program is distributed in the hope it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
BEGIN {
print "/*"
print " * Generated by gen-insn-x86-dat.sh and gen-insn-x86-dat.awk"
print " * from insn-x86-dat-src.c for inclusion by insn-x86.c"
print " * Do not change this code."
print "*/\n"
op = ""
branch = ""
rel = 0
going = 0
}
/ Start here / {
going = 1
}
/ Stop here / {
going = 0
}
/^\s*[0-9a-fA-F]+\:/ {
if (going) {
colon_pos = index($0, ":")
useful_line = substr($0, colon_pos + 1)
first_pos = match(useful_line, "[0-9a-fA-F]")
useful_line = substr(useful_line, first_pos)
gsub("\t", "\\t", useful_line)
printf "{{"
len = 0
for (i = 2; i <= NF; i++) {
if (match($i, "^[0-9a-fA-F][0-9a-fA-F]$")) {
printf "0x%s, ", $i
len += 1
} else {
break
}
}
printf "}, %d, %s, \"%s\", \"%s\",", len, rel, op, branch
printf "\n\"%s\",},\n", useful_line
op = ""
branch = ""
rel = 0
}
}
/ Expecting: / {
expecting_str = " Expecting: "
expecting_len = length(expecting_str)
expecting_pos = index($0, expecting_str)
useful_line = substr($0, expecting_pos + expecting_len)
for (i = 1; i <= NF; i++) {
if ($i == "Expecting:") {
i++
op = $i
i++
branch = $i
i++
rel = $i
break
}
}
}

View File

@@ -0,0 +1,43 @@
#!/bin/sh
# gen-insn-x86-dat: generate data for the insn-x86 test
# Copyright (c) 2015, Intel Corporation.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free Software Foundation.
#
# This program is distributed in the hope it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
set -e
if [ "$(uname -m)" != "x86_64" ]; then
echo "ERROR: This script only works on x86_64"
exit 1
fi
cd $(dirname $0)
trap 'echo "Might need a more recent version of binutils"' EXIT
echo "Compiling insn-x86-dat-src.c to 64-bit object"
gcc -g -c insn-x86-dat-src.c
objdump -dSw insn-x86-dat-src.o | awk -f gen-insn-x86-dat.awk > insn-x86-dat-64.c
rm -f insn-x86-dat-src.o
echo "Compiling insn-x86-dat-src.c to 32-bit object"
gcc -g -c -m32 insn-x86-dat-src.c
objdump -dSw insn-x86-dat-src.o | awk -f gen-insn-x86-dat.awk > insn-x86-dat-32.c
rm -f insn-x86-dat-src.o
trap - EXIT
echo "Done (use git diff to see the changes)"

View File

@@ -0,0 +1,658 @@
/*
* Generated by gen-insn-x86-dat.sh and gen-insn-x86-dat.awk
* from insn-x86-dat-src.c for inclusion by insn-x86.c
* Do not change this code.
*/
{{0x0f, 0x31, }, 2, 0, "", "",
"0f 31 \trdtsc ",},
{{0xf3, 0x0f, 0x1b, 0x00, }, 4, 0, "", "",
"f3 0f 1b 00 \tbndmk (%eax),%bnd0",},
{{0xf3, 0x0f, 0x1b, 0x05, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"f3 0f 1b 05 78 56 34 12 \tbndmk 0x12345678,%bnd0",},
{{0xf3, 0x0f, 0x1b, 0x18, }, 4, 0, "", "",
"f3 0f 1b 18 \tbndmk (%eax),%bnd3",},
{{0xf3, 0x0f, 0x1b, 0x04, 0x01, }, 5, 0, "", "",
"f3 0f 1b 04 01 \tbndmk (%ecx,%eax,1),%bnd0",},
{{0xf3, 0x0f, 0x1b, 0x04, 0x05, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"f3 0f 1b 04 05 78 56 34 12 \tbndmk 0x12345678(,%eax,1),%bnd0",},
{{0xf3, 0x0f, 0x1b, 0x04, 0x08, }, 5, 0, "", "",
"f3 0f 1b 04 08 \tbndmk (%eax,%ecx,1),%bnd0",},
{{0xf3, 0x0f, 0x1b, 0x04, 0xc8, }, 5, 0, "", "",
"f3 0f 1b 04 c8 \tbndmk (%eax,%ecx,8),%bnd0",},
{{0xf3, 0x0f, 0x1b, 0x40, 0x12, }, 5, 0, "", "",
"f3 0f 1b 40 12 \tbndmk 0x12(%eax),%bnd0",},
{{0xf3, 0x0f, 0x1b, 0x45, 0x12, }, 5, 0, "", "",
"f3 0f 1b 45 12 \tbndmk 0x12(%ebp),%bnd0",},
{{0xf3, 0x0f, 0x1b, 0x44, 0x01, 0x12, }, 6, 0, "", "",
"f3 0f 1b 44 01 12 \tbndmk 0x12(%ecx,%eax,1),%bnd0",},
{{0xf3, 0x0f, 0x1b, 0x44, 0x05, 0x12, }, 6, 0, "", "",
"f3 0f 1b 44 05 12 \tbndmk 0x12(%ebp,%eax,1),%bnd0",},
{{0xf3, 0x0f, 0x1b, 0x44, 0x08, 0x12, }, 6, 0, "", "",
"f3 0f 1b 44 08 12 \tbndmk 0x12(%eax,%ecx,1),%bnd0",},
{{0xf3, 0x0f, 0x1b, 0x44, 0xc8, 0x12, }, 6, 0, "", "",
"f3 0f 1b 44 c8 12 \tbndmk 0x12(%eax,%ecx,8),%bnd0",},
{{0xf3, 0x0f, 0x1b, 0x80, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"f3 0f 1b 80 78 56 34 12 \tbndmk 0x12345678(%eax),%bnd0",},
{{0xf3, 0x0f, 0x1b, 0x85, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"f3 0f 1b 85 78 56 34 12 \tbndmk 0x12345678(%ebp),%bnd0",},
{{0xf3, 0x0f, 0x1b, 0x84, 0x01, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"f3 0f 1b 84 01 78 56 34 12 \tbndmk 0x12345678(%ecx,%eax,1),%bnd0",},
{{0xf3, 0x0f, 0x1b, 0x84, 0x05, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"f3 0f 1b 84 05 78 56 34 12 \tbndmk 0x12345678(%ebp,%eax,1),%bnd0",},
{{0xf3, 0x0f, 0x1b, 0x84, 0x08, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"f3 0f 1b 84 08 78 56 34 12 \tbndmk 0x12345678(%eax,%ecx,1),%bnd0",},
{{0xf3, 0x0f, 0x1b, 0x84, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"f3 0f 1b 84 c8 78 56 34 12 \tbndmk 0x12345678(%eax,%ecx,8),%bnd0",},
{{0xf3, 0x0f, 0x1a, 0x00, }, 4, 0, "", "",
"f3 0f 1a 00 \tbndcl (%eax),%bnd0",},
{{0xf3, 0x0f, 0x1a, 0x05, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"f3 0f 1a 05 78 56 34 12 \tbndcl 0x12345678,%bnd0",},
{{0xf3, 0x0f, 0x1a, 0x18, }, 4, 0, "", "",
"f3 0f 1a 18 \tbndcl (%eax),%bnd3",},
{{0xf3, 0x0f, 0x1a, 0x04, 0x01, }, 5, 0, "", "",
"f3 0f 1a 04 01 \tbndcl (%ecx,%eax,1),%bnd0",},
{{0xf3, 0x0f, 0x1a, 0x04, 0x05, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"f3 0f 1a 04 05 78 56 34 12 \tbndcl 0x12345678(,%eax,1),%bnd0",},
{{0xf3, 0x0f, 0x1a, 0x04, 0x08, }, 5, 0, "", "",
"f3 0f 1a 04 08 \tbndcl (%eax,%ecx,1),%bnd0",},
{{0xf3, 0x0f, 0x1a, 0x04, 0xc8, }, 5, 0, "", "",
"f3 0f 1a 04 c8 \tbndcl (%eax,%ecx,8),%bnd0",},
{{0xf3, 0x0f, 0x1a, 0x40, 0x12, }, 5, 0, "", "",
"f3 0f 1a 40 12 \tbndcl 0x12(%eax),%bnd0",},
{{0xf3, 0x0f, 0x1a, 0x45, 0x12, }, 5, 0, "", "",
"f3 0f 1a 45 12 \tbndcl 0x12(%ebp),%bnd0",},
{{0xf3, 0x0f, 0x1a, 0x44, 0x01, 0x12, }, 6, 0, "", "",
"f3 0f 1a 44 01 12 \tbndcl 0x12(%ecx,%eax,1),%bnd0",},
{{0xf3, 0x0f, 0x1a, 0x44, 0x05, 0x12, }, 6, 0, "", "",
"f3 0f 1a 44 05 12 \tbndcl 0x12(%ebp,%eax,1),%bnd0",},
{{0xf3, 0x0f, 0x1a, 0x44, 0x08, 0x12, }, 6, 0, "", "",
"f3 0f 1a 44 08 12 \tbndcl 0x12(%eax,%ecx,1),%bnd0",},
{{0xf3, 0x0f, 0x1a, 0x44, 0xc8, 0x12, }, 6, 0, "", "",
"f3 0f 1a 44 c8 12 \tbndcl 0x12(%eax,%ecx,8),%bnd0",},
{{0xf3, 0x0f, 0x1a, 0x80, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"f3 0f 1a 80 78 56 34 12 \tbndcl 0x12345678(%eax),%bnd0",},
{{0xf3, 0x0f, 0x1a, 0x85, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"f3 0f 1a 85 78 56 34 12 \tbndcl 0x12345678(%ebp),%bnd0",},
{{0xf3, 0x0f, 0x1a, 0x84, 0x01, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"f3 0f 1a 84 01 78 56 34 12 \tbndcl 0x12345678(%ecx,%eax,1),%bnd0",},
{{0xf3, 0x0f, 0x1a, 0x84, 0x05, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"f3 0f 1a 84 05 78 56 34 12 \tbndcl 0x12345678(%ebp,%eax,1),%bnd0",},
{{0xf3, 0x0f, 0x1a, 0x84, 0x08, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"f3 0f 1a 84 08 78 56 34 12 \tbndcl 0x12345678(%eax,%ecx,1),%bnd0",},
{{0xf3, 0x0f, 0x1a, 0x84, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"f3 0f 1a 84 c8 78 56 34 12 \tbndcl 0x12345678(%eax,%ecx,8),%bnd0",},
{{0xf3, 0x0f, 0x1a, 0xc0, }, 4, 0, "", "",
"f3 0f 1a c0 \tbndcl %eax,%bnd0",},
{{0xf2, 0x0f, 0x1a, 0x00, }, 4, 0, "", "",
"f2 0f 1a 00 \tbndcu (%eax),%bnd0",},
{{0xf2, 0x0f, 0x1a, 0x05, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"f2 0f 1a 05 78 56 34 12 \tbndcu 0x12345678,%bnd0",},
{{0xf2, 0x0f, 0x1a, 0x18, }, 4, 0, "", "",
"f2 0f 1a 18 \tbndcu (%eax),%bnd3",},
{{0xf2, 0x0f, 0x1a, 0x04, 0x01, }, 5, 0, "", "",
"f2 0f 1a 04 01 \tbndcu (%ecx,%eax,1),%bnd0",},
{{0xf2, 0x0f, 0x1a, 0x04, 0x05, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"f2 0f 1a 04 05 78 56 34 12 \tbndcu 0x12345678(,%eax,1),%bnd0",},
{{0xf2, 0x0f, 0x1a, 0x04, 0x08, }, 5, 0, "", "",
"f2 0f 1a 04 08 \tbndcu (%eax,%ecx,1),%bnd0",},
{{0xf2, 0x0f, 0x1a, 0x04, 0xc8, }, 5, 0, "", "",
"f2 0f 1a 04 c8 \tbndcu (%eax,%ecx,8),%bnd0",},
{{0xf2, 0x0f, 0x1a, 0x40, 0x12, }, 5, 0, "", "",
"f2 0f 1a 40 12 \tbndcu 0x12(%eax),%bnd0",},
{{0xf2, 0x0f, 0x1a, 0x45, 0x12, }, 5, 0, "", "",
"f2 0f 1a 45 12 \tbndcu 0x12(%ebp),%bnd0",},
{{0xf2, 0x0f, 0x1a, 0x44, 0x01, 0x12, }, 6, 0, "", "",
"f2 0f 1a 44 01 12 \tbndcu 0x12(%ecx,%eax,1),%bnd0",},
{{0xf2, 0x0f, 0x1a, 0x44, 0x05, 0x12, }, 6, 0, "", "",
"f2 0f 1a 44 05 12 \tbndcu 0x12(%ebp,%eax,1),%bnd0",},
{{0xf2, 0x0f, 0x1a, 0x44, 0x08, 0x12, }, 6, 0, "", "",
"f2 0f 1a 44 08 12 \tbndcu 0x12(%eax,%ecx,1),%bnd0",},
{{0xf2, 0x0f, 0x1a, 0x44, 0xc8, 0x12, }, 6, 0, "", "",
"f2 0f 1a 44 c8 12 \tbndcu 0x12(%eax,%ecx,8),%bnd0",},
{{0xf2, 0x0f, 0x1a, 0x80, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"f2 0f 1a 80 78 56 34 12 \tbndcu 0x12345678(%eax),%bnd0",},
{{0xf2, 0x0f, 0x1a, 0x85, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"f2 0f 1a 85 78 56 34 12 \tbndcu 0x12345678(%ebp),%bnd0",},
{{0xf2, 0x0f, 0x1a, 0x84, 0x01, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"f2 0f 1a 84 01 78 56 34 12 \tbndcu 0x12345678(%ecx,%eax,1),%bnd0",},
{{0xf2, 0x0f, 0x1a, 0x84, 0x05, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"f2 0f 1a 84 05 78 56 34 12 \tbndcu 0x12345678(%ebp,%eax,1),%bnd0",},
{{0xf2, 0x0f, 0x1a, 0x84, 0x08, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"f2 0f 1a 84 08 78 56 34 12 \tbndcu 0x12345678(%eax,%ecx,1),%bnd0",},
{{0xf2, 0x0f, 0x1a, 0x84, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"f2 0f 1a 84 c8 78 56 34 12 \tbndcu 0x12345678(%eax,%ecx,8),%bnd0",},
{{0xf2, 0x0f, 0x1a, 0xc0, }, 4, 0, "", "",
"f2 0f 1a c0 \tbndcu %eax,%bnd0",},
{{0xf2, 0x0f, 0x1b, 0x00, }, 4, 0, "", "",
"f2 0f 1b 00 \tbndcn (%eax),%bnd0",},
{{0xf2, 0x0f, 0x1b, 0x05, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"f2 0f 1b 05 78 56 34 12 \tbndcn 0x12345678,%bnd0",},
{{0xf2, 0x0f, 0x1b, 0x18, }, 4, 0, "", "",
"f2 0f 1b 18 \tbndcn (%eax),%bnd3",},
{{0xf2, 0x0f, 0x1b, 0x04, 0x01, }, 5, 0, "", "",
"f2 0f 1b 04 01 \tbndcn (%ecx,%eax,1),%bnd0",},
{{0xf2, 0x0f, 0x1b, 0x04, 0x05, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"f2 0f 1b 04 05 78 56 34 12 \tbndcn 0x12345678(,%eax,1),%bnd0",},
{{0xf2, 0x0f, 0x1b, 0x04, 0x08, }, 5, 0, "", "",
"f2 0f 1b 04 08 \tbndcn (%eax,%ecx,1),%bnd0",},
{{0xf2, 0x0f, 0x1b, 0x04, 0xc8, }, 5, 0, "", "",
"f2 0f 1b 04 c8 \tbndcn (%eax,%ecx,8),%bnd0",},
{{0xf2, 0x0f, 0x1b, 0x40, 0x12, }, 5, 0, "", "",
"f2 0f 1b 40 12 \tbndcn 0x12(%eax),%bnd0",},
{{0xf2, 0x0f, 0x1b, 0x45, 0x12, }, 5, 0, "", "",
"f2 0f 1b 45 12 \tbndcn 0x12(%ebp),%bnd0",},
{{0xf2, 0x0f, 0x1b, 0x44, 0x01, 0x12, }, 6, 0, "", "",
"f2 0f 1b 44 01 12 \tbndcn 0x12(%ecx,%eax,1),%bnd0",},
{{0xf2, 0x0f, 0x1b, 0x44, 0x05, 0x12, }, 6, 0, "", "",
"f2 0f 1b 44 05 12 \tbndcn 0x12(%ebp,%eax,1),%bnd0",},
{{0xf2, 0x0f, 0x1b, 0x44, 0x08, 0x12, }, 6, 0, "", "",
"f2 0f 1b 44 08 12 \tbndcn 0x12(%eax,%ecx,1),%bnd0",},
{{0xf2, 0x0f, 0x1b, 0x44, 0xc8, 0x12, }, 6, 0, "", "",
"f2 0f 1b 44 c8 12 \tbndcn 0x12(%eax,%ecx,8),%bnd0",},
{{0xf2, 0x0f, 0x1b, 0x80, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"f2 0f 1b 80 78 56 34 12 \tbndcn 0x12345678(%eax),%bnd0",},
{{0xf2, 0x0f, 0x1b, 0x85, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"f2 0f 1b 85 78 56 34 12 \tbndcn 0x12345678(%ebp),%bnd0",},
{{0xf2, 0x0f, 0x1b, 0x84, 0x01, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"f2 0f 1b 84 01 78 56 34 12 \tbndcn 0x12345678(%ecx,%eax,1),%bnd0",},
{{0xf2, 0x0f, 0x1b, 0x84, 0x05, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"f2 0f 1b 84 05 78 56 34 12 \tbndcn 0x12345678(%ebp,%eax,1),%bnd0",},
{{0xf2, 0x0f, 0x1b, 0x84, 0x08, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"f2 0f 1b 84 08 78 56 34 12 \tbndcn 0x12345678(%eax,%ecx,1),%bnd0",},
{{0xf2, 0x0f, 0x1b, 0x84, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"f2 0f 1b 84 c8 78 56 34 12 \tbndcn 0x12345678(%eax,%ecx,8),%bnd0",},
{{0xf2, 0x0f, 0x1b, 0xc0, }, 4, 0, "", "",
"f2 0f 1b c0 \tbndcn %eax,%bnd0",},
{{0x66, 0x0f, 0x1a, 0x00, }, 4, 0, "", "",
"66 0f 1a 00 \tbndmov (%eax),%bnd0",},
{{0x66, 0x0f, 0x1a, 0x05, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"66 0f 1a 05 78 56 34 12 \tbndmov 0x12345678,%bnd0",},
{{0x66, 0x0f, 0x1a, 0x18, }, 4, 0, "", "",
"66 0f 1a 18 \tbndmov (%eax),%bnd3",},
{{0x66, 0x0f, 0x1a, 0x04, 0x01, }, 5, 0, "", "",
"66 0f 1a 04 01 \tbndmov (%ecx,%eax,1),%bnd0",},
{{0x66, 0x0f, 0x1a, 0x04, 0x05, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"66 0f 1a 04 05 78 56 34 12 \tbndmov 0x12345678(,%eax,1),%bnd0",},
{{0x66, 0x0f, 0x1a, 0x04, 0x08, }, 5, 0, "", "",
"66 0f 1a 04 08 \tbndmov (%eax,%ecx,1),%bnd0",},
{{0x66, 0x0f, 0x1a, 0x04, 0xc8, }, 5, 0, "", "",
"66 0f 1a 04 c8 \tbndmov (%eax,%ecx,8),%bnd0",},
{{0x66, 0x0f, 0x1a, 0x40, 0x12, }, 5, 0, "", "",
"66 0f 1a 40 12 \tbndmov 0x12(%eax),%bnd0",},
{{0x66, 0x0f, 0x1a, 0x45, 0x12, }, 5, 0, "", "",
"66 0f 1a 45 12 \tbndmov 0x12(%ebp),%bnd0",},
{{0x66, 0x0f, 0x1a, 0x44, 0x01, 0x12, }, 6, 0, "", "",
"66 0f 1a 44 01 12 \tbndmov 0x12(%ecx,%eax,1),%bnd0",},
{{0x66, 0x0f, 0x1a, 0x44, 0x05, 0x12, }, 6, 0, "", "",
"66 0f 1a 44 05 12 \tbndmov 0x12(%ebp,%eax,1),%bnd0",},
{{0x66, 0x0f, 0x1a, 0x44, 0x08, 0x12, }, 6, 0, "", "",
"66 0f 1a 44 08 12 \tbndmov 0x12(%eax,%ecx,1),%bnd0",},
{{0x66, 0x0f, 0x1a, 0x44, 0xc8, 0x12, }, 6, 0, "", "",
"66 0f 1a 44 c8 12 \tbndmov 0x12(%eax,%ecx,8),%bnd0",},
{{0x66, 0x0f, 0x1a, 0x80, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"66 0f 1a 80 78 56 34 12 \tbndmov 0x12345678(%eax),%bnd0",},
{{0x66, 0x0f, 0x1a, 0x85, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"66 0f 1a 85 78 56 34 12 \tbndmov 0x12345678(%ebp),%bnd0",},
{{0x66, 0x0f, 0x1a, 0x84, 0x01, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"66 0f 1a 84 01 78 56 34 12 \tbndmov 0x12345678(%ecx,%eax,1),%bnd0",},
{{0x66, 0x0f, 0x1a, 0x84, 0x05, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"66 0f 1a 84 05 78 56 34 12 \tbndmov 0x12345678(%ebp,%eax,1),%bnd0",},
{{0x66, 0x0f, 0x1a, 0x84, 0x08, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"66 0f 1a 84 08 78 56 34 12 \tbndmov 0x12345678(%eax,%ecx,1),%bnd0",},
{{0x66, 0x0f, 0x1a, 0x84, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"66 0f 1a 84 c8 78 56 34 12 \tbndmov 0x12345678(%eax,%ecx,8),%bnd0",},
{{0x66, 0x0f, 0x1b, 0x00, }, 4, 0, "", "",
"66 0f 1b 00 \tbndmov %bnd0,(%eax)",},
{{0x66, 0x0f, 0x1b, 0x05, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"66 0f 1b 05 78 56 34 12 \tbndmov %bnd0,0x12345678",},
{{0x66, 0x0f, 0x1b, 0x18, }, 4, 0, "", "",
"66 0f 1b 18 \tbndmov %bnd3,(%eax)",},
{{0x66, 0x0f, 0x1b, 0x04, 0x01, }, 5, 0, "", "",
"66 0f 1b 04 01 \tbndmov %bnd0,(%ecx,%eax,1)",},
{{0x66, 0x0f, 0x1b, 0x04, 0x05, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"66 0f 1b 04 05 78 56 34 12 \tbndmov %bnd0,0x12345678(,%eax,1)",},
{{0x66, 0x0f, 0x1b, 0x04, 0x08, }, 5, 0, "", "",
"66 0f 1b 04 08 \tbndmov %bnd0,(%eax,%ecx,1)",},
{{0x66, 0x0f, 0x1b, 0x04, 0xc8, }, 5, 0, "", "",
"66 0f 1b 04 c8 \tbndmov %bnd0,(%eax,%ecx,8)",},
{{0x66, 0x0f, 0x1b, 0x40, 0x12, }, 5, 0, "", "",
"66 0f 1b 40 12 \tbndmov %bnd0,0x12(%eax)",},
{{0x66, 0x0f, 0x1b, 0x45, 0x12, }, 5, 0, "", "",
"66 0f 1b 45 12 \tbndmov %bnd0,0x12(%ebp)",},
{{0x66, 0x0f, 0x1b, 0x44, 0x01, 0x12, }, 6, 0, "", "",
"66 0f 1b 44 01 12 \tbndmov %bnd0,0x12(%ecx,%eax,1)",},
{{0x66, 0x0f, 0x1b, 0x44, 0x05, 0x12, }, 6, 0, "", "",
"66 0f 1b 44 05 12 \tbndmov %bnd0,0x12(%ebp,%eax,1)",},
{{0x66, 0x0f, 0x1b, 0x44, 0x08, 0x12, }, 6, 0, "", "",
"66 0f 1b 44 08 12 \tbndmov %bnd0,0x12(%eax,%ecx,1)",},
{{0x66, 0x0f, 0x1b, 0x44, 0xc8, 0x12, }, 6, 0, "", "",
"66 0f 1b 44 c8 12 \tbndmov %bnd0,0x12(%eax,%ecx,8)",},
{{0x66, 0x0f, 0x1b, 0x80, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"66 0f 1b 80 78 56 34 12 \tbndmov %bnd0,0x12345678(%eax)",},
{{0x66, 0x0f, 0x1b, 0x85, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"66 0f 1b 85 78 56 34 12 \tbndmov %bnd0,0x12345678(%ebp)",},
{{0x66, 0x0f, 0x1b, 0x84, 0x01, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"66 0f 1b 84 01 78 56 34 12 \tbndmov %bnd0,0x12345678(%ecx,%eax,1)",},
{{0x66, 0x0f, 0x1b, 0x84, 0x05, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"66 0f 1b 84 05 78 56 34 12 \tbndmov %bnd0,0x12345678(%ebp,%eax,1)",},
{{0x66, 0x0f, 0x1b, 0x84, 0x08, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"66 0f 1b 84 08 78 56 34 12 \tbndmov %bnd0,0x12345678(%eax,%ecx,1)",},
{{0x66, 0x0f, 0x1b, 0x84, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"66 0f 1b 84 c8 78 56 34 12 \tbndmov %bnd0,0x12345678(%eax,%ecx,8)",},
{{0x66, 0x0f, 0x1a, 0xc8, }, 4, 0, "", "",
"66 0f 1a c8 \tbndmov %bnd0,%bnd1",},
{{0x66, 0x0f, 0x1a, 0xc1, }, 4, 0, "", "",
"66 0f 1a c1 \tbndmov %bnd1,%bnd0",},
{{0x0f, 0x1a, 0x00, }, 3, 0, "", "",
"0f 1a 00 \tbndldx (%eax),%bnd0",},
{{0x0f, 0x1a, 0x05, 0x78, 0x56, 0x34, 0x12, }, 7, 0, "", "",
"0f 1a 05 78 56 34 12 \tbndldx 0x12345678,%bnd0",},
{{0x0f, 0x1a, 0x18, }, 3, 0, "", "",
"0f 1a 18 \tbndldx (%eax),%bnd3",},
{{0x0f, 0x1a, 0x04, 0x01, }, 4, 0, "", "",
"0f 1a 04 01 \tbndldx (%ecx,%eax,1),%bnd0",},
{{0x0f, 0x1a, 0x04, 0x05, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f 1a 04 05 78 56 34 12 \tbndldx 0x12345678(,%eax,1),%bnd0",},
{{0x0f, 0x1a, 0x04, 0x08, }, 4, 0, "", "",
"0f 1a 04 08 \tbndldx (%eax,%ecx,1),%bnd0",},
{{0x0f, 0x1a, 0x40, 0x12, }, 4, 0, "", "",
"0f 1a 40 12 \tbndldx 0x12(%eax),%bnd0",},
{{0x0f, 0x1a, 0x45, 0x12, }, 4, 0, "", "",
"0f 1a 45 12 \tbndldx 0x12(%ebp),%bnd0",},
{{0x0f, 0x1a, 0x44, 0x01, 0x12, }, 5, 0, "", "",
"0f 1a 44 01 12 \tbndldx 0x12(%ecx,%eax,1),%bnd0",},
{{0x0f, 0x1a, 0x44, 0x05, 0x12, }, 5, 0, "", "",
"0f 1a 44 05 12 \tbndldx 0x12(%ebp,%eax,1),%bnd0",},
{{0x0f, 0x1a, 0x44, 0x08, 0x12, }, 5, 0, "", "",
"0f 1a 44 08 12 \tbndldx 0x12(%eax,%ecx,1),%bnd0",},
{{0x0f, 0x1a, 0x80, 0x78, 0x56, 0x34, 0x12, }, 7, 0, "", "",
"0f 1a 80 78 56 34 12 \tbndldx 0x12345678(%eax),%bnd0",},
{{0x0f, 0x1a, 0x85, 0x78, 0x56, 0x34, 0x12, }, 7, 0, "", "",
"0f 1a 85 78 56 34 12 \tbndldx 0x12345678(%ebp),%bnd0",},
{{0x0f, 0x1a, 0x84, 0x01, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f 1a 84 01 78 56 34 12 \tbndldx 0x12345678(%ecx,%eax,1),%bnd0",},
{{0x0f, 0x1a, 0x84, 0x05, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f 1a 84 05 78 56 34 12 \tbndldx 0x12345678(%ebp,%eax,1),%bnd0",},
{{0x0f, 0x1a, 0x84, 0x08, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f 1a 84 08 78 56 34 12 \tbndldx 0x12345678(%eax,%ecx,1),%bnd0",},
{{0x0f, 0x1b, 0x00, }, 3, 0, "", "",
"0f 1b 00 \tbndstx %bnd0,(%eax)",},
{{0x0f, 0x1b, 0x05, 0x78, 0x56, 0x34, 0x12, }, 7, 0, "", "",
"0f 1b 05 78 56 34 12 \tbndstx %bnd0,0x12345678",},
{{0x0f, 0x1b, 0x18, }, 3, 0, "", "",
"0f 1b 18 \tbndstx %bnd3,(%eax)",},
{{0x0f, 0x1b, 0x04, 0x01, }, 4, 0, "", "",
"0f 1b 04 01 \tbndstx %bnd0,(%ecx,%eax,1)",},
{{0x0f, 0x1b, 0x04, 0x05, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f 1b 04 05 78 56 34 12 \tbndstx %bnd0,0x12345678(,%eax,1)",},
{{0x0f, 0x1b, 0x04, 0x08, }, 4, 0, "", "",
"0f 1b 04 08 \tbndstx %bnd0,(%eax,%ecx,1)",},
{{0x0f, 0x1b, 0x40, 0x12, }, 4, 0, "", "",
"0f 1b 40 12 \tbndstx %bnd0,0x12(%eax)",},
{{0x0f, 0x1b, 0x45, 0x12, }, 4, 0, "", "",
"0f 1b 45 12 \tbndstx %bnd0,0x12(%ebp)",},
{{0x0f, 0x1b, 0x44, 0x01, 0x12, }, 5, 0, "", "",
"0f 1b 44 01 12 \tbndstx %bnd0,0x12(%ecx,%eax,1)",},
{{0x0f, 0x1b, 0x44, 0x05, 0x12, }, 5, 0, "", "",
"0f 1b 44 05 12 \tbndstx %bnd0,0x12(%ebp,%eax,1)",},
{{0x0f, 0x1b, 0x44, 0x08, 0x12, }, 5, 0, "", "",
"0f 1b 44 08 12 \tbndstx %bnd0,0x12(%eax,%ecx,1)",},
{{0x0f, 0x1b, 0x80, 0x78, 0x56, 0x34, 0x12, }, 7, 0, "", "",
"0f 1b 80 78 56 34 12 \tbndstx %bnd0,0x12345678(%eax)",},
{{0x0f, 0x1b, 0x85, 0x78, 0x56, 0x34, 0x12, }, 7, 0, "", "",
"0f 1b 85 78 56 34 12 \tbndstx %bnd0,0x12345678(%ebp)",},
{{0x0f, 0x1b, 0x84, 0x01, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f 1b 84 01 78 56 34 12 \tbndstx %bnd0,0x12345678(%ecx,%eax,1)",},
{{0x0f, 0x1b, 0x84, 0x05, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f 1b 84 05 78 56 34 12 \tbndstx %bnd0,0x12345678(%ebp,%eax,1)",},
{{0x0f, 0x1b, 0x84, 0x08, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f 1b 84 08 78 56 34 12 \tbndstx %bnd0,0x12345678(%eax,%ecx,1)",},
{{0xf2, 0xe8, 0xfc, 0xff, 0xff, 0xff, }, 6, 0xfffffffc, "call", "unconditional",
"f2 e8 fc ff ff ff \tbnd call 3c3 <main+0x3c3>",},
{{0xf2, 0xff, 0x10, }, 3, 0, "call", "indirect",
"f2 ff 10 \tbnd call *(%eax)",},
{{0xf2, 0xc3, }, 2, 0, "ret", "indirect",
"f2 c3 \tbnd ret ",},
{{0xf2, 0xe9, 0xfc, 0xff, 0xff, 0xff, }, 6, 0xfffffffc, "jmp", "unconditional",
"f2 e9 fc ff ff ff \tbnd jmp 3ce <main+0x3ce>",},
{{0xf2, 0xe9, 0xfc, 0xff, 0xff, 0xff, }, 6, 0xfffffffc, "jmp", "unconditional",
"f2 e9 fc ff ff ff \tbnd jmp 3d4 <main+0x3d4>",},
{{0xf2, 0xff, 0x21, }, 3, 0, "jmp", "indirect",
"f2 ff 21 \tbnd jmp *(%ecx)",},
{{0xf2, 0x0f, 0x85, 0xfc, 0xff, 0xff, 0xff, }, 7, 0xfffffffc, "jcc", "conditional",
"f2 0f 85 fc ff ff ff \tbnd jne 3de <main+0x3de>",},
{{0x0f, 0x3a, 0xcc, 0xc1, 0x00, }, 5, 0, "", "",
"0f 3a cc c1 00 \tsha1rnds4 $0x0,%xmm1,%xmm0",},
{{0x0f, 0x3a, 0xcc, 0xd7, 0x91, }, 5, 0, "", "",
"0f 3a cc d7 91 \tsha1rnds4 $0x91,%xmm7,%xmm2",},
{{0x0f, 0x3a, 0xcc, 0x00, 0x91, }, 5, 0, "", "",
"0f 3a cc 00 91 \tsha1rnds4 $0x91,(%eax),%xmm0",},
{{0x0f, 0x3a, 0xcc, 0x05, 0x78, 0x56, 0x34, 0x12, 0x91, }, 9, 0, "", "",
"0f 3a cc 05 78 56 34 12 91 \tsha1rnds4 $0x91,0x12345678,%xmm0",},
{{0x0f, 0x3a, 0xcc, 0x18, 0x91, }, 5, 0, "", "",
"0f 3a cc 18 91 \tsha1rnds4 $0x91,(%eax),%xmm3",},
{{0x0f, 0x3a, 0xcc, 0x04, 0x01, 0x91, }, 6, 0, "", "",
"0f 3a cc 04 01 91 \tsha1rnds4 $0x91,(%ecx,%eax,1),%xmm0",},
{{0x0f, 0x3a, 0xcc, 0x04, 0x05, 0x78, 0x56, 0x34, 0x12, 0x91, }, 10, 0, "", "",
"0f 3a cc 04 05 78 56 34 12 91 \tsha1rnds4 $0x91,0x12345678(,%eax,1),%xmm0",},
{{0x0f, 0x3a, 0xcc, 0x04, 0x08, 0x91, }, 6, 0, "", "",
"0f 3a cc 04 08 91 \tsha1rnds4 $0x91,(%eax,%ecx,1),%xmm0",},
{{0x0f, 0x3a, 0xcc, 0x04, 0xc8, 0x91, }, 6, 0, "", "",
"0f 3a cc 04 c8 91 \tsha1rnds4 $0x91,(%eax,%ecx,8),%xmm0",},
{{0x0f, 0x3a, 0xcc, 0x40, 0x12, 0x91, }, 6, 0, "", "",
"0f 3a cc 40 12 91 \tsha1rnds4 $0x91,0x12(%eax),%xmm0",},
{{0x0f, 0x3a, 0xcc, 0x45, 0x12, 0x91, }, 6, 0, "", "",
"0f 3a cc 45 12 91 \tsha1rnds4 $0x91,0x12(%ebp),%xmm0",},
{{0x0f, 0x3a, 0xcc, 0x44, 0x01, 0x12, 0x91, }, 7, 0, "", "",
"0f 3a cc 44 01 12 91 \tsha1rnds4 $0x91,0x12(%ecx,%eax,1),%xmm0",},
{{0x0f, 0x3a, 0xcc, 0x44, 0x05, 0x12, 0x91, }, 7, 0, "", "",
"0f 3a cc 44 05 12 91 \tsha1rnds4 $0x91,0x12(%ebp,%eax,1),%xmm0",},
{{0x0f, 0x3a, 0xcc, 0x44, 0x08, 0x12, 0x91, }, 7, 0, "", "",
"0f 3a cc 44 08 12 91 \tsha1rnds4 $0x91,0x12(%eax,%ecx,1),%xmm0",},
{{0x0f, 0x3a, 0xcc, 0x44, 0xc8, 0x12, 0x91, }, 7, 0, "", "",
"0f 3a cc 44 c8 12 91 \tsha1rnds4 $0x91,0x12(%eax,%ecx,8),%xmm0",},
{{0x0f, 0x3a, 0xcc, 0x80, 0x78, 0x56, 0x34, 0x12, 0x91, }, 9, 0, "", "",
"0f 3a cc 80 78 56 34 12 91 \tsha1rnds4 $0x91,0x12345678(%eax),%xmm0",},
{{0x0f, 0x3a, 0xcc, 0x85, 0x78, 0x56, 0x34, 0x12, 0x91, }, 9, 0, "", "",
"0f 3a cc 85 78 56 34 12 91 \tsha1rnds4 $0x91,0x12345678(%ebp),%xmm0",},
{{0x0f, 0x3a, 0xcc, 0x84, 0x01, 0x78, 0x56, 0x34, 0x12, 0x91, }, 10, 0, "", "",
"0f 3a cc 84 01 78 56 34 12 91 \tsha1rnds4 $0x91,0x12345678(%ecx,%eax,1),%xmm0",},
{{0x0f, 0x3a, 0xcc, 0x84, 0x05, 0x78, 0x56, 0x34, 0x12, 0x91, }, 10, 0, "", "",
"0f 3a cc 84 05 78 56 34 12 91 \tsha1rnds4 $0x91,0x12345678(%ebp,%eax,1),%xmm0",},
{{0x0f, 0x3a, 0xcc, 0x84, 0x08, 0x78, 0x56, 0x34, 0x12, 0x91, }, 10, 0, "", "",
"0f 3a cc 84 08 78 56 34 12 91 \tsha1rnds4 $0x91,0x12345678(%eax,%ecx,1),%xmm0",},
{{0x0f, 0x3a, 0xcc, 0x84, 0xc8, 0x78, 0x56, 0x34, 0x12, 0x91, }, 10, 0, "", "",
"0f 3a cc 84 c8 78 56 34 12 91 \tsha1rnds4 $0x91,0x12345678(%eax,%ecx,8),%xmm0",},
{{0x0f, 0x38, 0xc8, 0xc1, }, 4, 0, "", "",
"0f 38 c8 c1 \tsha1nexte %xmm1,%xmm0",},
{{0x0f, 0x38, 0xc8, 0xd7, }, 4, 0, "", "",
"0f 38 c8 d7 \tsha1nexte %xmm7,%xmm2",},
{{0x0f, 0x38, 0xc8, 0x00, }, 4, 0, "", "",
"0f 38 c8 00 \tsha1nexte (%eax),%xmm0",},
{{0x0f, 0x38, 0xc8, 0x05, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f 38 c8 05 78 56 34 12 \tsha1nexte 0x12345678,%xmm0",},
{{0x0f, 0x38, 0xc8, 0x18, }, 4, 0, "", "",
"0f 38 c8 18 \tsha1nexte (%eax),%xmm3",},
{{0x0f, 0x38, 0xc8, 0x04, 0x01, }, 5, 0, "", "",
"0f 38 c8 04 01 \tsha1nexte (%ecx,%eax,1),%xmm0",},
{{0x0f, 0x38, 0xc8, 0x04, 0x05, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 c8 04 05 78 56 34 12 \tsha1nexte 0x12345678(,%eax,1),%xmm0",},
{{0x0f, 0x38, 0xc8, 0x04, 0x08, }, 5, 0, "", "",
"0f 38 c8 04 08 \tsha1nexte (%eax,%ecx,1),%xmm0",},
{{0x0f, 0x38, 0xc8, 0x04, 0xc8, }, 5, 0, "", "",
"0f 38 c8 04 c8 \tsha1nexte (%eax,%ecx,8),%xmm0",},
{{0x0f, 0x38, 0xc8, 0x40, 0x12, }, 5, 0, "", "",
"0f 38 c8 40 12 \tsha1nexte 0x12(%eax),%xmm0",},
{{0x0f, 0x38, 0xc8, 0x45, 0x12, }, 5, 0, "", "",
"0f 38 c8 45 12 \tsha1nexte 0x12(%ebp),%xmm0",},
{{0x0f, 0x38, 0xc8, 0x44, 0x01, 0x12, }, 6, 0, "", "",
"0f 38 c8 44 01 12 \tsha1nexte 0x12(%ecx,%eax,1),%xmm0",},
{{0x0f, 0x38, 0xc8, 0x44, 0x05, 0x12, }, 6, 0, "", "",
"0f 38 c8 44 05 12 \tsha1nexte 0x12(%ebp,%eax,1),%xmm0",},
{{0x0f, 0x38, 0xc8, 0x44, 0x08, 0x12, }, 6, 0, "", "",
"0f 38 c8 44 08 12 \tsha1nexte 0x12(%eax,%ecx,1),%xmm0",},
{{0x0f, 0x38, 0xc8, 0x44, 0xc8, 0x12, }, 6, 0, "", "",
"0f 38 c8 44 c8 12 \tsha1nexte 0x12(%eax,%ecx,8),%xmm0",},
{{0x0f, 0x38, 0xc8, 0x80, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f 38 c8 80 78 56 34 12 \tsha1nexte 0x12345678(%eax),%xmm0",},
{{0x0f, 0x38, 0xc8, 0x85, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f 38 c8 85 78 56 34 12 \tsha1nexte 0x12345678(%ebp),%xmm0",},
{{0x0f, 0x38, 0xc8, 0x84, 0x01, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 c8 84 01 78 56 34 12 \tsha1nexte 0x12345678(%ecx,%eax,1),%xmm0",},
{{0x0f, 0x38, 0xc8, 0x84, 0x05, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 c8 84 05 78 56 34 12 \tsha1nexte 0x12345678(%ebp,%eax,1),%xmm0",},
{{0x0f, 0x38, 0xc8, 0x84, 0x08, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 c8 84 08 78 56 34 12 \tsha1nexte 0x12345678(%eax,%ecx,1),%xmm0",},
{{0x0f, 0x38, 0xc8, 0x84, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 c8 84 c8 78 56 34 12 \tsha1nexte 0x12345678(%eax,%ecx,8),%xmm0",},
{{0x0f, 0x38, 0xc9, 0xc1, }, 4, 0, "", "",
"0f 38 c9 c1 \tsha1msg1 %xmm1,%xmm0",},
{{0x0f, 0x38, 0xc9, 0xd7, }, 4, 0, "", "",
"0f 38 c9 d7 \tsha1msg1 %xmm7,%xmm2",},
{{0x0f, 0x38, 0xc9, 0x00, }, 4, 0, "", "",
"0f 38 c9 00 \tsha1msg1 (%eax),%xmm0",},
{{0x0f, 0x38, 0xc9, 0x05, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f 38 c9 05 78 56 34 12 \tsha1msg1 0x12345678,%xmm0",},
{{0x0f, 0x38, 0xc9, 0x18, }, 4, 0, "", "",
"0f 38 c9 18 \tsha1msg1 (%eax),%xmm3",},
{{0x0f, 0x38, 0xc9, 0x04, 0x01, }, 5, 0, "", "",
"0f 38 c9 04 01 \tsha1msg1 (%ecx,%eax,1),%xmm0",},
{{0x0f, 0x38, 0xc9, 0x04, 0x05, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 c9 04 05 78 56 34 12 \tsha1msg1 0x12345678(,%eax,1),%xmm0",},
{{0x0f, 0x38, 0xc9, 0x04, 0x08, }, 5, 0, "", "",
"0f 38 c9 04 08 \tsha1msg1 (%eax,%ecx,1),%xmm0",},
{{0x0f, 0x38, 0xc9, 0x04, 0xc8, }, 5, 0, "", "",
"0f 38 c9 04 c8 \tsha1msg1 (%eax,%ecx,8),%xmm0",},
{{0x0f, 0x38, 0xc9, 0x40, 0x12, }, 5, 0, "", "",
"0f 38 c9 40 12 \tsha1msg1 0x12(%eax),%xmm0",},
{{0x0f, 0x38, 0xc9, 0x45, 0x12, }, 5, 0, "", "",
"0f 38 c9 45 12 \tsha1msg1 0x12(%ebp),%xmm0",},
{{0x0f, 0x38, 0xc9, 0x44, 0x01, 0x12, }, 6, 0, "", "",
"0f 38 c9 44 01 12 \tsha1msg1 0x12(%ecx,%eax,1),%xmm0",},
{{0x0f, 0x38, 0xc9, 0x44, 0x05, 0x12, }, 6, 0, "", "",
"0f 38 c9 44 05 12 \tsha1msg1 0x12(%ebp,%eax,1),%xmm0",},
{{0x0f, 0x38, 0xc9, 0x44, 0x08, 0x12, }, 6, 0, "", "",
"0f 38 c9 44 08 12 \tsha1msg1 0x12(%eax,%ecx,1),%xmm0",},
{{0x0f, 0x38, 0xc9, 0x44, 0xc8, 0x12, }, 6, 0, "", "",
"0f 38 c9 44 c8 12 \tsha1msg1 0x12(%eax,%ecx,8),%xmm0",},
{{0x0f, 0x38, 0xc9, 0x80, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f 38 c9 80 78 56 34 12 \tsha1msg1 0x12345678(%eax),%xmm0",},
{{0x0f, 0x38, 0xc9, 0x85, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f 38 c9 85 78 56 34 12 \tsha1msg1 0x12345678(%ebp),%xmm0",},
{{0x0f, 0x38, 0xc9, 0x84, 0x01, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 c9 84 01 78 56 34 12 \tsha1msg1 0x12345678(%ecx,%eax,1),%xmm0",},
{{0x0f, 0x38, 0xc9, 0x84, 0x05, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 c9 84 05 78 56 34 12 \tsha1msg1 0x12345678(%ebp,%eax,1),%xmm0",},
{{0x0f, 0x38, 0xc9, 0x84, 0x08, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 c9 84 08 78 56 34 12 \tsha1msg1 0x12345678(%eax,%ecx,1),%xmm0",},
{{0x0f, 0x38, 0xc9, 0x84, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 c9 84 c8 78 56 34 12 \tsha1msg1 0x12345678(%eax,%ecx,8),%xmm0",},
{{0x0f, 0x38, 0xca, 0xc1, }, 4, 0, "", "",
"0f 38 ca c1 \tsha1msg2 %xmm1,%xmm0",},
{{0x0f, 0x38, 0xca, 0xd7, }, 4, 0, "", "",
"0f 38 ca d7 \tsha1msg2 %xmm7,%xmm2",},
{{0x0f, 0x38, 0xca, 0x00, }, 4, 0, "", "",
"0f 38 ca 00 \tsha1msg2 (%eax),%xmm0",},
{{0x0f, 0x38, 0xca, 0x05, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f 38 ca 05 78 56 34 12 \tsha1msg2 0x12345678,%xmm0",},
{{0x0f, 0x38, 0xca, 0x18, }, 4, 0, "", "",
"0f 38 ca 18 \tsha1msg2 (%eax),%xmm3",},
{{0x0f, 0x38, 0xca, 0x04, 0x01, }, 5, 0, "", "",
"0f 38 ca 04 01 \tsha1msg2 (%ecx,%eax,1),%xmm0",},
{{0x0f, 0x38, 0xca, 0x04, 0x05, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 ca 04 05 78 56 34 12 \tsha1msg2 0x12345678(,%eax,1),%xmm0",},
{{0x0f, 0x38, 0xca, 0x04, 0x08, }, 5, 0, "", "",
"0f 38 ca 04 08 \tsha1msg2 (%eax,%ecx,1),%xmm0",},
{{0x0f, 0x38, 0xca, 0x04, 0xc8, }, 5, 0, "", "",
"0f 38 ca 04 c8 \tsha1msg2 (%eax,%ecx,8),%xmm0",},
{{0x0f, 0x38, 0xca, 0x40, 0x12, }, 5, 0, "", "",
"0f 38 ca 40 12 \tsha1msg2 0x12(%eax),%xmm0",},
{{0x0f, 0x38, 0xca, 0x45, 0x12, }, 5, 0, "", "",
"0f 38 ca 45 12 \tsha1msg2 0x12(%ebp),%xmm0",},
{{0x0f, 0x38, 0xca, 0x44, 0x01, 0x12, }, 6, 0, "", "",
"0f 38 ca 44 01 12 \tsha1msg2 0x12(%ecx,%eax,1),%xmm0",},
{{0x0f, 0x38, 0xca, 0x44, 0x05, 0x12, }, 6, 0, "", "",
"0f 38 ca 44 05 12 \tsha1msg2 0x12(%ebp,%eax,1),%xmm0",},
{{0x0f, 0x38, 0xca, 0x44, 0x08, 0x12, }, 6, 0, "", "",
"0f 38 ca 44 08 12 \tsha1msg2 0x12(%eax,%ecx,1),%xmm0",},
{{0x0f, 0x38, 0xca, 0x44, 0xc8, 0x12, }, 6, 0, "", "",
"0f 38 ca 44 c8 12 \tsha1msg2 0x12(%eax,%ecx,8),%xmm0",},
{{0x0f, 0x38, 0xca, 0x80, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f 38 ca 80 78 56 34 12 \tsha1msg2 0x12345678(%eax),%xmm0",},
{{0x0f, 0x38, 0xca, 0x85, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f 38 ca 85 78 56 34 12 \tsha1msg2 0x12345678(%ebp),%xmm0",},
{{0x0f, 0x38, 0xca, 0x84, 0x01, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 ca 84 01 78 56 34 12 \tsha1msg2 0x12345678(%ecx,%eax,1),%xmm0",},
{{0x0f, 0x38, 0xca, 0x84, 0x05, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 ca 84 05 78 56 34 12 \tsha1msg2 0x12345678(%ebp,%eax,1),%xmm0",},
{{0x0f, 0x38, 0xca, 0x84, 0x08, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 ca 84 08 78 56 34 12 \tsha1msg2 0x12345678(%eax,%ecx,1),%xmm0",},
{{0x0f, 0x38, 0xca, 0x84, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 ca 84 c8 78 56 34 12 \tsha1msg2 0x12345678(%eax,%ecx,8),%xmm0",},
{{0x0f, 0x38, 0xcb, 0xcc, }, 4, 0, "", "",
"0f 38 cb cc \tsha256rnds2 %xmm0,%xmm4,%xmm1",},
{{0x0f, 0x38, 0xcb, 0xd7, }, 4, 0, "", "",
"0f 38 cb d7 \tsha256rnds2 %xmm0,%xmm7,%xmm2",},
{{0x0f, 0x38, 0xcb, 0x08, }, 4, 0, "", "",
"0f 38 cb 08 \tsha256rnds2 %xmm0,(%eax),%xmm1",},
{{0x0f, 0x38, 0xcb, 0x0d, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f 38 cb 0d 78 56 34 12 \tsha256rnds2 %xmm0,0x12345678,%xmm1",},
{{0x0f, 0x38, 0xcb, 0x18, }, 4, 0, "", "",
"0f 38 cb 18 \tsha256rnds2 %xmm0,(%eax),%xmm3",},
{{0x0f, 0x38, 0xcb, 0x0c, 0x01, }, 5, 0, "", "",
"0f 38 cb 0c 01 \tsha256rnds2 %xmm0,(%ecx,%eax,1),%xmm1",},
{{0x0f, 0x38, 0xcb, 0x0c, 0x05, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 cb 0c 05 78 56 34 12 \tsha256rnds2 %xmm0,0x12345678(,%eax,1),%xmm1",},
{{0x0f, 0x38, 0xcb, 0x0c, 0x08, }, 5, 0, "", "",
"0f 38 cb 0c 08 \tsha256rnds2 %xmm0,(%eax,%ecx,1),%xmm1",},
{{0x0f, 0x38, 0xcb, 0x0c, 0xc8, }, 5, 0, "", "",
"0f 38 cb 0c c8 \tsha256rnds2 %xmm0,(%eax,%ecx,8),%xmm1",},
{{0x0f, 0x38, 0xcb, 0x48, 0x12, }, 5, 0, "", "",
"0f 38 cb 48 12 \tsha256rnds2 %xmm0,0x12(%eax),%xmm1",},
{{0x0f, 0x38, 0xcb, 0x4d, 0x12, }, 5, 0, "", "",
"0f 38 cb 4d 12 \tsha256rnds2 %xmm0,0x12(%ebp),%xmm1",},
{{0x0f, 0x38, 0xcb, 0x4c, 0x01, 0x12, }, 6, 0, "", "",
"0f 38 cb 4c 01 12 \tsha256rnds2 %xmm0,0x12(%ecx,%eax,1),%xmm1",},
{{0x0f, 0x38, 0xcb, 0x4c, 0x05, 0x12, }, 6, 0, "", "",
"0f 38 cb 4c 05 12 \tsha256rnds2 %xmm0,0x12(%ebp,%eax,1),%xmm1",},
{{0x0f, 0x38, 0xcb, 0x4c, 0x08, 0x12, }, 6, 0, "", "",
"0f 38 cb 4c 08 12 \tsha256rnds2 %xmm0,0x12(%eax,%ecx,1),%xmm1",},
{{0x0f, 0x38, 0xcb, 0x4c, 0xc8, 0x12, }, 6, 0, "", "",
"0f 38 cb 4c c8 12 \tsha256rnds2 %xmm0,0x12(%eax,%ecx,8),%xmm1",},
{{0x0f, 0x38, 0xcb, 0x88, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f 38 cb 88 78 56 34 12 \tsha256rnds2 %xmm0,0x12345678(%eax),%xmm1",},
{{0x0f, 0x38, 0xcb, 0x8d, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f 38 cb 8d 78 56 34 12 \tsha256rnds2 %xmm0,0x12345678(%ebp),%xmm1",},
{{0x0f, 0x38, 0xcb, 0x8c, 0x01, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 cb 8c 01 78 56 34 12 \tsha256rnds2 %xmm0,0x12345678(%ecx,%eax,1),%xmm1",},
{{0x0f, 0x38, 0xcb, 0x8c, 0x05, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 cb 8c 05 78 56 34 12 \tsha256rnds2 %xmm0,0x12345678(%ebp,%eax,1),%xmm1",},
{{0x0f, 0x38, 0xcb, 0x8c, 0x08, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 cb 8c 08 78 56 34 12 \tsha256rnds2 %xmm0,0x12345678(%eax,%ecx,1),%xmm1",},
{{0x0f, 0x38, 0xcb, 0x8c, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 cb 8c c8 78 56 34 12 \tsha256rnds2 %xmm0,0x12345678(%eax,%ecx,8),%xmm1",},
{{0x0f, 0x38, 0xcc, 0xc1, }, 4, 0, "", "",
"0f 38 cc c1 \tsha256msg1 %xmm1,%xmm0",},
{{0x0f, 0x38, 0xcc, 0xd7, }, 4, 0, "", "",
"0f 38 cc d7 \tsha256msg1 %xmm7,%xmm2",},
{{0x0f, 0x38, 0xcc, 0x00, }, 4, 0, "", "",
"0f 38 cc 00 \tsha256msg1 (%eax),%xmm0",},
{{0x0f, 0x38, 0xcc, 0x05, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f 38 cc 05 78 56 34 12 \tsha256msg1 0x12345678,%xmm0",},
{{0x0f, 0x38, 0xcc, 0x18, }, 4, 0, "", "",
"0f 38 cc 18 \tsha256msg1 (%eax),%xmm3",},
{{0x0f, 0x38, 0xcc, 0x04, 0x01, }, 5, 0, "", "",
"0f 38 cc 04 01 \tsha256msg1 (%ecx,%eax,1),%xmm0",},
{{0x0f, 0x38, 0xcc, 0x04, 0x05, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 cc 04 05 78 56 34 12 \tsha256msg1 0x12345678(,%eax,1),%xmm0",},
{{0x0f, 0x38, 0xcc, 0x04, 0x08, }, 5, 0, "", "",
"0f 38 cc 04 08 \tsha256msg1 (%eax,%ecx,1),%xmm0",},
{{0x0f, 0x38, 0xcc, 0x04, 0xc8, }, 5, 0, "", "",
"0f 38 cc 04 c8 \tsha256msg1 (%eax,%ecx,8),%xmm0",},
{{0x0f, 0x38, 0xcc, 0x40, 0x12, }, 5, 0, "", "",
"0f 38 cc 40 12 \tsha256msg1 0x12(%eax),%xmm0",},
{{0x0f, 0x38, 0xcc, 0x45, 0x12, }, 5, 0, "", "",
"0f 38 cc 45 12 \tsha256msg1 0x12(%ebp),%xmm0",},
{{0x0f, 0x38, 0xcc, 0x44, 0x01, 0x12, }, 6, 0, "", "",
"0f 38 cc 44 01 12 \tsha256msg1 0x12(%ecx,%eax,1),%xmm0",},
{{0x0f, 0x38, 0xcc, 0x44, 0x05, 0x12, }, 6, 0, "", "",
"0f 38 cc 44 05 12 \tsha256msg1 0x12(%ebp,%eax,1),%xmm0",},
{{0x0f, 0x38, 0xcc, 0x44, 0x08, 0x12, }, 6, 0, "", "",
"0f 38 cc 44 08 12 \tsha256msg1 0x12(%eax,%ecx,1),%xmm0",},
{{0x0f, 0x38, 0xcc, 0x44, 0xc8, 0x12, }, 6, 0, "", "",
"0f 38 cc 44 c8 12 \tsha256msg1 0x12(%eax,%ecx,8),%xmm0",},
{{0x0f, 0x38, 0xcc, 0x80, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f 38 cc 80 78 56 34 12 \tsha256msg1 0x12345678(%eax),%xmm0",},
{{0x0f, 0x38, 0xcc, 0x85, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f 38 cc 85 78 56 34 12 \tsha256msg1 0x12345678(%ebp),%xmm0",},
{{0x0f, 0x38, 0xcc, 0x84, 0x01, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 cc 84 01 78 56 34 12 \tsha256msg1 0x12345678(%ecx,%eax,1),%xmm0",},
{{0x0f, 0x38, 0xcc, 0x84, 0x05, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 cc 84 05 78 56 34 12 \tsha256msg1 0x12345678(%ebp,%eax,1),%xmm0",},
{{0x0f, 0x38, 0xcc, 0x84, 0x08, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 cc 84 08 78 56 34 12 \tsha256msg1 0x12345678(%eax,%ecx,1),%xmm0",},
{{0x0f, 0x38, 0xcc, 0x84, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 cc 84 c8 78 56 34 12 \tsha256msg1 0x12345678(%eax,%ecx,8),%xmm0",},
{{0x0f, 0x38, 0xcd, 0xc1, }, 4, 0, "", "",
"0f 38 cd c1 \tsha256msg2 %xmm1,%xmm0",},
{{0x0f, 0x38, 0xcd, 0xd7, }, 4, 0, "", "",
"0f 38 cd d7 \tsha256msg2 %xmm7,%xmm2",},
{{0x0f, 0x38, 0xcd, 0x00, }, 4, 0, "", "",
"0f 38 cd 00 \tsha256msg2 (%eax),%xmm0",},
{{0x0f, 0x38, 0xcd, 0x05, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f 38 cd 05 78 56 34 12 \tsha256msg2 0x12345678,%xmm0",},
{{0x0f, 0x38, 0xcd, 0x18, }, 4, 0, "", "",
"0f 38 cd 18 \tsha256msg2 (%eax),%xmm3",},
{{0x0f, 0x38, 0xcd, 0x04, 0x01, }, 5, 0, "", "",
"0f 38 cd 04 01 \tsha256msg2 (%ecx,%eax,1),%xmm0",},
{{0x0f, 0x38, 0xcd, 0x04, 0x05, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 cd 04 05 78 56 34 12 \tsha256msg2 0x12345678(,%eax,1),%xmm0",},
{{0x0f, 0x38, 0xcd, 0x04, 0x08, }, 5, 0, "", "",
"0f 38 cd 04 08 \tsha256msg2 (%eax,%ecx,1),%xmm0",},
{{0x0f, 0x38, 0xcd, 0x04, 0xc8, }, 5, 0, "", "",
"0f 38 cd 04 c8 \tsha256msg2 (%eax,%ecx,8),%xmm0",},
{{0x0f, 0x38, 0xcd, 0x40, 0x12, }, 5, 0, "", "",
"0f 38 cd 40 12 \tsha256msg2 0x12(%eax),%xmm0",},
{{0x0f, 0x38, 0xcd, 0x45, 0x12, }, 5, 0, "", "",
"0f 38 cd 45 12 \tsha256msg2 0x12(%ebp),%xmm0",},
{{0x0f, 0x38, 0xcd, 0x44, 0x01, 0x12, }, 6, 0, "", "",
"0f 38 cd 44 01 12 \tsha256msg2 0x12(%ecx,%eax,1),%xmm0",},
{{0x0f, 0x38, 0xcd, 0x44, 0x05, 0x12, }, 6, 0, "", "",
"0f 38 cd 44 05 12 \tsha256msg2 0x12(%ebp,%eax,1),%xmm0",},
{{0x0f, 0x38, 0xcd, 0x44, 0x08, 0x12, }, 6, 0, "", "",
"0f 38 cd 44 08 12 \tsha256msg2 0x12(%eax,%ecx,1),%xmm0",},
{{0x0f, 0x38, 0xcd, 0x44, 0xc8, 0x12, }, 6, 0, "", "",
"0f 38 cd 44 c8 12 \tsha256msg2 0x12(%eax,%ecx,8),%xmm0",},
{{0x0f, 0x38, 0xcd, 0x80, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f 38 cd 80 78 56 34 12 \tsha256msg2 0x12345678(%eax),%xmm0",},
{{0x0f, 0x38, 0xcd, 0x85, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f 38 cd 85 78 56 34 12 \tsha256msg2 0x12345678(%ebp),%xmm0",},
{{0x0f, 0x38, 0xcd, 0x84, 0x01, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 cd 84 01 78 56 34 12 \tsha256msg2 0x12345678(%ecx,%eax,1),%xmm0",},
{{0x0f, 0x38, 0xcd, 0x84, 0x05, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 cd 84 05 78 56 34 12 \tsha256msg2 0x12345678(%ebp,%eax,1),%xmm0",},
{{0x0f, 0x38, 0xcd, 0x84, 0x08, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 cd 84 08 78 56 34 12 \tsha256msg2 0x12345678(%eax,%ecx,1),%xmm0",},
{{0x0f, 0x38, 0xcd, 0x84, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 cd 84 c8 78 56 34 12 \tsha256msg2 0x12345678(%eax,%ecx,8),%xmm0",},
{{0x66, 0x0f, 0xae, 0x38, }, 4, 0, "", "",
"66 0f ae 38 \tclflushopt (%eax)",},
{{0x66, 0x0f, 0xae, 0x3d, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"66 0f ae 3d 78 56 34 12 \tclflushopt 0x12345678",},
{{0x66, 0x0f, 0xae, 0xbc, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"66 0f ae bc c8 78 56 34 12 \tclflushopt 0x12345678(%eax,%ecx,8)",},
{{0x0f, 0xae, 0x38, }, 3, 0, "", "",
"0f ae 38 \tclflush (%eax)",},
{{0x0f, 0xae, 0xf8, }, 3, 0, "", "",
"0f ae f8 \tsfence ",},
{{0x66, 0x0f, 0xae, 0x30, }, 4, 0, "", "",
"66 0f ae 30 \tclwb (%eax)",},
{{0x66, 0x0f, 0xae, 0x35, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"66 0f ae 35 78 56 34 12 \tclwb 0x12345678",},
{{0x66, 0x0f, 0xae, 0xb4, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"66 0f ae b4 c8 78 56 34 12 \tclwb 0x12345678(%eax,%ecx,8)",},
{{0x0f, 0xae, 0x30, }, 3, 0, "", "",
"0f ae 30 \txsaveopt (%eax)",},
{{0x0f, 0xae, 0xf0, }, 3, 0, "", "",
"0f ae f0 \tmfence ",},
{{0x0f, 0xc7, 0x20, }, 3, 0, "", "",
"0f c7 20 \txsavec (%eax)",},
{{0x0f, 0xc7, 0x25, 0x78, 0x56, 0x34, 0x12, }, 7, 0, "", "",
"0f c7 25 78 56 34 12 \txsavec 0x12345678",},
{{0x0f, 0xc7, 0xa4, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f c7 a4 c8 78 56 34 12 \txsavec 0x12345678(%eax,%ecx,8)",},
{{0x0f, 0xc7, 0x28, }, 3, 0, "", "",
"0f c7 28 \txsaves (%eax)",},
{{0x0f, 0xc7, 0x2d, 0x78, 0x56, 0x34, 0x12, }, 7, 0, "", "",
"0f c7 2d 78 56 34 12 \txsaves 0x12345678",},
{{0x0f, 0xc7, 0xac, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f c7 ac c8 78 56 34 12 \txsaves 0x12345678(%eax,%ecx,8)",},
{{0x0f, 0xc7, 0x18, }, 3, 0, "", "",
"0f c7 18 \txrstors (%eax)",},
{{0x0f, 0xc7, 0x1d, 0x78, 0x56, 0x34, 0x12, }, 7, 0, "", "",
"0f c7 1d 78 56 34 12 \txrstors 0x12345678",},
{{0x0f, 0xc7, 0x9c, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f c7 9c c8 78 56 34 12 \txrstors 0x12345678(%eax,%ecx,8)",},
{{0x66, 0x0f, 0xae, 0xf8, }, 4, 0, "", "",
"66 0f ae f8 \tpcommit ",},

View File

@@ -0,0 +1,768 @@
/*
* Generated by gen-insn-x86-dat.sh and gen-insn-x86-dat.awk
* from insn-x86-dat-src.c for inclusion by insn-x86.c
* Do not change this code.
*/
{{0x0f, 0x31, }, 2, 0, "", "",
"0f 31 \trdtsc ",},
{{0xf3, 0x0f, 0x1b, 0x00, }, 4, 0, "", "",
"f3 0f 1b 00 \tbndmk (%rax),%bnd0",},
{{0xf3, 0x41, 0x0f, 0x1b, 0x00, }, 5, 0, "", "",
"f3 41 0f 1b 00 \tbndmk (%r8),%bnd0",},
{{0xf3, 0x0f, 0x1b, 0x04, 0x25, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"f3 0f 1b 04 25 78 56 34 12 \tbndmk 0x12345678,%bnd0",},
{{0xf3, 0x0f, 0x1b, 0x18, }, 4, 0, "", "",
"f3 0f 1b 18 \tbndmk (%rax),%bnd3",},
{{0xf3, 0x0f, 0x1b, 0x04, 0x01, }, 5, 0, "", "",
"f3 0f 1b 04 01 \tbndmk (%rcx,%rax,1),%bnd0",},
{{0xf3, 0x0f, 0x1b, 0x04, 0x05, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"f3 0f 1b 04 05 78 56 34 12 \tbndmk 0x12345678(,%rax,1),%bnd0",},
{{0xf3, 0x0f, 0x1b, 0x04, 0x08, }, 5, 0, "", "",
"f3 0f 1b 04 08 \tbndmk (%rax,%rcx,1),%bnd0",},
{{0xf3, 0x0f, 0x1b, 0x04, 0xc8, }, 5, 0, "", "",
"f3 0f 1b 04 c8 \tbndmk (%rax,%rcx,8),%bnd0",},
{{0xf3, 0x0f, 0x1b, 0x40, 0x12, }, 5, 0, "", "",
"f3 0f 1b 40 12 \tbndmk 0x12(%rax),%bnd0",},
{{0xf3, 0x0f, 0x1b, 0x45, 0x12, }, 5, 0, "", "",
"f3 0f 1b 45 12 \tbndmk 0x12(%rbp),%bnd0",},
{{0xf3, 0x0f, 0x1b, 0x44, 0x01, 0x12, }, 6, 0, "", "",
"f3 0f 1b 44 01 12 \tbndmk 0x12(%rcx,%rax,1),%bnd0",},
{{0xf3, 0x0f, 0x1b, 0x44, 0x05, 0x12, }, 6, 0, "", "",
"f3 0f 1b 44 05 12 \tbndmk 0x12(%rbp,%rax,1),%bnd0",},
{{0xf3, 0x0f, 0x1b, 0x44, 0x08, 0x12, }, 6, 0, "", "",
"f3 0f 1b 44 08 12 \tbndmk 0x12(%rax,%rcx,1),%bnd0",},
{{0xf3, 0x0f, 0x1b, 0x44, 0xc8, 0x12, }, 6, 0, "", "",
"f3 0f 1b 44 c8 12 \tbndmk 0x12(%rax,%rcx,8),%bnd0",},
{{0xf3, 0x0f, 0x1b, 0x80, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"f3 0f 1b 80 78 56 34 12 \tbndmk 0x12345678(%rax),%bnd0",},
{{0xf3, 0x0f, 0x1b, 0x85, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"f3 0f 1b 85 78 56 34 12 \tbndmk 0x12345678(%rbp),%bnd0",},
{{0xf3, 0x0f, 0x1b, 0x84, 0x01, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"f3 0f 1b 84 01 78 56 34 12 \tbndmk 0x12345678(%rcx,%rax,1),%bnd0",},
{{0xf3, 0x0f, 0x1b, 0x84, 0x05, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"f3 0f 1b 84 05 78 56 34 12 \tbndmk 0x12345678(%rbp,%rax,1),%bnd0",},
{{0xf3, 0x0f, 0x1b, 0x84, 0x08, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"f3 0f 1b 84 08 78 56 34 12 \tbndmk 0x12345678(%rax,%rcx,1),%bnd0",},
{{0xf3, 0x0f, 0x1b, 0x84, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"f3 0f 1b 84 c8 78 56 34 12 \tbndmk 0x12345678(%rax,%rcx,8),%bnd0",},
{{0xf3, 0x0f, 0x1a, 0x00, }, 4, 0, "", "",
"f3 0f 1a 00 \tbndcl (%rax),%bnd0",},
{{0xf3, 0x41, 0x0f, 0x1a, 0x00, }, 5, 0, "", "",
"f3 41 0f 1a 00 \tbndcl (%r8),%bnd0",},
{{0xf3, 0x0f, 0x1a, 0x04, 0x25, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"f3 0f 1a 04 25 78 56 34 12 \tbndcl 0x12345678,%bnd0",},
{{0xf3, 0x0f, 0x1a, 0x18, }, 4, 0, "", "",
"f3 0f 1a 18 \tbndcl (%rax),%bnd3",},
{{0xf3, 0x0f, 0x1a, 0x04, 0x01, }, 5, 0, "", "",
"f3 0f 1a 04 01 \tbndcl (%rcx,%rax,1),%bnd0",},
{{0xf3, 0x0f, 0x1a, 0x04, 0x05, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"f3 0f 1a 04 05 78 56 34 12 \tbndcl 0x12345678(,%rax,1),%bnd0",},
{{0xf3, 0x0f, 0x1a, 0x04, 0x08, }, 5, 0, "", "",
"f3 0f 1a 04 08 \tbndcl (%rax,%rcx,1),%bnd0",},
{{0xf3, 0x0f, 0x1a, 0x04, 0xc8, }, 5, 0, "", "",
"f3 0f 1a 04 c8 \tbndcl (%rax,%rcx,8),%bnd0",},
{{0xf3, 0x0f, 0x1a, 0x40, 0x12, }, 5, 0, "", "",
"f3 0f 1a 40 12 \tbndcl 0x12(%rax),%bnd0",},
{{0xf3, 0x0f, 0x1a, 0x45, 0x12, }, 5, 0, "", "",
"f3 0f 1a 45 12 \tbndcl 0x12(%rbp),%bnd0",},
{{0xf3, 0x0f, 0x1a, 0x44, 0x01, 0x12, }, 6, 0, "", "",
"f3 0f 1a 44 01 12 \tbndcl 0x12(%rcx,%rax,1),%bnd0",},
{{0xf3, 0x0f, 0x1a, 0x44, 0x05, 0x12, }, 6, 0, "", "",
"f3 0f 1a 44 05 12 \tbndcl 0x12(%rbp,%rax,1),%bnd0",},
{{0xf3, 0x0f, 0x1a, 0x44, 0x08, 0x12, }, 6, 0, "", "",
"f3 0f 1a 44 08 12 \tbndcl 0x12(%rax,%rcx,1),%bnd0",},
{{0xf3, 0x0f, 0x1a, 0x44, 0xc8, 0x12, }, 6, 0, "", "",
"f3 0f 1a 44 c8 12 \tbndcl 0x12(%rax,%rcx,8),%bnd0",},
{{0xf3, 0x0f, 0x1a, 0x80, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"f3 0f 1a 80 78 56 34 12 \tbndcl 0x12345678(%rax),%bnd0",},
{{0xf3, 0x0f, 0x1a, 0x85, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"f3 0f 1a 85 78 56 34 12 \tbndcl 0x12345678(%rbp),%bnd0",},
{{0xf3, 0x0f, 0x1a, 0x84, 0x01, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"f3 0f 1a 84 01 78 56 34 12 \tbndcl 0x12345678(%rcx,%rax,1),%bnd0",},
{{0xf3, 0x0f, 0x1a, 0x84, 0x05, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"f3 0f 1a 84 05 78 56 34 12 \tbndcl 0x12345678(%rbp,%rax,1),%bnd0",},
{{0xf3, 0x0f, 0x1a, 0x84, 0x08, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"f3 0f 1a 84 08 78 56 34 12 \tbndcl 0x12345678(%rax,%rcx,1),%bnd0",},
{{0xf3, 0x0f, 0x1a, 0x84, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"f3 0f 1a 84 c8 78 56 34 12 \tbndcl 0x12345678(%rax,%rcx,8),%bnd0",},
{{0xf3, 0x0f, 0x1a, 0xc0, }, 4, 0, "", "",
"f3 0f 1a c0 \tbndcl %rax,%bnd0",},
{{0xf2, 0x0f, 0x1a, 0x00, }, 4, 0, "", "",
"f2 0f 1a 00 \tbndcu (%rax),%bnd0",},
{{0xf2, 0x41, 0x0f, 0x1a, 0x00, }, 5, 0, "", "",
"f2 41 0f 1a 00 \tbndcu (%r8),%bnd0",},
{{0xf2, 0x0f, 0x1a, 0x04, 0x25, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"f2 0f 1a 04 25 78 56 34 12 \tbndcu 0x12345678,%bnd0",},
{{0xf2, 0x0f, 0x1a, 0x18, }, 4, 0, "", "",
"f2 0f 1a 18 \tbndcu (%rax),%bnd3",},
{{0xf2, 0x0f, 0x1a, 0x04, 0x01, }, 5, 0, "", "",
"f2 0f 1a 04 01 \tbndcu (%rcx,%rax,1),%bnd0",},
{{0xf2, 0x0f, 0x1a, 0x04, 0x05, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"f2 0f 1a 04 05 78 56 34 12 \tbndcu 0x12345678(,%rax,1),%bnd0",},
{{0xf2, 0x0f, 0x1a, 0x04, 0x08, }, 5, 0, "", "",
"f2 0f 1a 04 08 \tbndcu (%rax,%rcx,1),%bnd0",},
{{0xf2, 0x0f, 0x1a, 0x04, 0xc8, }, 5, 0, "", "",
"f2 0f 1a 04 c8 \tbndcu (%rax,%rcx,8),%bnd0",},
{{0xf2, 0x0f, 0x1a, 0x40, 0x12, }, 5, 0, "", "",
"f2 0f 1a 40 12 \tbndcu 0x12(%rax),%bnd0",},
{{0xf2, 0x0f, 0x1a, 0x45, 0x12, }, 5, 0, "", "",
"f2 0f 1a 45 12 \tbndcu 0x12(%rbp),%bnd0",},
{{0xf2, 0x0f, 0x1a, 0x44, 0x01, 0x12, }, 6, 0, "", "",
"f2 0f 1a 44 01 12 \tbndcu 0x12(%rcx,%rax,1),%bnd0",},
{{0xf2, 0x0f, 0x1a, 0x44, 0x05, 0x12, }, 6, 0, "", "",
"f2 0f 1a 44 05 12 \tbndcu 0x12(%rbp,%rax,1),%bnd0",},
{{0xf2, 0x0f, 0x1a, 0x44, 0x08, 0x12, }, 6, 0, "", "",
"f2 0f 1a 44 08 12 \tbndcu 0x12(%rax,%rcx,1),%bnd0",},
{{0xf2, 0x0f, 0x1a, 0x44, 0xc8, 0x12, }, 6, 0, "", "",
"f2 0f 1a 44 c8 12 \tbndcu 0x12(%rax,%rcx,8),%bnd0",},
{{0xf2, 0x0f, 0x1a, 0x80, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"f2 0f 1a 80 78 56 34 12 \tbndcu 0x12345678(%rax),%bnd0",},
{{0xf2, 0x0f, 0x1a, 0x85, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"f2 0f 1a 85 78 56 34 12 \tbndcu 0x12345678(%rbp),%bnd0",},
{{0xf2, 0x0f, 0x1a, 0x84, 0x01, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"f2 0f 1a 84 01 78 56 34 12 \tbndcu 0x12345678(%rcx,%rax,1),%bnd0",},
{{0xf2, 0x0f, 0x1a, 0x84, 0x05, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"f2 0f 1a 84 05 78 56 34 12 \tbndcu 0x12345678(%rbp,%rax,1),%bnd0",},
{{0xf2, 0x0f, 0x1a, 0x84, 0x08, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"f2 0f 1a 84 08 78 56 34 12 \tbndcu 0x12345678(%rax,%rcx,1),%bnd0",},
{{0xf2, 0x0f, 0x1a, 0x84, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"f2 0f 1a 84 c8 78 56 34 12 \tbndcu 0x12345678(%rax,%rcx,8),%bnd0",},
{{0xf2, 0x0f, 0x1a, 0xc0, }, 4, 0, "", "",
"f2 0f 1a c0 \tbndcu %rax,%bnd0",},
{{0xf2, 0x0f, 0x1b, 0x00, }, 4, 0, "", "",
"f2 0f 1b 00 \tbndcn (%rax),%bnd0",},
{{0xf2, 0x41, 0x0f, 0x1b, 0x00, }, 5, 0, "", "",
"f2 41 0f 1b 00 \tbndcn (%r8),%bnd0",},
{{0xf2, 0x0f, 0x1b, 0x04, 0x25, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"f2 0f 1b 04 25 78 56 34 12 \tbndcn 0x12345678,%bnd0",},
{{0xf2, 0x0f, 0x1b, 0x18, }, 4, 0, "", "",
"f2 0f 1b 18 \tbndcn (%rax),%bnd3",},
{{0xf2, 0x0f, 0x1b, 0x04, 0x01, }, 5, 0, "", "",
"f2 0f 1b 04 01 \tbndcn (%rcx,%rax,1),%bnd0",},
{{0xf2, 0x0f, 0x1b, 0x04, 0x05, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"f2 0f 1b 04 05 78 56 34 12 \tbndcn 0x12345678(,%rax,1),%bnd0",},
{{0xf2, 0x0f, 0x1b, 0x04, 0x08, }, 5, 0, "", "",
"f2 0f 1b 04 08 \tbndcn (%rax,%rcx,1),%bnd0",},
{{0xf2, 0x0f, 0x1b, 0x04, 0xc8, }, 5, 0, "", "",
"f2 0f 1b 04 c8 \tbndcn (%rax,%rcx,8),%bnd0",},
{{0xf2, 0x0f, 0x1b, 0x40, 0x12, }, 5, 0, "", "",
"f2 0f 1b 40 12 \tbndcn 0x12(%rax),%bnd0",},
{{0xf2, 0x0f, 0x1b, 0x45, 0x12, }, 5, 0, "", "",
"f2 0f 1b 45 12 \tbndcn 0x12(%rbp),%bnd0",},
{{0xf2, 0x0f, 0x1b, 0x44, 0x01, 0x12, }, 6, 0, "", "",
"f2 0f 1b 44 01 12 \tbndcn 0x12(%rcx,%rax,1),%bnd0",},
{{0xf2, 0x0f, 0x1b, 0x44, 0x05, 0x12, }, 6, 0, "", "",
"f2 0f 1b 44 05 12 \tbndcn 0x12(%rbp,%rax,1),%bnd0",},
{{0xf2, 0x0f, 0x1b, 0x44, 0x08, 0x12, }, 6, 0, "", "",
"f2 0f 1b 44 08 12 \tbndcn 0x12(%rax,%rcx,1),%bnd0",},
{{0xf2, 0x0f, 0x1b, 0x44, 0xc8, 0x12, }, 6, 0, "", "",
"f2 0f 1b 44 c8 12 \tbndcn 0x12(%rax,%rcx,8),%bnd0",},
{{0xf2, 0x0f, 0x1b, 0x80, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"f2 0f 1b 80 78 56 34 12 \tbndcn 0x12345678(%rax),%bnd0",},
{{0xf2, 0x0f, 0x1b, 0x85, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"f2 0f 1b 85 78 56 34 12 \tbndcn 0x12345678(%rbp),%bnd0",},
{{0xf2, 0x0f, 0x1b, 0x84, 0x01, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"f2 0f 1b 84 01 78 56 34 12 \tbndcn 0x12345678(%rcx,%rax,1),%bnd0",},
{{0xf2, 0x0f, 0x1b, 0x84, 0x05, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"f2 0f 1b 84 05 78 56 34 12 \tbndcn 0x12345678(%rbp,%rax,1),%bnd0",},
{{0xf2, 0x0f, 0x1b, 0x84, 0x08, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"f2 0f 1b 84 08 78 56 34 12 \tbndcn 0x12345678(%rax,%rcx,1),%bnd0",},
{{0xf2, 0x0f, 0x1b, 0x84, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"f2 0f 1b 84 c8 78 56 34 12 \tbndcn 0x12345678(%rax,%rcx,8),%bnd0",},
{{0xf2, 0x0f, 0x1b, 0xc0, }, 4, 0, "", "",
"f2 0f 1b c0 \tbndcn %rax,%bnd0",},
{{0x66, 0x0f, 0x1a, 0x00, }, 4, 0, "", "",
"66 0f 1a 00 \tbndmov (%rax),%bnd0",},
{{0x66, 0x41, 0x0f, 0x1a, 0x00, }, 5, 0, "", "",
"66 41 0f 1a 00 \tbndmov (%r8),%bnd0",},
{{0x66, 0x0f, 0x1a, 0x04, 0x25, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"66 0f 1a 04 25 78 56 34 12 \tbndmov 0x12345678,%bnd0",},
{{0x66, 0x0f, 0x1a, 0x18, }, 4, 0, "", "",
"66 0f 1a 18 \tbndmov (%rax),%bnd3",},
{{0x66, 0x0f, 0x1a, 0x04, 0x01, }, 5, 0, "", "",
"66 0f 1a 04 01 \tbndmov (%rcx,%rax,1),%bnd0",},
{{0x66, 0x0f, 0x1a, 0x04, 0x05, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"66 0f 1a 04 05 78 56 34 12 \tbndmov 0x12345678(,%rax,1),%bnd0",},
{{0x66, 0x0f, 0x1a, 0x04, 0x08, }, 5, 0, "", "",
"66 0f 1a 04 08 \tbndmov (%rax,%rcx,1),%bnd0",},
{{0x66, 0x0f, 0x1a, 0x04, 0xc8, }, 5, 0, "", "",
"66 0f 1a 04 c8 \tbndmov (%rax,%rcx,8),%bnd0",},
{{0x66, 0x0f, 0x1a, 0x40, 0x12, }, 5, 0, "", "",
"66 0f 1a 40 12 \tbndmov 0x12(%rax),%bnd0",},
{{0x66, 0x0f, 0x1a, 0x45, 0x12, }, 5, 0, "", "",
"66 0f 1a 45 12 \tbndmov 0x12(%rbp),%bnd0",},
{{0x66, 0x0f, 0x1a, 0x44, 0x01, 0x12, }, 6, 0, "", "",
"66 0f 1a 44 01 12 \tbndmov 0x12(%rcx,%rax,1),%bnd0",},
{{0x66, 0x0f, 0x1a, 0x44, 0x05, 0x12, }, 6, 0, "", "",
"66 0f 1a 44 05 12 \tbndmov 0x12(%rbp,%rax,1),%bnd0",},
{{0x66, 0x0f, 0x1a, 0x44, 0x08, 0x12, }, 6, 0, "", "",
"66 0f 1a 44 08 12 \tbndmov 0x12(%rax,%rcx,1),%bnd0",},
{{0x66, 0x0f, 0x1a, 0x44, 0xc8, 0x12, }, 6, 0, "", "",
"66 0f 1a 44 c8 12 \tbndmov 0x12(%rax,%rcx,8),%bnd0",},
{{0x66, 0x0f, 0x1a, 0x80, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"66 0f 1a 80 78 56 34 12 \tbndmov 0x12345678(%rax),%bnd0",},
{{0x66, 0x0f, 0x1a, 0x85, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"66 0f 1a 85 78 56 34 12 \tbndmov 0x12345678(%rbp),%bnd0",},
{{0x66, 0x0f, 0x1a, 0x84, 0x01, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"66 0f 1a 84 01 78 56 34 12 \tbndmov 0x12345678(%rcx,%rax,1),%bnd0",},
{{0x66, 0x0f, 0x1a, 0x84, 0x05, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"66 0f 1a 84 05 78 56 34 12 \tbndmov 0x12345678(%rbp,%rax,1),%bnd0",},
{{0x66, 0x0f, 0x1a, 0x84, 0x08, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"66 0f 1a 84 08 78 56 34 12 \tbndmov 0x12345678(%rax,%rcx,1),%bnd0",},
{{0x66, 0x0f, 0x1a, 0x84, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"66 0f 1a 84 c8 78 56 34 12 \tbndmov 0x12345678(%rax,%rcx,8),%bnd0",},
{{0x66, 0x0f, 0x1b, 0x00, }, 4, 0, "", "",
"66 0f 1b 00 \tbndmov %bnd0,(%rax)",},
{{0x66, 0x41, 0x0f, 0x1b, 0x00, }, 5, 0, "", "",
"66 41 0f 1b 00 \tbndmov %bnd0,(%r8)",},
{{0x66, 0x0f, 0x1b, 0x04, 0x25, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"66 0f 1b 04 25 78 56 34 12 \tbndmov %bnd0,0x12345678",},
{{0x66, 0x0f, 0x1b, 0x18, }, 4, 0, "", "",
"66 0f 1b 18 \tbndmov %bnd3,(%rax)",},
{{0x66, 0x0f, 0x1b, 0x04, 0x01, }, 5, 0, "", "",
"66 0f 1b 04 01 \tbndmov %bnd0,(%rcx,%rax,1)",},
{{0x66, 0x0f, 0x1b, 0x04, 0x05, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"66 0f 1b 04 05 78 56 34 12 \tbndmov %bnd0,0x12345678(,%rax,1)",},
{{0x66, 0x0f, 0x1b, 0x04, 0x08, }, 5, 0, "", "",
"66 0f 1b 04 08 \tbndmov %bnd0,(%rax,%rcx,1)",},
{{0x66, 0x0f, 0x1b, 0x04, 0xc8, }, 5, 0, "", "",
"66 0f 1b 04 c8 \tbndmov %bnd0,(%rax,%rcx,8)",},
{{0x66, 0x0f, 0x1b, 0x40, 0x12, }, 5, 0, "", "",
"66 0f 1b 40 12 \tbndmov %bnd0,0x12(%rax)",},
{{0x66, 0x0f, 0x1b, 0x45, 0x12, }, 5, 0, "", "",
"66 0f 1b 45 12 \tbndmov %bnd0,0x12(%rbp)",},
{{0x66, 0x0f, 0x1b, 0x44, 0x01, 0x12, }, 6, 0, "", "",
"66 0f 1b 44 01 12 \tbndmov %bnd0,0x12(%rcx,%rax,1)",},
{{0x66, 0x0f, 0x1b, 0x44, 0x05, 0x12, }, 6, 0, "", "",
"66 0f 1b 44 05 12 \tbndmov %bnd0,0x12(%rbp,%rax,1)",},
{{0x66, 0x0f, 0x1b, 0x44, 0x08, 0x12, }, 6, 0, "", "",
"66 0f 1b 44 08 12 \tbndmov %bnd0,0x12(%rax,%rcx,1)",},
{{0x66, 0x0f, 0x1b, 0x44, 0xc8, 0x12, }, 6, 0, "", "",
"66 0f 1b 44 c8 12 \tbndmov %bnd0,0x12(%rax,%rcx,8)",},
{{0x66, 0x0f, 0x1b, 0x80, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"66 0f 1b 80 78 56 34 12 \tbndmov %bnd0,0x12345678(%rax)",},
{{0x66, 0x0f, 0x1b, 0x85, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"66 0f 1b 85 78 56 34 12 \tbndmov %bnd0,0x12345678(%rbp)",},
{{0x66, 0x0f, 0x1b, 0x84, 0x01, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"66 0f 1b 84 01 78 56 34 12 \tbndmov %bnd0,0x12345678(%rcx,%rax,1)",},
{{0x66, 0x0f, 0x1b, 0x84, 0x05, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"66 0f 1b 84 05 78 56 34 12 \tbndmov %bnd0,0x12345678(%rbp,%rax,1)",},
{{0x66, 0x0f, 0x1b, 0x84, 0x08, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"66 0f 1b 84 08 78 56 34 12 \tbndmov %bnd0,0x12345678(%rax,%rcx,1)",},
{{0x66, 0x0f, 0x1b, 0x84, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"66 0f 1b 84 c8 78 56 34 12 \tbndmov %bnd0,0x12345678(%rax,%rcx,8)",},
{{0x66, 0x0f, 0x1a, 0xc8, }, 4, 0, "", "",
"66 0f 1a c8 \tbndmov %bnd0,%bnd1",},
{{0x66, 0x0f, 0x1a, 0xc1, }, 4, 0, "", "",
"66 0f 1a c1 \tbndmov %bnd1,%bnd0",},
{{0x0f, 0x1a, 0x00, }, 3, 0, "", "",
"0f 1a 00 \tbndldx (%rax),%bnd0",},
{{0x41, 0x0f, 0x1a, 0x00, }, 4, 0, "", "",
"41 0f 1a 00 \tbndldx (%r8),%bnd0",},
{{0x0f, 0x1a, 0x04, 0x25, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f 1a 04 25 78 56 34 12 \tbndldx 0x12345678,%bnd0",},
{{0x0f, 0x1a, 0x18, }, 3, 0, "", "",
"0f 1a 18 \tbndldx (%rax),%bnd3",},
{{0x0f, 0x1a, 0x04, 0x01, }, 4, 0, "", "",
"0f 1a 04 01 \tbndldx (%rcx,%rax,1),%bnd0",},
{{0x0f, 0x1a, 0x04, 0x05, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f 1a 04 05 78 56 34 12 \tbndldx 0x12345678(,%rax,1),%bnd0",},
{{0x0f, 0x1a, 0x04, 0x08, }, 4, 0, "", "",
"0f 1a 04 08 \tbndldx (%rax,%rcx,1),%bnd0",},
{{0x0f, 0x1a, 0x40, 0x12, }, 4, 0, "", "",
"0f 1a 40 12 \tbndldx 0x12(%rax),%bnd0",},
{{0x0f, 0x1a, 0x45, 0x12, }, 4, 0, "", "",
"0f 1a 45 12 \tbndldx 0x12(%rbp),%bnd0",},
{{0x0f, 0x1a, 0x44, 0x01, 0x12, }, 5, 0, "", "",
"0f 1a 44 01 12 \tbndldx 0x12(%rcx,%rax,1),%bnd0",},
{{0x0f, 0x1a, 0x44, 0x05, 0x12, }, 5, 0, "", "",
"0f 1a 44 05 12 \tbndldx 0x12(%rbp,%rax,1),%bnd0",},
{{0x0f, 0x1a, 0x44, 0x08, 0x12, }, 5, 0, "", "",
"0f 1a 44 08 12 \tbndldx 0x12(%rax,%rcx,1),%bnd0",},
{{0x0f, 0x1a, 0x80, 0x78, 0x56, 0x34, 0x12, }, 7, 0, "", "",
"0f 1a 80 78 56 34 12 \tbndldx 0x12345678(%rax),%bnd0",},
{{0x0f, 0x1a, 0x85, 0x78, 0x56, 0x34, 0x12, }, 7, 0, "", "",
"0f 1a 85 78 56 34 12 \tbndldx 0x12345678(%rbp),%bnd0",},
{{0x0f, 0x1a, 0x84, 0x01, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f 1a 84 01 78 56 34 12 \tbndldx 0x12345678(%rcx,%rax,1),%bnd0",},
{{0x0f, 0x1a, 0x84, 0x05, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f 1a 84 05 78 56 34 12 \tbndldx 0x12345678(%rbp,%rax,1),%bnd0",},
{{0x0f, 0x1a, 0x84, 0x08, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f 1a 84 08 78 56 34 12 \tbndldx 0x12345678(%rax,%rcx,1),%bnd0",},
{{0x0f, 0x1b, 0x00, }, 3, 0, "", "",
"0f 1b 00 \tbndstx %bnd0,(%rax)",},
{{0x41, 0x0f, 0x1b, 0x00, }, 4, 0, "", "",
"41 0f 1b 00 \tbndstx %bnd0,(%r8)",},
{{0x0f, 0x1b, 0x04, 0x25, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f 1b 04 25 78 56 34 12 \tbndstx %bnd0,0x12345678",},
{{0x0f, 0x1b, 0x18, }, 3, 0, "", "",
"0f 1b 18 \tbndstx %bnd3,(%rax)",},
{{0x0f, 0x1b, 0x04, 0x01, }, 4, 0, "", "",
"0f 1b 04 01 \tbndstx %bnd0,(%rcx,%rax,1)",},
{{0x0f, 0x1b, 0x04, 0x05, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f 1b 04 05 78 56 34 12 \tbndstx %bnd0,0x12345678(,%rax,1)",},
{{0x0f, 0x1b, 0x04, 0x08, }, 4, 0, "", "",
"0f 1b 04 08 \tbndstx %bnd0,(%rax,%rcx,1)",},
{{0x0f, 0x1b, 0x40, 0x12, }, 4, 0, "", "",
"0f 1b 40 12 \tbndstx %bnd0,0x12(%rax)",},
{{0x0f, 0x1b, 0x45, 0x12, }, 4, 0, "", "",
"0f 1b 45 12 \tbndstx %bnd0,0x12(%rbp)",},
{{0x0f, 0x1b, 0x44, 0x01, 0x12, }, 5, 0, "", "",
"0f 1b 44 01 12 \tbndstx %bnd0,0x12(%rcx,%rax,1)",},
{{0x0f, 0x1b, 0x44, 0x05, 0x12, }, 5, 0, "", "",
"0f 1b 44 05 12 \tbndstx %bnd0,0x12(%rbp,%rax,1)",},
{{0x0f, 0x1b, 0x44, 0x08, 0x12, }, 5, 0, "", "",
"0f 1b 44 08 12 \tbndstx %bnd0,0x12(%rax,%rcx,1)",},
{{0x0f, 0x1b, 0x80, 0x78, 0x56, 0x34, 0x12, }, 7, 0, "", "",
"0f 1b 80 78 56 34 12 \tbndstx %bnd0,0x12345678(%rax)",},
{{0x0f, 0x1b, 0x85, 0x78, 0x56, 0x34, 0x12, }, 7, 0, "", "",
"0f 1b 85 78 56 34 12 \tbndstx %bnd0,0x12345678(%rbp)",},
{{0x0f, 0x1b, 0x84, 0x01, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f 1b 84 01 78 56 34 12 \tbndstx %bnd0,0x12345678(%rcx,%rax,1)",},
{{0x0f, 0x1b, 0x84, 0x05, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f 1b 84 05 78 56 34 12 \tbndstx %bnd0,0x12345678(%rbp,%rax,1)",},
{{0x0f, 0x1b, 0x84, 0x08, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f 1b 84 08 78 56 34 12 \tbndstx %bnd0,0x12345678(%rax,%rcx,1)",},
{{0xf2, 0xe8, 0x00, 0x00, 0x00, 0x00, }, 6, 0, "call", "unconditional",
"f2 e8 00 00 00 00 \tbnd callq 3f6 <main+0x3f6>",},
{{0x67, 0xf2, 0xff, 0x10, }, 4, 0, "call", "indirect",
"67 f2 ff 10 \tbnd callq *(%eax)",},
{{0xf2, 0xc3, }, 2, 0, "ret", "indirect",
"f2 c3 \tbnd retq ",},
{{0xf2, 0xe9, 0x00, 0x00, 0x00, 0x00, }, 6, 0, "jmp", "unconditional",
"f2 e9 00 00 00 00 \tbnd jmpq 402 <main+0x402>",},
{{0xf2, 0xe9, 0x00, 0x00, 0x00, 0x00, }, 6, 0, "jmp", "unconditional",
"f2 e9 00 00 00 00 \tbnd jmpq 408 <main+0x408>",},
{{0x67, 0xf2, 0xff, 0x21, }, 4, 0, "jmp", "indirect",
"67 f2 ff 21 \tbnd jmpq *(%ecx)",},
{{0xf2, 0x0f, 0x85, 0x00, 0x00, 0x00, 0x00, }, 7, 0, "jcc", "conditional",
"f2 0f 85 00 00 00 00 \tbnd jne 413 <main+0x413>",},
{{0x0f, 0x3a, 0xcc, 0xc1, 0x00, }, 5, 0, "", "",
"0f 3a cc c1 00 \tsha1rnds4 $0x0,%xmm1,%xmm0",},
{{0x0f, 0x3a, 0xcc, 0xd7, 0x91, }, 5, 0, "", "",
"0f 3a cc d7 91 \tsha1rnds4 $0x91,%xmm7,%xmm2",},
{{0x41, 0x0f, 0x3a, 0xcc, 0xc0, 0x91, }, 6, 0, "", "",
"41 0f 3a cc c0 91 \tsha1rnds4 $0x91,%xmm8,%xmm0",},
{{0x44, 0x0f, 0x3a, 0xcc, 0xc7, 0x91, }, 6, 0, "", "",
"44 0f 3a cc c7 91 \tsha1rnds4 $0x91,%xmm7,%xmm8",},
{{0x45, 0x0f, 0x3a, 0xcc, 0xc7, 0x91, }, 6, 0, "", "",
"45 0f 3a cc c7 91 \tsha1rnds4 $0x91,%xmm15,%xmm8",},
{{0x0f, 0x3a, 0xcc, 0x00, 0x91, }, 5, 0, "", "",
"0f 3a cc 00 91 \tsha1rnds4 $0x91,(%rax),%xmm0",},
{{0x41, 0x0f, 0x3a, 0xcc, 0x00, 0x91, }, 6, 0, "", "",
"41 0f 3a cc 00 91 \tsha1rnds4 $0x91,(%r8),%xmm0",},
{{0x0f, 0x3a, 0xcc, 0x04, 0x25, 0x78, 0x56, 0x34, 0x12, 0x91, }, 10, 0, "", "",
"0f 3a cc 04 25 78 56 34 12 91 \tsha1rnds4 $0x91,0x12345678,%xmm0",},
{{0x0f, 0x3a, 0xcc, 0x18, 0x91, }, 5, 0, "", "",
"0f 3a cc 18 91 \tsha1rnds4 $0x91,(%rax),%xmm3",},
{{0x0f, 0x3a, 0xcc, 0x04, 0x01, 0x91, }, 6, 0, "", "",
"0f 3a cc 04 01 91 \tsha1rnds4 $0x91,(%rcx,%rax,1),%xmm0",},
{{0x0f, 0x3a, 0xcc, 0x04, 0x05, 0x78, 0x56, 0x34, 0x12, 0x91, }, 10, 0, "", "",
"0f 3a cc 04 05 78 56 34 12 91 \tsha1rnds4 $0x91,0x12345678(,%rax,1),%xmm0",},
{{0x0f, 0x3a, 0xcc, 0x04, 0x08, 0x91, }, 6, 0, "", "",
"0f 3a cc 04 08 91 \tsha1rnds4 $0x91,(%rax,%rcx,1),%xmm0",},
{{0x0f, 0x3a, 0xcc, 0x04, 0xc8, 0x91, }, 6, 0, "", "",
"0f 3a cc 04 c8 91 \tsha1rnds4 $0x91,(%rax,%rcx,8),%xmm0",},
{{0x0f, 0x3a, 0xcc, 0x40, 0x12, 0x91, }, 6, 0, "", "",
"0f 3a cc 40 12 91 \tsha1rnds4 $0x91,0x12(%rax),%xmm0",},
{{0x0f, 0x3a, 0xcc, 0x45, 0x12, 0x91, }, 6, 0, "", "",
"0f 3a cc 45 12 91 \tsha1rnds4 $0x91,0x12(%rbp),%xmm0",},
{{0x0f, 0x3a, 0xcc, 0x44, 0x01, 0x12, 0x91, }, 7, 0, "", "",
"0f 3a cc 44 01 12 91 \tsha1rnds4 $0x91,0x12(%rcx,%rax,1),%xmm0",},
{{0x0f, 0x3a, 0xcc, 0x44, 0x05, 0x12, 0x91, }, 7, 0, "", "",
"0f 3a cc 44 05 12 91 \tsha1rnds4 $0x91,0x12(%rbp,%rax,1),%xmm0",},
{{0x0f, 0x3a, 0xcc, 0x44, 0x08, 0x12, 0x91, }, 7, 0, "", "",
"0f 3a cc 44 08 12 91 \tsha1rnds4 $0x91,0x12(%rax,%rcx,1),%xmm0",},
{{0x0f, 0x3a, 0xcc, 0x44, 0xc8, 0x12, 0x91, }, 7, 0, "", "",
"0f 3a cc 44 c8 12 91 \tsha1rnds4 $0x91,0x12(%rax,%rcx,8),%xmm0",},
{{0x0f, 0x3a, 0xcc, 0x80, 0x78, 0x56, 0x34, 0x12, 0x91, }, 9, 0, "", "",
"0f 3a cc 80 78 56 34 12 91 \tsha1rnds4 $0x91,0x12345678(%rax),%xmm0",},
{{0x0f, 0x3a, 0xcc, 0x85, 0x78, 0x56, 0x34, 0x12, 0x91, }, 9, 0, "", "",
"0f 3a cc 85 78 56 34 12 91 \tsha1rnds4 $0x91,0x12345678(%rbp),%xmm0",},
{{0x0f, 0x3a, 0xcc, 0x84, 0x01, 0x78, 0x56, 0x34, 0x12, 0x91, }, 10, 0, "", "",
"0f 3a cc 84 01 78 56 34 12 91 \tsha1rnds4 $0x91,0x12345678(%rcx,%rax,1),%xmm0",},
{{0x0f, 0x3a, 0xcc, 0x84, 0x05, 0x78, 0x56, 0x34, 0x12, 0x91, }, 10, 0, "", "",
"0f 3a cc 84 05 78 56 34 12 91 \tsha1rnds4 $0x91,0x12345678(%rbp,%rax,1),%xmm0",},
{{0x0f, 0x3a, 0xcc, 0x84, 0x08, 0x78, 0x56, 0x34, 0x12, 0x91, }, 10, 0, "", "",
"0f 3a cc 84 08 78 56 34 12 91 \tsha1rnds4 $0x91,0x12345678(%rax,%rcx,1),%xmm0",},
{{0x0f, 0x3a, 0xcc, 0x84, 0xc8, 0x78, 0x56, 0x34, 0x12, 0x91, }, 10, 0, "", "",
"0f 3a cc 84 c8 78 56 34 12 91 \tsha1rnds4 $0x91,0x12345678(%rax,%rcx,8),%xmm0",},
{{0x44, 0x0f, 0x3a, 0xcc, 0xbc, 0xc8, 0x78, 0x56, 0x34, 0x12, 0x91, }, 11, 0, "", "",
"44 0f 3a cc bc c8 78 56 34 12 91 \tsha1rnds4 $0x91,0x12345678(%rax,%rcx,8),%xmm15",},
{{0x0f, 0x38, 0xc8, 0xc1, }, 4, 0, "", "",
"0f 38 c8 c1 \tsha1nexte %xmm1,%xmm0",},
{{0x0f, 0x38, 0xc8, 0xd7, }, 4, 0, "", "",
"0f 38 c8 d7 \tsha1nexte %xmm7,%xmm2",},
{{0x41, 0x0f, 0x38, 0xc8, 0xc0, }, 5, 0, "", "",
"41 0f 38 c8 c0 \tsha1nexte %xmm8,%xmm0",},
{{0x44, 0x0f, 0x38, 0xc8, 0xc7, }, 5, 0, "", "",
"44 0f 38 c8 c7 \tsha1nexte %xmm7,%xmm8",},
{{0x45, 0x0f, 0x38, 0xc8, 0xc7, }, 5, 0, "", "",
"45 0f 38 c8 c7 \tsha1nexte %xmm15,%xmm8",},
{{0x0f, 0x38, 0xc8, 0x00, }, 4, 0, "", "",
"0f 38 c8 00 \tsha1nexte (%rax),%xmm0",},
{{0x41, 0x0f, 0x38, 0xc8, 0x00, }, 5, 0, "", "",
"41 0f 38 c8 00 \tsha1nexte (%r8),%xmm0",},
{{0x0f, 0x38, 0xc8, 0x04, 0x25, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 c8 04 25 78 56 34 12 \tsha1nexte 0x12345678,%xmm0",},
{{0x0f, 0x38, 0xc8, 0x18, }, 4, 0, "", "",
"0f 38 c8 18 \tsha1nexte (%rax),%xmm3",},
{{0x0f, 0x38, 0xc8, 0x04, 0x01, }, 5, 0, "", "",
"0f 38 c8 04 01 \tsha1nexte (%rcx,%rax,1),%xmm0",},
{{0x0f, 0x38, 0xc8, 0x04, 0x05, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 c8 04 05 78 56 34 12 \tsha1nexte 0x12345678(,%rax,1),%xmm0",},
{{0x0f, 0x38, 0xc8, 0x04, 0x08, }, 5, 0, "", "",
"0f 38 c8 04 08 \tsha1nexte (%rax,%rcx,1),%xmm0",},
{{0x0f, 0x38, 0xc8, 0x04, 0xc8, }, 5, 0, "", "",
"0f 38 c8 04 c8 \tsha1nexte (%rax,%rcx,8),%xmm0",},
{{0x0f, 0x38, 0xc8, 0x40, 0x12, }, 5, 0, "", "",
"0f 38 c8 40 12 \tsha1nexte 0x12(%rax),%xmm0",},
{{0x0f, 0x38, 0xc8, 0x45, 0x12, }, 5, 0, "", "",
"0f 38 c8 45 12 \tsha1nexte 0x12(%rbp),%xmm0",},
{{0x0f, 0x38, 0xc8, 0x44, 0x01, 0x12, }, 6, 0, "", "",
"0f 38 c8 44 01 12 \tsha1nexte 0x12(%rcx,%rax,1),%xmm0",},
{{0x0f, 0x38, 0xc8, 0x44, 0x05, 0x12, }, 6, 0, "", "",
"0f 38 c8 44 05 12 \tsha1nexte 0x12(%rbp,%rax,1),%xmm0",},
{{0x0f, 0x38, 0xc8, 0x44, 0x08, 0x12, }, 6, 0, "", "",
"0f 38 c8 44 08 12 \tsha1nexte 0x12(%rax,%rcx,1),%xmm0",},
{{0x0f, 0x38, 0xc8, 0x44, 0xc8, 0x12, }, 6, 0, "", "",
"0f 38 c8 44 c8 12 \tsha1nexte 0x12(%rax,%rcx,8),%xmm0",},
{{0x0f, 0x38, 0xc8, 0x80, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f 38 c8 80 78 56 34 12 \tsha1nexte 0x12345678(%rax),%xmm0",},
{{0x0f, 0x38, 0xc8, 0x85, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f 38 c8 85 78 56 34 12 \tsha1nexte 0x12345678(%rbp),%xmm0",},
{{0x0f, 0x38, 0xc8, 0x84, 0x01, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 c8 84 01 78 56 34 12 \tsha1nexte 0x12345678(%rcx,%rax,1),%xmm0",},
{{0x0f, 0x38, 0xc8, 0x84, 0x05, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 c8 84 05 78 56 34 12 \tsha1nexte 0x12345678(%rbp,%rax,1),%xmm0",},
{{0x0f, 0x38, 0xc8, 0x84, 0x08, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 c8 84 08 78 56 34 12 \tsha1nexte 0x12345678(%rax,%rcx,1),%xmm0",},
{{0x0f, 0x38, 0xc8, 0x84, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 c8 84 c8 78 56 34 12 \tsha1nexte 0x12345678(%rax,%rcx,8),%xmm0",},
{{0x44, 0x0f, 0x38, 0xc8, 0xbc, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 10, 0, "", "",
"44 0f 38 c8 bc c8 78 56 34 12 \tsha1nexte 0x12345678(%rax,%rcx,8),%xmm15",},
{{0x0f, 0x38, 0xc9, 0xc1, }, 4, 0, "", "",
"0f 38 c9 c1 \tsha1msg1 %xmm1,%xmm0",},
{{0x0f, 0x38, 0xc9, 0xd7, }, 4, 0, "", "",
"0f 38 c9 d7 \tsha1msg1 %xmm7,%xmm2",},
{{0x41, 0x0f, 0x38, 0xc9, 0xc0, }, 5, 0, "", "",
"41 0f 38 c9 c0 \tsha1msg1 %xmm8,%xmm0",},
{{0x44, 0x0f, 0x38, 0xc9, 0xc7, }, 5, 0, "", "",
"44 0f 38 c9 c7 \tsha1msg1 %xmm7,%xmm8",},
{{0x45, 0x0f, 0x38, 0xc9, 0xc7, }, 5, 0, "", "",
"45 0f 38 c9 c7 \tsha1msg1 %xmm15,%xmm8",},
{{0x0f, 0x38, 0xc9, 0x00, }, 4, 0, "", "",
"0f 38 c9 00 \tsha1msg1 (%rax),%xmm0",},
{{0x41, 0x0f, 0x38, 0xc9, 0x00, }, 5, 0, "", "",
"41 0f 38 c9 00 \tsha1msg1 (%r8),%xmm0",},
{{0x0f, 0x38, 0xc9, 0x04, 0x25, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 c9 04 25 78 56 34 12 \tsha1msg1 0x12345678,%xmm0",},
{{0x0f, 0x38, 0xc9, 0x18, }, 4, 0, "", "",
"0f 38 c9 18 \tsha1msg1 (%rax),%xmm3",},
{{0x0f, 0x38, 0xc9, 0x04, 0x01, }, 5, 0, "", "",
"0f 38 c9 04 01 \tsha1msg1 (%rcx,%rax,1),%xmm0",},
{{0x0f, 0x38, 0xc9, 0x04, 0x05, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 c9 04 05 78 56 34 12 \tsha1msg1 0x12345678(,%rax,1),%xmm0",},
{{0x0f, 0x38, 0xc9, 0x04, 0x08, }, 5, 0, "", "",
"0f 38 c9 04 08 \tsha1msg1 (%rax,%rcx,1),%xmm0",},
{{0x0f, 0x38, 0xc9, 0x04, 0xc8, }, 5, 0, "", "",
"0f 38 c9 04 c8 \tsha1msg1 (%rax,%rcx,8),%xmm0",},
{{0x0f, 0x38, 0xc9, 0x40, 0x12, }, 5, 0, "", "",
"0f 38 c9 40 12 \tsha1msg1 0x12(%rax),%xmm0",},
{{0x0f, 0x38, 0xc9, 0x45, 0x12, }, 5, 0, "", "",
"0f 38 c9 45 12 \tsha1msg1 0x12(%rbp),%xmm0",},
{{0x0f, 0x38, 0xc9, 0x44, 0x01, 0x12, }, 6, 0, "", "",
"0f 38 c9 44 01 12 \tsha1msg1 0x12(%rcx,%rax,1),%xmm0",},
{{0x0f, 0x38, 0xc9, 0x44, 0x05, 0x12, }, 6, 0, "", "",
"0f 38 c9 44 05 12 \tsha1msg1 0x12(%rbp,%rax,1),%xmm0",},
{{0x0f, 0x38, 0xc9, 0x44, 0x08, 0x12, }, 6, 0, "", "",
"0f 38 c9 44 08 12 \tsha1msg1 0x12(%rax,%rcx,1),%xmm0",},
{{0x0f, 0x38, 0xc9, 0x44, 0xc8, 0x12, }, 6, 0, "", "",
"0f 38 c9 44 c8 12 \tsha1msg1 0x12(%rax,%rcx,8),%xmm0",},
{{0x0f, 0x38, 0xc9, 0x80, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f 38 c9 80 78 56 34 12 \tsha1msg1 0x12345678(%rax),%xmm0",},
{{0x0f, 0x38, 0xc9, 0x85, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f 38 c9 85 78 56 34 12 \tsha1msg1 0x12345678(%rbp),%xmm0",},
{{0x0f, 0x38, 0xc9, 0x84, 0x01, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 c9 84 01 78 56 34 12 \tsha1msg1 0x12345678(%rcx,%rax,1),%xmm0",},
{{0x0f, 0x38, 0xc9, 0x84, 0x05, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 c9 84 05 78 56 34 12 \tsha1msg1 0x12345678(%rbp,%rax,1),%xmm0",},
{{0x0f, 0x38, 0xc9, 0x84, 0x08, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 c9 84 08 78 56 34 12 \tsha1msg1 0x12345678(%rax,%rcx,1),%xmm0",},
{{0x0f, 0x38, 0xc9, 0x84, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 c9 84 c8 78 56 34 12 \tsha1msg1 0x12345678(%rax,%rcx,8),%xmm0",},
{{0x44, 0x0f, 0x38, 0xc9, 0xbc, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 10, 0, "", "",
"44 0f 38 c9 bc c8 78 56 34 12 \tsha1msg1 0x12345678(%rax,%rcx,8),%xmm15",},
{{0x0f, 0x38, 0xca, 0xc1, }, 4, 0, "", "",
"0f 38 ca c1 \tsha1msg2 %xmm1,%xmm0",},
{{0x0f, 0x38, 0xca, 0xd7, }, 4, 0, "", "",
"0f 38 ca d7 \tsha1msg2 %xmm7,%xmm2",},
{{0x41, 0x0f, 0x38, 0xca, 0xc0, }, 5, 0, "", "",
"41 0f 38 ca c0 \tsha1msg2 %xmm8,%xmm0",},
{{0x44, 0x0f, 0x38, 0xca, 0xc7, }, 5, 0, "", "",
"44 0f 38 ca c7 \tsha1msg2 %xmm7,%xmm8",},
{{0x45, 0x0f, 0x38, 0xca, 0xc7, }, 5, 0, "", "",
"45 0f 38 ca c7 \tsha1msg2 %xmm15,%xmm8",},
{{0x0f, 0x38, 0xca, 0x00, }, 4, 0, "", "",
"0f 38 ca 00 \tsha1msg2 (%rax),%xmm0",},
{{0x41, 0x0f, 0x38, 0xca, 0x00, }, 5, 0, "", "",
"41 0f 38 ca 00 \tsha1msg2 (%r8),%xmm0",},
{{0x0f, 0x38, 0xca, 0x04, 0x25, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 ca 04 25 78 56 34 12 \tsha1msg2 0x12345678,%xmm0",},
{{0x0f, 0x38, 0xca, 0x18, }, 4, 0, "", "",
"0f 38 ca 18 \tsha1msg2 (%rax),%xmm3",},
{{0x0f, 0x38, 0xca, 0x04, 0x01, }, 5, 0, "", "",
"0f 38 ca 04 01 \tsha1msg2 (%rcx,%rax,1),%xmm0",},
{{0x0f, 0x38, 0xca, 0x04, 0x05, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 ca 04 05 78 56 34 12 \tsha1msg2 0x12345678(,%rax,1),%xmm0",},
{{0x0f, 0x38, 0xca, 0x04, 0x08, }, 5, 0, "", "",
"0f 38 ca 04 08 \tsha1msg2 (%rax,%rcx,1),%xmm0",},
{{0x0f, 0x38, 0xca, 0x04, 0xc8, }, 5, 0, "", "",
"0f 38 ca 04 c8 \tsha1msg2 (%rax,%rcx,8),%xmm0",},
{{0x0f, 0x38, 0xca, 0x40, 0x12, }, 5, 0, "", "",
"0f 38 ca 40 12 \tsha1msg2 0x12(%rax),%xmm0",},
{{0x0f, 0x38, 0xca, 0x45, 0x12, }, 5, 0, "", "",
"0f 38 ca 45 12 \tsha1msg2 0x12(%rbp),%xmm0",},
{{0x0f, 0x38, 0xca, 0x44, 0x01, 0x12, }, 6, 0, "", "",
"0f 38 ca 44 01 12 \tsha1msg2 0x12(%rcx,%rax,1),%xmm0",},
{{0x0f, 0x38, 0xca, 0x44, 0x05, 0x12, }, 6, 0, "", "",
"0f 38 ca 44 05 12 \tsha1msg2 0x12(%rbp,%rax,1),%xmm0",},
{{0x0f, 0x38, 0xca, 0x44, 0x08, 0x12, }, 6, 0, "", "",
"0f 38 ca 44 08 12 \tsha1msg2 0x12(%rax,%rcx,1),%xmm0",},
{{0x0f, 0x38, 0xca, 0x44, 0xc8, 0x12, }, 6, 0, "", "",
"0f 38 ca 44 c8 12 \tsha1msg2 0x12(%rax,%rcx,8),%xmm0",},
{{0x0f, 0x38, 0xca, 0x80, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f 38 ca 80 78 56 34 12 \tsha1msg2 0x12345678(%rax),%xmm0",},
{{0x0f, 0x38, 0xca, 0x85, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f 38 ca 85 78 56 34 12 \tsha1msg2 0x12345678(%rbp),%xmm0",},
{{0x0f, 0x38, 0xca, 0x84, 0x01, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 ca 84 01 78 56 34 12 \tsha1msg2 0x12345678(%rcx,%rax,1),%xmm0",},
{{0x0f, 0x38, 0xca, 0x84, 0x05, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 ca 84 05 78 56 34 12 \tsha1msg2 0x12345678(%rbp,%rax,1),%xmm0",},
{{0x0f, 0x38, 0xca, 0x84, 0x08, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 ca 84 08 78 56 34 12 \tsha1msg2 0x12345678(%rax,%rcx,1),%xmm0",},
{{0x0f, 0x38, 0xca, 0x84, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 ca 84 c8 78 56 34 12 \tsha1msg2 0x12345678(%rax,%rcx,8),%xmm0",},
{{0x44, 0x0f, 0x38, 0xca, 0xbc, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 10, 0, "", "",
"44 0f 38 ca bc c8 78 56 34 12 \tsha1msg2 0x12345678(%rax,%rcx,8),%xmm15",},
{{0x0f, 0x38, 0xcb, 0xcc, }, 4, 0, "", "",
"0f 38 cb cc \tsha256rnds2 %xmm0,%xmm4,%xmm1",},
{{0x0f, 0x38, 0xcb, 0xd7, }, 4, 0, "", "",
"0f 38 cb d7 \tsha256rnds2 %xmm0,%xmm7,%xmm2",},
{{0x41, 0x0f, 0x38, 0xcb, 0xc8, }, 5, 0, "", "",
"41 0f 38 cb c8 \tsha256rnds2 %xmm0,%xmm8,%xmm1",},
{{0x44, 0x0f, 0x38, 0xcb, 0xc7, }, 5, 0, "", "",
"44 0f 38 cb c7 \tsha256rnds2 %xmm0,%xmm7,%xmm8",},
{{0x45, 0x0f, 0x38, 0xcb, 0xc7, }, 5, 0, "", "",
"45 0f 38 cb c7 \tsha256rnds2 %xmm0,%xmm15,%xmm8",},
{{0x0f, 0x38, 0xcb, 0x08, }, 4, 0, "", "",
"0f 38 cb 08 \tsha256rnds2 %xmm0,(%rax),%xmm1",},
{{0x41, 0x0f, 0x38, 0xcb, 0x08, }, 5, 0, "", "",
"41 0f 38 cb 08 \tsha256rnds2 %xmm0,(%r8),%xmm1",},
{{0x0f, 0x38, 0xcb, 0x0c, 0x25, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 cb 0c 25 78 56 34 12 \tsha256rnds2 %xmm0,0x12345678,%xmm1",},
{{0x0f, 0x38, 0xcb, 0x18, }, 4, 0, "", "",
"0f 38 cb 18 \tsha256rnds2 %xmm0,(%rax),%xmm3",},
{{0x0f, 0x38, 0xcb, 0x0c, 0x01, }, 5, 0, "", "",
"0f 38 cb 0c 01 \tsha256rnds2 %xmm0,(%rcx,%rax,1),%xmm1",},
{{0x0f, 0x38, 0xcb, 0x0c, 0x05, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 cb 0c 05 78 56 34 12 \tsha256rnds2 %xmm0,0x12345678(,%rax,1),%xmm1",},
{{0x0f, 0x38, 0xcb, 0x0c, 0x08, }, 5, 0, "", "",
"0f 38 cb 0c 08 \tsha256rnds2 %xmm0,(%rax,%rcx,1),%xmm1",},
{{0x0f, 0x38, 0xcb, 0x0c, 0xc8, }, 5, 0, "", "",
"0f 38 cb 0c c8 \tsha256rnds2 %xmm0,(%rax,%rcx,8),%xmm1",},
{{0x0f, 0x38, 0xcb, 0x48, 0x12, }, 5, 0, "", "",
"0f 38 cb 48 12 \tsha256rnds2 %xmm0,0x12(%rax),%xmm1",},
{{0x0f, 0x38, 0xcb, 0x4d, 0x12, }, 5, 0, "", "",
"0f 38 cb 4d 12 \tsha256rnds2 %xmm0,0x12(%rbp),%xmm1",},
{{0x0f, 0x38, 0xcb, 0x4c, 0x01, 0x12, }, 6, 0, "", "",
"0f 38 cb 4c 01 12 \tsha256rnds2 %xmm0,0x12(%rcx,%rax,1),%xmm1",},
{{0x0f, 0x38, 0xcb, 0x4c, 0x05, 0x12, }, 6, 0, "", "",
"0f 38 cb 4c 05 12 \tsha256rnds2 %xmm0,0x12(%rbp,%rax,1),%xmm1",},
{{0x0f, 0x38, 0xcb, 0x4c, 0x08, 0x12, }, 6, 0, "", "",
"0f 38 cb 4c 08 12 \tsha256rnds2 %xmm0,0x12(%rax,%rcx,1),%xmm1",},
{{0x0f, 0x38, 0xcb, 0x4c, 0xc8, 0x12, }, 6, 0, "", "",
"0f 38 cb 4c c8 12 \tsha256rnds2 %xmm0,0x12(%rax,%rcx,8),%xmm1",},
{{0x0f, 0x38, 0xcb, 0x88, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f 38 cb 88 78 56 34 12 \tsha256rnds2 %xmm0,0x12345678(%rax),%xmm1",},
{{0x0f, 0x38, 0xcb, 0x8d, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f 38 cb 8d 78 56 34 12 \tsha256rnds2 %xmm0,0x12345678(%rbp),%xmm1",},
{{0x0f, 0x38, 0xcb, 0x8c, 0x01, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 cb 8c 01 78 56 34 12 \tsha256rnds2 %xmm0,0x12345678(%rcx,%rax,1),%xmm1",},
{{0x0f, 0x38, 0xcb, 0x8c, 0x05, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 cb 8c 05 78 56 34 12 \tsha256rnds2 %xmm0,0x12345678(%rbp,%rax,1),%xmm1",},
{{0x0f, 0x38, 0xcb, 0x8c, 0x08, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 cb 8c 08 78 56 34 12 \tsha256rnds2 %xmm0,0x12345678(%rax,%rcx,1),%xmm1",},
{{0x0f, 0x38, 0xcb, 0x8c, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 cb 8c c8 78 56 34 12 \tsha256rnds2 %xmm0,0x12345678(%rax,%rcx,8),%xmm1",},
{{0x44, 0x0f, 0x38, 0xcb, 0xbc, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 10, 0, "", "",
"44 0f 38 cb bc c8 78 56 34 12 \tsha256rnds2 %xmm0,0x12345678(%rax,%rcx,8),%xmm15",},
{{0x0f, 0x38, 0xcc, 0xc1, }, 4, 0, "", "",
"0f 38 cc c1 \tsha256msg1 %xmm1,%xmm0",},
{{0x0f, 0x38, 0xcc, 0xd7, }, 4, 0, "", "",
"0f 38 cc d7 \tsha256msg1 %xmm7,%xmm2",},
{{0x41, 0x0f, 0x38, 0xcc, 0xc0, }, 5, 0, "", "",
"41 0f 38 cc c0 \tsha256msg1 %xmm8,%xmm0",},
{{0x44, 0x0f, 0x38, 0xcc, 0xc7, }, 5, 0, "", "",
"44 0f 38 cc c7 \tsha256msg1 %xmm7,%xmm8",},
{{0x45, 0x0f, 0x38, 0xcc, 0xc7, }, 5, 0, "", "",
"45 0f 38 cc c7 \tsha256msg1 %xmm15,%xmm8",},
{{0x0f, 0x38, 0xcc, 0x00, }, 4, 0, "", "",
"0f 38 cc 00 \tsha256msg1 (%rax),%xmm0",},
{{0x41, 0x0f, 0x38, 0xcc, 0x00, }, 5, 0, "", "",
"41 0f 38 cc 00 \tsha256msg1 (%r8),%xmm0",},
{{0x0f, 0x38, 0xcc, 0x04, 0x25, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 cc 04 25 78 56 34 12 \tsha256msg1 0x12345678,%xmm0",},
{{0x0f, 0x38, 0xcc, 0x18, }, 4, 0, "", "",
"0f 38 cc 18 \tsha256msg1 (%rax),%xmm3",},
{{0x0f, 0x38, 0xcc, 0x04, 0x01, }, 5, 0, "", "",
"0f 38 cc 04 01 \tsha256msg1 (%rcx,%rax,1),%xmm0",},
{{0x0f, 0x38, 0xcc, 0x04, 0x05, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 cc 04 05 78 56 34 12 \tsha256msg1 0x12345678(,%rax,1),%xmm0",},
{{0x0f, 0x38, 0xcc, 0x04, 0x08, }, 5, 0, "", "",
"0f 38 cc 04 08 \tsha256msg1 (%rax,%rcx,1),%xmm0",},
{{0x0f, 0x38, 0xcc, 0x04, 0xc8, }, 5, 0, "", "",
"0f 38 cc 04 c8 \tsha256msg1 (%rax,%rcx,8),%xmm0",},
{{0x0f, 0x38, 0xcc, 0x40, 0x12, }, 5, 0, "", "",
"0f 38 cc 40 12 \tsha256msg1 0x12(%rax),%xmm0",},
{{0x0f, 0x38, 0xcc, 0x45, 0x12, }, 5, 0, "", "",
"0f 38 cc 45 12 \tsha256msg1 0x12(%rbp),%xmm0",},
{{0x0f, 0x38, 0xcc, 0x44, 0x01, 0x12, }, 6, 0, "", "",
"0f 38 cc 44 01 12 \tsha256msg1 0x12(%rcx,%rax,1),%xmm0",},
{{0x0f, 0x38, 0xcc, 0x44, 0x05, 0x12, }, 6, 0, "", "",
"0f 38 cc 44 05 12 \tsha256msg1 0x12(%rbp,%rax,1),%xmm0",},
{{0x0f, 0x38, 0xcc, 0x44, 0x08, 0x12, }, 6, 0, "", "",
"0f 38 cc 44 08 12 \tsha256msg1 0x12(%rax,%rcx,1),%xmm0",},
{{0x0f, 0x38, 0xcc, 0x44, 0xc8, 0x12, }, 6, 0, "", "",
"0f 38 cc 44 c8 12 \tsha256msg1 0x12(%rax,%rcx,8),%xmm0",},
{{0x0f, 0x38, 0xcc, 0x80, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f 38 cc 80 78 56 34 12 \tsha256msg1 0x12345678(%rax),%xmm0",},
{{0x0f, 0x38, 0xcc, 0x85, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f 38 cc 85 78 56 34 12 \tsha256msg1 0x12345678(%rbp),%xmm0",},
{{0x0f, 0x38, 0xcc, 0x84, 0x01, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 cc 84 01 78 56 34 12 \tsha256msg1 0x12345678(%rcx,%rax,1),%xmm0",},
{{0x0f, 0x38, 0xcc, 0x84, 0x05, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 cc 84 05 78 56 34 12 \tsha256msg1 0x12345678(%rbp,%rax,1),%xmm0",},
{{0x0f, 0x38, 0xcc, 0x84, 0x08, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 cc 84 08 78 56 34 12 \tsha256msg1 0x12345678(%rax,%rcx,1),%xmm0",},
{{0x0f, 0x38, 0xcc, 0x84, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 cc 84 c8 78 56 34 12 \tsha256msg1 0x12345678(%rax,%rcx,8),%xmm0",},
{{0x44, 0x0f, 0x38, 0xcc, 0xbc, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 10, 0, "", "",
"44 0f 38 cc bc c8 78 56 34 12 \tsha256msg1 0x12345678(%rax,%rcx,8),%xmm15",},
{{0x0f, 0x38, 0xcd, 0xc1, }, 4, 0, "", "",
"0f 38 cd c1 \tsha256msg2 %xmm1,%xmm0",},
{{0x0f, 0x38, 0xcd, 0xd7, }, 4, 0, "", "",
"0f 38 cd d7 \tsha256msg2 %xmm7,%xmm2",},
{{0x41, 0x0f, 0x38, 0xcd, 0xc0, }, 5, 0, "", "",
"41 0f 38 cd c0 \tsha256msg2 %xmm8,%xmm0",},
{{0x44, 0x0f, 0x38, 0xcd, 0xc7, }, 5, 0, "", "",
"44 0f 38 cd c7 \tsha256msg2 %xmm7,%xmm8",},
{{0x45, 0x0f, 0x38, 0xcd, 0xc7, }, 5, 0, "", "",
"45 0f 38 cd c7 \tsha256msg2 %xmm15,%xmm8",},
{{0x0f, 0x38, 0xcd, 0x00, }, 4, 0, "", "",
"0f 38 cd 00 \tsha256msg2 (%rax),%xmm0",},
{{0x41, 0x0f, 0x38, 0xcd, 0x00, }, 5, 0, "", "",
"41 0f 38 cd 00 \tsha256msg2 (%r8),%xmm0",},
{{0x0f, 0x38, 0xcd, 0x04, 0x25, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 cd 04 25 78 56 34 12 \tsha256msg2 0x12345678,%xmm0",},
{{0x0f, 0x38, 0xcd, 0x18, }, 4, 0, "", "",
"0f 38 cd 18 \tsha256msg2 (%rax),%xmm3",},
{{0x0f, 0x38, 0xcd, 0x04, 0x01, }, 5, 0, "", "",
"0f 38 cd 04 01 \tsha256msg2 (%rcx,%rax,1),%xmm0",},
{{0x0f, 0x38, 0xcd, 0x04, 0x05, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 cd 04 05 78 56 34 12 \tsha256msg2 0x12345678(,%rax,1),%xmm0",},
{{0x0f, 0x38, 0xcd, 0x04, 0x08, }, 5, 0, "", "",
"0f 38 cd 04 08 \tsha256msg2 (%rax,%rcx,1),%xmm0",},
{{0x0f, 0x38, 0xcd, 0x04, 0xc8, }, 5, 0, "", "",
"0f 38 cd 04 c8 \tsha256msg2 (%rax,%rcx,8),%xmm0",},
{{0x0f, 0x38, 0xcd, 0x40, 0x12, }, 5, 0, "", "",
"0f 38 cd 40 12 \tsha256msg2 0x12(%rax),%xmm0",},
{{0x0f, 0x38, 0xcd, 0x45, 0x12, }, 5, 0, "", "",
"0f 38 cd 45 12 \tsha256msg2 0x12(%rbp),%xmm0",},
{{0x0f, 0x38, 0xcd, 0x44, 0x01, 0x12, }, 6, 0, "", "",
"0f 38 cd 44 01 12 \tsha256msg2 0x12(%rcx,%rax,1),%xmm0",},
{{0x0f, 0x38, 0xcd, 0x44, 0x05, 0x12, }, 6, 0, "", "",
"0f 38 cd 44 05 12 \tsha256msg2 0x12(%rbp,%rax,1),%xmm0",},
{{0x0f, 0x38, 0xcd, 0x44, 0x08, 0x12, }, 6, 0, "", "",
"0f 38 cd 44 08 12 \tsha256msg2 0x12(%rax,%rcx,1),%xmm0",},
{{0x0f, 0x38, 0xcd, 0x44, 0xc8, 0x12, }, 6, 0, "", "",
"0f 38 cd 44 c8 12 \tsha256msg2 0x12(%rax,%rcx,8),%xmm0",},
{{0x0f, 0x38, 0xcd, 0x80, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f 38 cd 80 78 56 34 12 \tsha256msg2 0x12345678(%rax),%xmm0",},
{{0x0f, 0x38, 0xcd, 0x85, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f 38 cd 85 78 56 34 12 \tsha256msg2 0x12345678(%rbp),%xmm0",},
{{0x0f, 0x38, 0xcd, 0x84, 0x01, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 cd 84 01 78 56 34 12 \tsha256msg2 0x12345678(%rcx,%rax,1),%xmm0",},
{{0x0f, 0x38, 0xcd, 0x84, 0x05, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 cd 84 05 78 56 34 12 \tsha256msg2 0x12345678(%rbp,%rax,1),%xmm0",},
{{0x0f, 0x38, 0xcd, 0x84, 0x08, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 cd 84 08 78 56 34 12 \tsha256msg2 0x12345678(%rax,%rcx,1),%xmm0",},
{{0x0f, 0x38, 0xcd, 0x84, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"0f 38 cd 84 c8 78 56 34 12 \tsha256msg2 0x12345678(%rax,%rcx,8),%xmm0",},
{{0x44, 0x0f, 0x38, 0xcd, 0xbc, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 10, 0, "", "",
"44 0f 38 cd bc c8 78 56 34 12 \tsha256msg2 0x12345678(%rax,%rcx,8),%xmm15",},
{{0x66, 0x0f, 0xae, 0x38, }, 4, 0, "", "",
"66 0f ae 38 \tclflushopt (%rax)",},
{{0x66, 0x41, 0x0f, 0xae, 0x38, }, 5, 0, "", "",
"66 41 0f ae 38 \tclflushopt (%r8)",},
{{0x66, 0x0f, 0xae, 0x3c, 0x25, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"66 0f ae 3c 25 78 56 34 12 \tclflushopt 0x12345678",},
{{0x66, 0x0f, 0xae, 0xbc, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"66 0f ae bc c8 78 56 34 12 \tclflushopt 0x12345678(%rax,%rcx,8)",},
{{0x66, 0x41, 0x0f, 0xae, 0xbc, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 10, 0, "", "",
"66 41 0f ae bc c8 78 56 34 12 \tclflushopt 0x12345678(%r8,%rcx,8)",},
{{0x0f, 0xae, 0x38, }, 3, 0, "", "",
"0f ae 38 \tclflush (%rax)",},
{{0x41, 0x0f, 0xae, 0x38, }, 4, 0, "", "",
"41 0f ae 38 \tclflush (%r8)",},
{{0x0f, 0xae, 0xf8, }, 3, 0, "", "",
"0f ae f8 \tsfence ",},
{{0x66, 0x0f, 0xae, 0x30, }, 4, 0, "", "",
"66 0f ae 30 \tclwb (%rax)",},
{{0x66, 0x41, 0x0f, 0xae, 0x30, }, 5, 0, "", "",
"66 41 0f ae 30 \tclwb (%r8)",},
{{0x66, 0x0f, 0xae, 0x34, 0x25, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"66 0f ae 34 25 78 56 34 12 \tclwb 0x12345678",},
{{0x66, 0x0f, 0xae, 0xb4, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"66 0f ae b4 c8 78 56 34 12 \tclwb 0x12345678(%rax,%rcx,8)",},
{{0x66, 0x41, 0x0f, 0xae, 0xb4, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 10, 0, "", "",
"66 41 0f ae b4 c8 78 56 34 12 \tclwb 0x12345678(%r8,%rcx,8)",},
{{0x0f, 0xae, 0x30, }, 3, 0, "", "",
"0f ae 30 \txsaveopt (%rax)",},
{{0x41, 0x0f, 0xae, 0x30, }, 4, 0, "", "",
"41 0f ae 30 \txsaveopt (%r8)",},
{{0x0f, 0xae, 0xf0, }, 3, 0, "", "",
"0f ae f0 \tmfence ",},
{{0x0f, 0xc7, 0x20, }, 3, 0, "", "",
"0f c7 20 \txsavec (%rax)",},
{{0x41, 0x0f, 0xc7, 0x20, }, 4, 0, "", "",
"41 0f c7 20 \txsavec (%r8)",},
{{0x0f, 0xc7, 0x24, 0x25, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f c7 24 25 78 56 34 12 \txsavec 0x12345678",},
{{0x0f, 0xc7, 0xa4, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f c7 a4 c8 78 56 34 12 \txsavec 0x12345678(%rax,%rcx,8)",},
{{0x41, 0x0f, 0xc7, 0xa4, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"41 0f c7 a4 c8 78 56 34 12 \txsavec 0x12345678(%r8,%rcx,8)",},
{{0x0f, 0xc7, 0x28, }, 3, 0, "", "",
"0f c7 28 \txsaves (%rax)",},
{{0x41, 0x0f, 0xc7, 0x28, }, 4, 0, "", "",
"41 0f c7 28 \txsaves (%r8)",},
{{0x0f, 0xc7, 0x2c, 0x25, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f c7 2c 25 78 56 34 12 \txsaves 0x12345678",},
{{0x0f, 0xc7, 0xac, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f c7 ac c8 78 56 34 12 \txsaves 0x12345678(%rax,%rcx,8)",},
{{0x41, 0x0f, 0xc7, 0xac, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"41 0f c7 ac c8 78 56 34 12 \txsaves 0x12345678(%r8,%rcx,8)",},
{{0x0f, 0xc7, 0x18, }, 3, 0, "", "",
"0f c7 18 \txrstors (%rax)",},
{{0x41, 0x0f, 0xc7, 0x18, }, 4, 0, "", "",
"41 0f c7 18 \txrstors (%r8)",},
{{0x0f, 0xc7, 0x1c, 0x25, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f c7 1c 25 78 56 34 12 \txrstors 0x12345678",},
{{0x0f, 0xc7, 0x9c, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 8, 0, "", "",
"0f c7 9c c8 78 56 34 12 \txrstors 0x12345678(%rax,%rcx,8)",},
{{0x41, 0x0f, 0xc7, 0x9c, 0xc8, 0x78, 0x56, 0x34, 0x12, }, 9, 0, "", "",
"41 0f c7 9c c8 78 56 34 12 \txrstors 0x12345678(%r8,%rcx,8)",},
{{0x66, 0x0f, 0xae, 0xf8, }, 4, 0, "", "",
"66 0f ae f8 \tpcommit ",},

View File

@@ -0,0 +1,877 @@
/*
* This file contains instructions for testing by the test titled:
*
* "Test x86 instruction decoder - new instructions"
*
* Note that the 'Expecting' comment lines are consumed by the
* gen-insn-x86-dat.awk script and have the format:
*
* Expecting: <op> <branch> <rel>
*
* If this file is changed, remember to run the gen-insn-x86-dat.sh
* script and commit the result.
*
* Refer to insn-x86.c for more details.
*/
int main(void)
{
/* Following line is a marker for the awk script - do not change */
asm volatile("rdtsc"); /* Start here */
#ifdef __x86_64__
/* bndmk m64, bnd */
asm volatile("bndmk (%rax), %bnd0");
asm volatile("bndmk (%r8), %bnd0");
asm volatile("bndmk (0x12345678), %bnd0");
asm volatile("bndmk (%rax), %bnd3");
asm volatile("bndmk (%rcx,%rax,1), %bnd0");
asm volatile("bndmk 0x12345678(,%rax,1), %bnd0");
asm volatile("bndmk (%rax,%rcx,1), %bnd0");
asm volatile("bndmk (%rax,%rcx,8), %bnd0");
asm volatile("bndmk 0x12(%rax), %bnd0");
asm volatile("bndmk 0x12(%rbp), %bnd0");
asm volatile("bndmk 0x12(%rcx,%rax,1), %bnd0");
asm volatile("bndmk 0x12(%rbp,%rax,1), %bnd0");
asm volatile("bndmk 0x12(%rax,%rcx,1), %bnd0");
asm volatile("bndmk 0x12(%rax,%rcx,8), %bnd0");
asm volatile("bndmk 0x12345678(%rax), %bnd0");
asm volatile("bndmk 0x12345678(%rbp), %bnd0");
asm volatile("bndmk 0x12345678(%rcx,%rax,1), %bnd0");
asm volatile("bndmk 0x12345678(%rbp,%rax,1), %bnd0");
asm volatile("bndmk 0x12345678(%rax,%rcx,1), %bnd0");
asm volatile("bndmk 0x12345678(%rax,%rcx,8), %bnd0");
/* bndcl r/m64, bnd */
asm volatile("bndcl (%rax), %bnd0");
asm volatile("bndcl (%r8), %bnd0");
asm volatile("bndcl (0x12345678), %bnd0");
asm volatile("bndcl (%rax), %bnd3");
asm volatile("bndcl (%rcx,%rax,1), %bnd0");
asm volatile("bndcl 0x12345678(,%rax,1), %bnd0");
asm volatile("bndcl (%rax,%rcx,1), %bnd0");
asm volatile("bndcl (%rax,%rcx,8), %bnd0");
asm volatile("bndcl 0x12(%rax), %bnd0");
asm volatile("bndcl 0x12(%rbp), %bnd0");
asm volatile("bndcl 0x12(%rcx,%rax,1), %bnd0");
asm volatile("bndcl 0x12(%rbp,%rax,1), %bnd0");
asm volatile("bndcl 0x12(%rax,%rcx,1), %bnd0");
asm volatile("bndcl 0x12(%rax,%rcx,8), %bnd0");
asm volatile("bndcl 0x12345678(%rax), %bnd0");
asm volatile("bndcl 0x12345678(%rbp), %bnd0");
asm volatile("bndcl 0x12345678(%rcx,%rax,1), %bnd0");
asm volatile("bndcl 0x12345678(%rbp,%rax,1), %bnd0");
asm volatile("bndcl 0x12345678(%rax,%rcx,1), %bnd0");
asm volatile("bndcl 0x12345678(%rax,%rcx,8), %bnd0");
asm volatile("bndcl %rax, %bnd0");
/* bndcu r/m64, bnd */
asm volatile("bndcu (%rax), %bnd0");
asm volatile("bndcu (%r8), %bnd0");
asm volatile("bndcu (0x12345678), %bnd0");
asm volatile("bndcu (%rax), %bnd3");
asm volatile("bndcu (%rcx,%rax,1), %bnd0");
asm volatile("bndcu 0x12345678(,%rax,1), %bnd0");
asm volatile("bndcu (%rax,%rcx,1), %bnd0");
asm volatile("bndcu (%rax,%rcx,8), %bnd0");
asm volatile("bndcu 0x12(%rax), %bnd0");
asm volatile("bndcu 0x12(%rbp), %bnd0");
asm volatile("bndcu 0x12(%rcx,%rax,1), %bnd0");
asm volatile("bndcu 0x12(%rbp,%rax,1), %bnd0");
asm volatile("bndcu 0x12(%rax,%rcx,1), %bnd0");
asm volatile("bndcu 0x12(%rax,%rcx,8), %bnd0");
asm volatile("bndcu 0x12345678(%rax), %bnd0");
asm volatile("bndcu 0x12345678(%rbp), %bnd0");
asm volatile("bndcu 0x12345678(%rcx,%rax,1), %bnd0");
asm volatile("bndcu 0x12345678(%rbp,%rax,1), %bnd0");
asm volatile("bndcu 0x12345678(%rax,%rcx,1), %bnd0");
asm volatile("bndcu 0x12345678(%rax,%rcx,8), %bnd0");
asm volatile("bndcu %rax, %bnd0");
/* bndcn r/m64, bnd */
asm volatile("bndcn (%rax), %bnd0");
asm volatile("bndcn (%r8), %bnd0");
asm volatile("bndcn (0x12345678), %bnd0");
asm volatile("bndcn (%rax), %bnd3");
asm volatile("bndcn (%rcx,%rax,1), %bnd0");
asm volatile("bndcn 0x12345678(,%rax,1), %bnd0");
asm volatile("bndcn (%rax,%rcx,1), %bnd0");
asm volatile("bndcn (%rax,%rcx,8), %bnd0");
asm volatile("bndcn 0x12(%rax), %bnd0");
asm volatile("bndcn 0x12(%rbp), %bnd0");
asm volatile("bndcn 0x12(%rcx,%rax,1), %bnd0");
asm volatile("bndcn 0x12(%rbp,%rax,1), %bnd0");
asm volatile("bndcn 0x12(%rax,%rcx,1), %bnd0");
asm volatile("bndcn 0x12(%rax,%rcx,8), %bnd0");
asm volatile("bndcn 0x12345678(%rax), %bnd0");
asm volatile("bndcn 0x12345678(%rbp), %bnd0");
asm volatile("bndcn 0x12345678(%rcx,%rax,1), %bnd0");
asm volatile("bndcn 0x12345678(%rbp,%rax,1), %bnd0");
asm volatile("bndcn 0x12345678(%rax,%rcx,1), %bnd0");
asm volatile("bndcn 0x12345678(%rax,%rcx,8), %bnd0");
asm volatile("bndcn %rax, %bnd0");
/* bndmov m128, bnd */
asm volatile("bndmov (%rax), %bnd0");
asm volatile("bndmov (%r8), %bnd0");
asm volatile("bndmov (0x12345678), %bnd0");
asm volatile("bndmov (%rax), %bnd3");
asm volatile("bndmov (%rcx,%rax,1), %bnd0");
asm volatile("bndmov 0x12345678(,%rax,1), %bnd0");
asm volatile("bndmov (%rax,%rcx,1), %bnd0");
asm volatile("bndmov (%rax,%rcx,8), %bnd0");
asm volatile("bndmov 0x12(%rax), %bnd0");
asm volatile("bndmov 0x12(%rbp), %bnd0");
asm volatile("bndmov 0x12(%rcx,%rax,1), %bnd0");
asm volatile("bndmov 0x12(%rbp,%rax,1), %bnd0");
asm volatile("bndmov 0x12(%rax,%rcx,1), %bnd0");
asm volatile("bndmov 0x12(%rax,%rcx,8), %bnd0");
asm volatile("bndmov 0x12345678(%rax), %bnd0");
asm volatile("bndmov 0x12345678(%rbp), %bnd0");
asm volatile("bndmov 0x12345678(%rcx,%rax,1), %bnd0");
asm volatile("bndmov 0x12345678(%rbp,%rax,1), %bnd0");
asm volatile("bndmov 0x12345678(%rax,%rcx,1), %bnd0");
asm volatile("bndmov 0x12345678(%rax,%rcx,8), %bnd0");
/* bndmov bnd, m128 */
asm volatile("bndmov %bnd0, (%rax)");
asm volatile("bndmov %bnd0, (%r8)");
asm volatile("bndmov %bnd0, (0x12345678)");
asm volatile("bndmov %bnd3, (%rax)");
asm volatile("bndmov %bnd0, (%rcx,%rax,1)");
asm volatile("bndmov %bnd0, 0x12345678(,%rax,1)");
asm volatile("bndmov %bnd0, (%rax,%rcx,1)");
asm volatile("bndmov %bnd0, (%rax,%rcx,8)");
asm volatile("bndmov %bnd0, 0x12(%rax)");
asm volatile("bndmov %bnd0, 0x12(%rbp)");
asm volatile("bndmov %bnd0, 0x12(%rcx,%rax,1)");
asm volatile("bndmov %bnd0, 0x12(%rbp,%rax,1)");
asm volatile("bndmov %bnd0, 0x12(%rax,%rcx,1)");
asm volatile("bndmov %bnd0, 0x12(%rax,%rcx,8)");
asm volatile("bndmov %bnd0, 0x12345678(%rax)");
asm volatile("bndmov %bnd0, 0x12345678(%rbp)");
asm volatile("bndmov %bnd0, 0x12345678(%rcx,%rax,1)");
asm volatile("bndmov %bnd0, 0x12345678(%rbp,%rax,1)");
asm volatile("bndmov %bnd0, 0x12345678(%rax,%rcx,1)");
asm volatile("bndmov %bnd0, 0x12345678(%rax,%rcx,8)");
/* bndmov bnd2, bnd1 */
asm volatile("bndmov %bnd0, %bnd1");
asm volatile("bndmov %bnd1, %bnd0");
/* bndldx mib, bnd */
asm volatile("bndldx (%rax), %bnd0");
asm volatile("bndldx (%r8), %bnd0");
asm volatile("bndldx (0x12345678), %bnd0");
asm volatile("bndldx (%rax), %bnd3");
asm volatile("bndldx (%rcx,%rax,1), %bnd0");
asm volatile("bndldx 0x12345678(,%rax,1), %bnd0");
asm volatile("bndldx (%rax,%rcx,1), %bnd0");
asm volatile("bndldx 0x12(%rax), %bnd0");
asm volatile("bndldx 0x12(%rbp), %bnd0");
asm volatile("bndldx 0x12(%rcx,%rax,1), %bnd0");
asm volatile("bndldx 0x12(%rbp,%rax,1), %bnd0");
asm volatile("bndldx 0x12(%rax,%rcx,1), %bnd0");
asm volatile("bndldx 0x12345678(%rax), %bnd0");
asm volatile("bndldx 0x12345678(%rbp), %bnd0");
asm volatile("bndldx 0x12345678(%rcx,%rax,1), %bnd0");
asm volatile("bndldx 0x12345678(%rbp,%rax,1), %bnd0");
asm volatile("bndldx 0x12345678(%rax,%rcx,1), %bnd0");
/* bndstx bnd, mib */
asm volatile("bndstx %bnd0, (%rax)");
asm volatile("bndstx %bnd0, (%r8)");
asm volatile("bndstx %bnd0, (0x12345678)");
asm volatile("bndstx %bnd3, (%rax)");
asm volatile("bndstx %bnd0, (%rcx,%rax,1)");
asm volatile("bndstx %bnd0, 0x12345678(,%rax,1)");
asm volatile("bndstx %bnd0, (%rax,%rcx,1)");
asm volatile("bndstx %bnd0, 0x12(%rax)");
asm volatile("bndstx %bnd0, 0x12(%rbp)");
asm volatile("bndstx %bnd0, 0x12(%rcx,%rax,1)");
asm volatile("bndstx %bnd0, 0x12(%rbp,%rax,1)");
asm volatile("bndstx %bnd0, 0x12(%rax,%rcx,1)");
asm volatile("bndstx %bnd0, 0x12345678(%rax)");
asm volatile("bndstx %bnd0, 0x12345678(%rbp)");
asm volatile("bndstx %bnd0, 0x12345678(%rcx,%rax,1)");
asm volatile("bndstx %bnd0, 0x12345678(%rbp,%rax,1)");
asm volatile("bndstx %bnd0, 0x12345678(%rax,%rcx,1)");
/* bnd prefix on call, ret, jmp and all jcc */
asm volatile("bnd call label1"); /* Expecting: call unconditional 0 */
asm volatile("bnd call *(%eax)"); /* Expecting: call indirect 0 */
asm volatile("bnd ret"); /* Expecting: ret indirect 0 */
asm volatile("bnd jmp label1"); /* Expecting: jmp unconditional 0 */
asm volatile("bnd jmp label1"); /* Expecting: jmp unconditional 0 */
asm volatile("bnd jmp *(%ecx)"); /* Expecting: jmp indirect 0 */
asm volatile("bnd jne label1"); /* Expecting: jcc conditional 0 */
/* sha1rnds4 imm8, xmm2/m128, xmm1 */
asm volatile("sha1rnds4 $0x0, %xmm1, %xmm0");
asm volatile("sha1rnds4 $0x91, %xmm7, %xmm2");
asm volatile("sha1rnds4 $0x91, %xmm8, %xmm0");
asm volatile("sha1rnds4 $0x91, %xmm7, %xmm8");
asm volatile("sha1rnds4 $0x91, %xmm15, %xmm8");
asm volatile("sha1rnds4 $0x91, (%rax), %xmm0");
asm volatile("sha1rnds4 $0x91, (%r8), %xmm0");
asm volatile("sha1rnds4 $0x91, (0x12345678), %xmm0");
asm volatile("sha1rnds4 $0x91, (%rax), %xmm3");
asm volatile("sha1rnds4 $0x91, (%rcx,%rax,1), %xmm0");
asm volatile("sha1rnds4 $0x91, 0x12345678(,%rax,1), %xmm0");
asm volatile("sha1rnds4 $0x91, (%rax,%rcx,1), %xmm0");
asm volatile("sha1rnds4 $0x91, (%rax,%rcx,8), %xmm0");
asm volatile("sha1rnds4 $0x91, 0x12(%rax), %xmm0");
asm volatile("sha1rnds4 $0x91, 0x12(%rbp), %xmm0");
asm volatile("sha1rnds4 $0x91, 0x12(%rcx,%rax,1), %xmm0");
asm volatile("sha1rnds4 $0x91, 0x12(%rbp,%rax,1), %xmm0");
asm volatile("sha1rnds4 $0x91, 0x12(%rax,%rcx,1), %xmm0");
asm volatile("sha1rnds4 $0x91, 0x12(%rax,%rcx,8), %xmm0");
asm volatile("sha1rnds4 $0x91, 0x12345678(%rax), %xmm0");
asm volatile("sha1rnds4 $0x91, 0x12345678(%rbp), %xmm0");
asm volatile("sha1rnds4 $0x91, 0x12345678(%rcx,%rax,1), %xmm0");
asm volatile("sha1rnds4 $0x91, 0x12345678(%rbp,%rax,1), %xmm0");
asm volatile("sha1rnds4 $0x91, 0x12345678(%rax,%rcx,1), %xmm0");
asm volatile("sha1rnds4 $0x91, 0x12345678(%rax,%rcx,8), %xmm0");
asm volatile("sha1rnds4 $0x91, 0x12345678(%rax,%rcx,8), %xmm15");
/* sha1nexte xmm2/m128, xmm1 */
asm volatile("sha1nexte %xmm1, %xmm0");
asm volatile("sha1nexte %xmm7, %xmm2");
asm volatile("sha1nexte %xmm8, %xmm0");
asm volatile("sha1nexte %xmm7, %xmm8");
asm volatile("sha1nexte %xmm15, %xmm8");
asm volatile("sha1nexte (%rax), %xmm0");
asm volatile("sha1nexte (%r8), %xmm0");
asm volatile("sha1nexte (0x12345678), %xmm0");
asm volatile("sha1nexte (%rax), %xmm3");
asm volatile("sha1nexte (%rcx,%rax,1), %xmm0");
asm volatile("sha1nexte 0x12345678(,%rax,1), %xmm0");
asm volatile("sha1nexte (%rax,%rcx,1), %xmm0");
asm volatile("sha1nexte (%rax,%rcx,8), %xmm0");
asm volatile("sha1nexte 0x12(%rax), %xmm0");
asm volatile("sha1nexte 0x12(%rbp), %xmm0");
asm volatile("sha1nexte 0x12(%rcx,%rax,1), %xmm0");
asm volatile("sha1nexte 0x12(%rbp,%rax,1), %xmm0");
asm volatile("sha1nexte 0x12(%rax,%rcx,1), %xmm0");
asm volatile("sha1nexte 0x12(%rax,%rcx,8), %xmm0");
asm volatile("sha1nexte 0x12345678(%rax), %xmm0");
asm volatile("sha1nexte 0x12345678(%rbp), %xmm0");
asm volatile("sha1nexte 0x12345678(%rcx,%rax,1), %xmm0");
asm volatile("sha1nexte 0x12345678(%rbp,%rax,1), %xmm0");
asm volatile("sha1nexte 0x12345678(%rax,%rcx,1), %xmm0");
asm volatile("sha1nexte 0x12345678(%rax,%rcx,8), %xmm0");
asm volatile("sha1nexte 0x12345678(%rax,%rcx,8), %xmm15");
/* sha1msg1 xmm2/m128, xmm1 */
asm volatile("sha1msg1 %xmm1, %xmm0");
asm volatile("sha1msg1 %xmm7, %xmm2");
asm volatile("sha1msg1 %xmm8, %xmm0");
asm volatile("sha1msg1 %xmm7, %xmm8");
asm volatile("sha1msg1 %xmm15, %xmm8");
asm volatile("sha1msg1 (%rax), %xmm0");
asm volatile("sha1msg1 (%r8), %xmm0");
asm volatile("sha1msg1 (0x12345678), %xmm0");
asm volatile("sha1msg1 (%rax), %xmm3");
asm volatile("sha1msg1 (%rcx,%rax,1), %xmm0");
asm volatile("sha1msg1 0x12345678(,%rax,1), %xmm0");
asm volatile("sha1msg1 (%rax,%rcx,1), %xmm0");
asm volatile("sha1msg1 (%rax,%rcx,8), %xmm0");
asm volatile("sha1msg1 0x12(%rax), %xmm0");
asm volatile("sha1msg1 0x12(%rbp), %xmm0");
asm volatile("sha1msg1 0x12(%rcx,%rax,1), %xmm0");
asm volatile("sha1msg1 0x12(%rbp,%rax,1), %xmm0");
asm volatile("sha1msg1 0x12(%rax,%rcx,1), %xmm0");
asm volatile("sha1msg1 0x12(%rax,%rcx,8), %xmm0");
asm volatile("sha1msg1 0x12345678(%rax), %xmm0");
asm volatile("sha1msg1 0x12345678(%rbp), %xmm0");
asm volatile("sha1msg1 0x12345678(%rcx,%rax,1), %xmm0");
asm volatile("sha1msg1 0x12345678(%rbp,%rax,1), %xmm0");
asm volatile("sha1msg1 0x12345678(%rax,%rcx,1), %xmm0");
asm volatile("sha1msg1 0x12345678(%rax,%rcx,8), %xmm0");
asm volatile("sha1msg1 0x12345678(%rax,%rcx,8), %xmm15");
/* sha1msg2 xmm2/m128, xmm1 */
asm volatile("sha1msg2 %xmm1, %xmm0");
asm volatile("sha1msg2 %xmm7, %xmm2");
asm volatile("sha1msg2 %xmm8, %xmm0");
asm volatile("sha1msg2 %xmm7, %xmm8");
asm volatile("sha1msg2 %xmm15, %xmm8");
asm volatile("sha1msg2 (%rax), %xmm0");
asm volatile("sha1msg2 (%r8), %xmm0");
asm volatile("sha1msg2 (0x12345678), %xmm0");
asm volatile("sha1msg2 (%rax), %xmm3");
asm volatile("sha1msg2 (%rcx,%rax,1), %xmm0");
asm volatile("sha1msg2 0x12345678(,%rax,1), %xmm0");
asm volatile("sha1msg2 (%rax,%rcx,1), %xmm0");
asm volatile("sha1msg2 (%rax,%rcx,8), %xmm0");
asm volatile("sha1msg2 0x12(%rax), %xmm0");
asm volatile("sha1msg2 0x12(%rbp), %xmm0");
asm volatile("sha1msg2 0x12(%rcx,%rax,1), %xmm0");
asm volatile("sha1msg2 0x12(%rbp,%rax,1), %xmm0");
asm volatile("sha1msg2 0x12(%rax,%rcx,1), %xmm0");
asm volatile("sha1msg2 0x12(%rax,%rcx,8), %xmm0");
asm volatile("sha1msg2 0x12345678(%rax), %xmm0");
asm volatile("sha1msg2 0x12345678(%rbp), %xmm0");
asm volatile("sha1msg2 0x12345678(%rcx,%rax,1), %xmm0");
asm volatile("sha1msg2 0x12345678(%rbp,%rax,1), %xmm0");
asm volatile("sha1msg2 0x12345678(%rax,%rcx,1), %xmm0");
asm volatile("sha1msg2 0x12345678(%rax,%rcx,8), %xmm0");
asm volatile("sha1msg2 0x12345678(%rax,%rcx,8), %xmm15");
/* sha256rnds2 <XMM0>, xmm2/m128, xmm1 */
/* Note sha256rnds2 has an implicit operand 'xmm0' */
asm volatile("sha256rnds2 %xmm4, %xmm1");
asm volatile("sha256rnds2 %xmm7, %xmm2");
asm volatile("sha256rnds2 %xmm8, %xmm1");
asm volatile("sha256rnds2 %xmm7, %xmm8");
asm volatile("sha256rnds2 %xmm15, %xmm8");
asm volatile("sha256rnds2 (%rax), %xmm1");
asm volatile("sha256rnds2 (%r8), %xmm1");
asm volatile("sha256rnds2 (0x12345678), %xmm1");
asm volatile("sha256rnds2 (%rax), %xmm3");
asm volatile("sha256rnds2 (%rcx,%rax,1), %xmm1");
asm volatile("sha256rnds2 0x12345678(,%rax,1), %xmm1");
asm volatile("sha256rnds2 (%rax,%rcx,1), %xmm1");
asm volatile("sha256rnds2 (%rax,%rcx,8), %xmm1");
asm volatile("sha256rnds2 0x12(%rax), %xmm1");
asm volatile("sha256rnds2 0x12(%rbp), %xmm1");
asm volatile("sha256rnds2 0x12(%rcx,%rax,1), %xmm1");
asm volatile("sha256rnds2 0x12(%rbp,%rax,1), %xmm1");
asm volatile("sha256rnds2 0x12(%rax,%rcx,1), %xmm1");
asm volatile("sha256rnds2 0x12(%rax,%rcx,8), %xmm1");
asm volatile("sha256rnds2 0x12345678(%rax), %xmm1");
asm volatile("sha256rnds2 0x12345678(%rbp), %xmm1");
asm volatile("sha256rnds2 0x12345678(%rcx,%rax,1), %xmm1");
asm volatile("sha256rnds2 0x12345678(%rbp,%rax,1), %xmm1");
asm volatile("sha256rnds2 0x12345678(%rax,%rcx,1), %xmm1");
asm volatile("sha256rnds2 0x12345678(%rax,%rcx,8), %xmm1");
asm volatile("sha256rnds2 0x12345678(%rax,%rcx,8), %xmm15");
/* sha256msg1 xmm2/m128, xmm1 */
asm volatile("sha256msg1 %xmm1, %xmm0");
asm volatile("sha256msg1 %xmm7, %xmm2");
asm volatile("sha256msg1 %xmm8, %xmm0");
asm volatile("sha256msg1 %xmm7, %xmm8");
asm volatile("sha256msg1 %xmm15, %xmm8");
asm volatile("sha256msg1 (%rax), %xmm0");
asm volatile("sha256msg1 (%r8), %xmm0");
asm volatile("sha256msg1 (0x12345678), %xmm0");
asm volatile("sha256msg1 (%rax), %xmm3");
asm volatile("sha256msg1 (%rcx,%rax,1), %xmm0");
asm volatile("sha256msg1 0x12345678(,%rax,1), %xmm0");
asm volatile("sha256msg1 (%rax,%rcx,1), %xmm0");
asm volatile("sha256msg1 (%rax,%rcx,8), %xmm0");
asm volatile("sha256msg1 0x12(%rax), %xmm0");
asm volatile("sha256msg1 0x12(%rbp), %xmm0");
asm volatile("sha256msg1 0x12(%rcx,%rax,1), %xmm0");
asm volatile("sha256msg1 0x12(%rbp,%rax,1), %xmm0");
asm volatile("sha256msg1 0x12(%rax,%rcx,1), %xmm0");
asm volatile("sha256msg1 0x12(%rax,%rcx,8), %xmm0");
asm volatile("sha256msg1 0x12345678(%rax), %xmm0");
asm volatile("sha256msg1 0x12345678(%rbp), %xmm0");
asm volatile("sha256msg1 0x12345678(%rcx,%rax,1), %xmm0");
asm volatile("sha256msg1 0x12345678(%rbp,%rax,1), %xmm0");
asm volatile("sha256msg1 0x12345678(%rax,%rcx,1), %xmm0");
asm volatile("sha256msg1 0x12345678(%rax,%rcx,8), %xmm0");
asm volatile("sha256msg1 0x12345678(%rax,%rcx,8), %xmm15");
/* sha256msg2 xmm2/m128, xmm1 */
asm volatile("sha256msg2 %xmm1, %xmm0");
asm volatile("sha256msg2 %xmm7, %xmm2");
asm volatile("sha256msg2 %xmm8, %xmm0");
asm volatile("sha256msg2 %xmm7, %xmm8");
asm volatile("sha256msg2 %xmm15, %xmm8");
asm volatile("sha256msg2 (%rax), %xmm0");
asm volatile("sha256msg2 (%r8), %xmm0");
asm volatile("sha256msg2 (0x12345678), %xmm0");
asm volatile("sha256msg2 (%rax), %xmm3");
asm volatile("sha256msg2 (%rcx,%rax,1), %xmm0");
asm volatile("sha256msg2 0x12345678(,%rax,1), %xmm0");
asm volatile("sha256msg2 (%rax,%rcx,1), %xmm0");
asm volatile("sha256msg2 (%rax,%rcx,8), %xmm0");
asm volatile("sha256msg2 0x12(%rax), %xmm0");
asm volatile("sha256msg2 0x12(%rbp), %xmm0");
asm volatile("sha256msg2 0x12(%rcx,%rax,1), %xmm0");
asm volatile("sha256msg2 0x12(%rbp,%rax,1), %xmm0");
asm volatile("sha256msg2 0x12(%rax,%rcx,1), %xmm0");
asm volatile("sha256msg2 0x12(%rax,%rcx,8), %xmm0");
asm volatile("sha256msg2 0x12345678(%rax), %xmm0");
asm volatile("sha256msg2 0x12345678(%rbp), %xmm0");
asm volatile("sha256msg2 0x12345678(%rcx,%rax,1), %xmm0");
asm volatile("sha256msg2 0x12345678(%rbp,%rax,1), %xmm0");
asm volatile("sha256msg2 0x12345678(%rax,%rcx,1), %xmm0");
asm volatile("sha256msg2 0x12345678(%rax,%rcx,8), %xmm0");
asm volatile("sha256msg2 0x12345678(%rax,%rcx,8), %xmm15");
/* clflushopt m8 */
asm volatile("clflushopt (%rax)");
asm volatile("clflushopt (%r8)");
asm volatile("clflushopt (0x12345678)");
asm volatile("clflushopt 0x12345678(%rax,%rcx,8)");
asm volatile("clflushopt 0x12345678(%r8,%rcx,8)");
/* Also check instructions in the same group encoding as clflushopt */
asm volatile("clflush (%rax)");
asm volatile("clflush (%r8)");
asm volatile("sfence");
/* clwb m8 */
asm volatile("clwb (%rax)");
asm volatile("clwb (%r8)");
asm volatile("clwb (0x12345678)");
asm volatile("clwb 0x12345678(%rax,%rcx,8)");
asm volatile("clwb 0x12345678(%r8,%rcx,8)");
/* Also check instructions in the same group encoding as clwb */
asm volatile("xsaveopt (%rax)");
asm volatile("xsaveopt (%r8)");
asm volatile("mfence");
/* xsavec mem */
asm volatile("xsavec (%rax)");
asm volatile("xsavec (%r8)");
asm volatile("xsavec (0x12345678)");
asm volatile("xsavec 0x12345678(%rax,%rcx,8)");
asm volatile("xsavec 0x12345678(%r8,%rcx,8)");
/* xsaves mem */
asm volatile("xsaves (%rax)");
asm volatile("xsaves (%r8)");
asm volatile("xsaves (0x12345678)");
asm volatile("xsaves 0x12345678(%rax,%rcx,8)");
asm volatile("xsaves 0x12345678(%r8,%rcx,8)");
/* xrstors mem */
asm volatile("xrstors (%rax)");
asm volatile("xrstors (%r8)");
asm volatile("xrstors (0x12345678)");
asm volatile("xrstors 0x12345678(%rax,%rcx,8)");
asm volatile("xrstors 0x12345678(%r8,%rcx,8)");
#else /* #ifdef __x86_64__ */
/* bndmk m32, bnd */
asm volatile("bndmk (%eax), %bnd0");
asm volatile("bndmk (0x12345678), %bnd0");
asm volatile("bndmk (%eax), %bnd3");
asm volatile("bndmk (%ecx,%eax,1), %bnd0");
asm volatile("bndmk 0x12345678(,%eax,1), %bnd0");
asm volatile("bndmk (%eax,%ecx,1), %bnd0");
asm volatile("bndmk (%eax,%ecx,8), %bnd0");
asm volatile("bndmk 0x12(%eax), %bnd0");
asm volatile("bndmk 0x12(%ebp), %bnd0");
asm volatile("bndmk 0x12(%ecx,%eax,1), %bnd0");
asm volatile("bndmk 0x12(%ebp,%eax,1), %bnd0");
asm volatile("bndmk 0x12(%eax,%ecx,1), %bnd0");
asm volatile("bndmk 0x12(%eax,%ecx,8), %bnd0");
asm volatile("bndmk 0x12345678(%eax), %bnd0");
asm volatile("bndmk 0x12345678(%ebp), %bnd0");
asm volatile("bndmk 0x12345678(%ecx,%eax,1), %bnd0");
asm volatile("bndmk 0x12345678(%ebp,%eax,1), %bnd0");
asm volatile("bndmk 0x12345678(%eax,%ecx,1), %bnd0");
asm volatile("bndmk 0x12345678(%eax,%ecx,8), %bnd0");
/* bndcl r/m32, bnd */
asm volatile("bndcl (%eax), %bnd0");
asm volatile("bndcl (0x12345678), %bnd0");
asm volatile("bndcl (%eax), %bnd3");
asm volatile("bndcl (%ecx,%eax,1), %bnd0");
asm volatile("bndcl 0x12345678(,%eax,1), %bnd0");
asm volatile("bndcl (%eax,%ecx,1), %bnd0");
asm volatile("bndcl (%eax,%ecx,8), %bnd0");
asm volatile("bndcl 0x12(%eax), %bnd0");
asm volatile("bndcl 0x12(%ebp), %bnd0");
asm volatile("bndcl 0x12(%ecx,%eax,1), %bnd0");
asm volatile("bndcl 0x12(%ebp,%eax,1), %bnd0");
asm volatile("bndcl 0x12(%eax,%ecx,1), %bnd0");
asm volatile("bndcl 0x12(%eax,%ecx,8), %bnd0");
asm volatile("bndcl 0x12345678(%eax), %bnd0");
asm volatile("bndcl 0x12345678(%ebp), %bnd0");
asm volatile("bndcl 0x12345678(%ecx,%eax,1), %bnd0");
asm volatile("bndcl 0x12345678(%ebp,%eax,1), %bnd0");
asm volatile("bndcl 0x12345678(%eax,%ecx,1), %bnd0");
asm volatile("bndcl 0x12345678(%eax,%ecx,8), %bnd0");
asm volatile("bndcl %eax, %bnd0");
/* bndcu r/m32, bnd */
asm volatile("bndcu (%eax), %bnd0");
asm volatile("bndcu (0x12345678), %bnd0");
asm volatile("bndcu (%eax), %bnd3");
asm volatile("bndcu (%ecx,%eax,1), %bnd0");
asm volatile("bndcu 0x12345678(,%eax,1), %bnd0");
asm volatile("bndcu (%eax,%ecx,1), %bnd0");
asm volatile("bndcu (%eax,%ecx,8), %bnd0");
asm volatile("bndcu 0x12(%eax), %bnd0");
asm volatile("bndcu 0x12(%ebp), %bnd0");
asm volatile("bndcu 0x12(%ecx,%eax,1), %bnd0");
asm volatile("bndcu 0x12(%ebp,%eax,1), %bnd0");
asm volatile("bndcu 0x12(%eax,%ecx,1), %bnd0");
asm volatile("bndcu 0x12(%eax,%ecx,8), %bnd0");
asm volatile("bndcu 0x12345678(%eax), %bnd0");
asm volatile("bndcu 0x12345678(%ebp), %bnd0");
asm volatile("bndcu 0x12345678(%ecx,%eax,1), %bnd0");
asm volatile("bndcu 0x12345678(%ebp,%eax,1), %bnd0");
asm volatile("bndcu 0x12345678(%eax,%ecx,1), %bnd0");
asm volatile("bndcu 0x12345678(%eax,%ecx,8), %bnd0");
asm volatile("bndcu %eax, %bnd0");
/* bndcn r/m32, bnd */
asm volatile("bndcn (%eax), %bnd0");
asm volatile("bndcn (0x12345678), %bnd0");
asm volatile("bndcn (%eax), %bnd3");
asm volatile("bndcn (%ecx,%eax,1), %bnd0");
asm volatile("bndcn 0x12345678(,%eax,1), %bnd0");
asm volatile("bndcn (%eax,%ecx,1), %bnd0");
asm volatile("bndcn (%eax,%ecx,8), %bnd0");
asm volatile("bndcn 0x12(%eax), %bnd0");
asm volatile("bndcn 0x12(%ebp), %bnd0");
asm volatile("bndcn 0x12(%ecx,%eax,1), %bnd0");
asm volatile("bndcn 0x12(%ebp,%eax,1), %bnd0");
asm volatile("bndcn 0x12(%eax,%ecx,1), %bnd0");
asm volatile("bndcn 0x12(%eax,%ecx,8), %bnd0");
asm volatile("bndcn 0x12345678(%eax), %bnd0");
asm volatile("bndcn 0x12345678(%ebp), %bnd0");
asm volatile("bndcn 0x12345678(%ecx,%eax,1), %bnd0");
asm volatile("bndcn 0x12345678(%ebp,%eax,1), %bnd0");
asm volatile("bndcn 0x12345678(%eax,%ecx,1), %bnd0");
asm volatile("bndcn 0x12345678(%eax,%ecx,8), %bnd0");
asm volatile("bndcn %eax, %bnd0");
/* bndmov m64, bnd */
asm volatile("bndmov (%eax), %bnd0");
asm volatile("bndmov (0x12345678), %bnd0");
asm volatile("bndmov (%eax), %bnd3");
asm volatile("bndmov (%ecx,%eax,1), %bnd0");
asm volatile("bndmov 0x12345678(,%eax,1), %bnd0");
asm volatile("bndmov (%eax,%ecx,1), %bnd0");
asm volatile("bndmov (%eax,%ecx,8), %bnd0");
asm volatile("bndmov 0x12(%eax), %bnd0");
asm volatile("bndmov 0x12(%ebp), %bnd0");
asm volatile("bndmov 0x12(%ecx,%eax,1), %bnd0");
asm volatile("bndmov 0x12(%ebp,%eax,1), %bnd0");
asm volatile("bndmov 0x12(%eax,%ecx,1), %bnd0");
asm volatile("bndmov 0x12(%eax,%ecx,8), %bnd0");
asm volatile("bndmov 0x12345678(%eax), %bnd0");
asm volatile("bndmov 0x12345678(%ebp), %bnd0");
asm volatile("bndmov 0x12345678(%ecx,%eax,1), %bnd0");
asm volatile("bndmov 0x12345678(%ebp,%eax,1), %bnd0");
asm volatile("bndmov 0x12345678(%eax,%ecx,1), %bnd0");
asm volatile("bndmov 0x12345678(%eax,%ecx,8), %bnd0");
/* bndmov bnd, m64 */
asm volatile("bndmov %bnd0, (%eax)");
asm volatile("bndmov %bnd0, (0x12345678)");
asm volatile("bndmov %bnd3, (%eax)");
asm volatile("bndmov %bnd0, (%ecx,%eax,1)");
asm volatile("bndmov %bnd0, 0x12345678(,%eax,1)");
asm volatile("bndmov %bnd0, (%eax,%ecx,1)");
asm volatile("bndmov %bnd0, (%eax,%ecx,8)");
asm volatile("bndmov %bnd0, 0x12(%eax)");
asm volatile("bndmov %bnd0, 0x12(%ebp)");
asm volatile("bndmov %bnd0, 0x12(%ecx,%eax,1)");
asm volatile("bndmov %bnd0, 0x12(%ebp,%eax,1)");
asm volatile("bndmov %bnd0, 0x12(%eax,%ecx,1)");
asm volatile("bndmov %bnd0, 0x12(%eax,%ecx,8)");
asm volatile("bndmov %bnd0, 0x12345678(%eax)");
asm volatile("bndmov %bnd0, 0x12345678(%ebp)");
asm volatile("bndmov %bnd0, 0x12345678(%ecx,%eax,1)");
asm volatile("bndmov %bnd0, 0x12345678(%ebp,%eax,1)");
asm volatile("bndmov %bnd0, 0x12345678(%eax,%ecx,1)");
asm volatile("bndmov %bnd0, 0x12345678(%eax,%ecx,8)");
/* bndmov bnd2, bnd1 */
asm volatile("bndmov %bnd0, %bnd1");
asm volatile("bndmov %bnd1, %bnd0");
/* bndldx mib, bnd */
asm volatile("bndldx (%eax), %bnd0");
asm volatile("bndldx (0x12345678), %bnd0");
asm volatile("bndldx (%eax), %bnd3");
asm volatile("bndldx (%ecx,%eax,1), %bnd0");
asm volatile("bndldx 0x12345678(,%eax,1), %bnd0");
asm volatile("bndldx (%eax,%ecx,1), %bnd0");
asm volatile("bndldx 0x12(%eax), %bnd0");
asm volatile("bndldx 0x12(%ebp), %bnd0");
asm volatile("bndldx 0x12(%ecx,%eax,1), %bnd0");
asm volatile("bndldx 0x12(%ebp,%eax,1), %bnd0");
asm volatile("bndldx 0x12(%eax,%ecx,1), %bnd0");
asm volatile("bndldx 0x12345678(%eax), %bnd0");
asm volatile("bndldx 0x12345678(%ebp), %bnd0");
asm volatile("bndldx 0x12345678(%ecx,%eax,1), %bnd0");
asm volatile("bndldx 0x12345678(%ebp,%eax,1), %bnd0");
asm volatile("bndldx 0x12345678(%eax,%ecx,1), %bnd0");
/* bndstx bnd, mib */
asm volatile("bndstx %bnd0, (%eax)");
asm volatile("bndstx %bnd0, (0x12345678)");
asm volatile("bndstx %bnd3, (%eax)");
asm volatile("bndstx %bnd0, (%ecx,%eax,1)");
asm volatile("bndstx %bnd0, 0x12345678(,%eax,1)");
asm volatile("bndstx %bnd0, (%eax,%ecx,1)");
asm volatile("bndstx %bnd0, 0x12(%eax)");
asm volatile("bndstx %bnd0, 0x12(%ebp)");
asm volatile("bndstx %bnd0, 0x12(%ecx,%eax,1)");
asm volatile("bndstx %bnd0, 0x12(%ebp,%eax,1)");
asm volatile("bndstx %bnd0, 0x12(%eax,%ecx,1)");
asm volatile("bndstx %bnd0, 0x12345678(%eax)");
asm volatile("bndstx %bnd0, 0x12345678(%ebp)");
asm volatile("bndstx %bnd0, 0x12345678(%ecx,%eax,1)");
asm volatile("bndstx %bnd0, 0x12345678(%ebp,%eax,1)");
asm volatile("bndstx %bnd0, 0x12345678(%eax,%ecx,1)");
/* bnd prefix on call, ret, jmp and all jcc */
asm volatile("bnd call label1"); /* Expecting: call unconditional 0xfffffffc */
asm volatile("bnd call *(%eax)"); /* Expecting: call indirect 0 */
asm volatile("bnd ret"); /* Expecting: ret indirect 0 */
asm volatile("bnd jmp label1"); /* Expecting: jmp unconditional 0xfffffffc */
asm volatile("bnd jmp label1"); /* Expecting: jmp unconditional 0xfffffffc */
asm volatile("bnd jmp *(%ecx)"); /* Expecting: jmp indirect 0 */
asm volatile("bnd jne label1"); /* Expecting: jcc conditional 0xfffffffc */
/* sha1rnds4 imm8, xmm2/m128, xmm1 */
asm volatile("sha1rnds4 $0x0, %xmm1, %xmm0");
asm volatile("sha1rnds4 $0x91, %xmm7, %xmm2");
asm volatile("sha1rnds4 $0x91, (%eax), %xmm0");
asm volatile("sha1rnds4 $0x91, (0x12345678), %xmm0");
asm volatile("sha1rnds4 $0x91, (%eax), %xmm3");
asm volatile("sha1rnds4 $0x91, (%ecx,%eax,1), %xmm0");
asm volatile("sha1rnds4 $0x91, 0x12345678(,%eax,1), %xmm0");
asm volatile("sha1rnds4 $0x91, (%eax,%ecx,1), %xmm0");
asm volatile("sha1rnds4 $0x91, (%eax,%ecx,8), %xmm0");
asm volatile("sha1rnds4 $0x91, 0x12(%eax), %xmm0");
asm volatile("sha1rnds4 $0x91, 0x12(%ebp), %xmm0");
asm volatile("sha1rnds4 $0x91, 0x12(%ecx,%eax,1), %xmm0");
asm volatile("sha1rnds4 $0x91, 0x12(%ebp,%eax,1), %xmm0");
asm volatile("sha1rnds4 $0x91, 0x12(%eax,%ecx,1), %xmm0");
asm volatile("sha1rnds4 $0x91, 0x12(%eax,%ecx,8), %xmm0");
asm volatile("sha1rnds4 $0x91, 0x12345678(%eax), %xmm0");
asm volatile("sha1rnds4 $0x91, 0x12345678(%ebp), %xmm0");
asm volatile("sha1rnds4 $0x91, 0x12345678(%ecx,%eax,1), %xmm0");
asm volatile("sha1rnds4 $0x91, 0x12345678(%ebp,%eax,1), %xmm0");
asm volatile("sha1rnds4 $0x91, 0x12345678(%eax,%ecx,1), %xmm0");
asm volatile("sha1rnds4 $0x91, 0x12345678(%eax,%ecx,8), %xmm0");
/* sha1nexte xmm2/m128, xmm1 */
asm volatile("sha1nexte %xmm1, %xmm0");
asm volatile("sha1nexte %xmm7, %xmm2");
asm volatile("sha1nexte (%eax), %xmm0");
asm volatile("sha1nexte (0x12345678), %xmm0");
asm volatile("sha1nexte (%eax), %xmm3");
asm volatile("sha1nexte (%ecx,%eax,1), %xmm0");
asm volatile("sha1nexte 0x12345678(,%eax,1), %xmm0");
asm volatile("sha1nexte (%eax,%ecx,1), %xmm0");
asm volatile("sha1nexte (%eax,%ecx,8), %xmm0");
asm volatile("sha1nexte 0x12(%eax), %xmm0");
asm volatile("sha1nexte 0x12(%ebp), %xmm0");
asm volatile("sha1nexte 0x12(%ecx,%eax,1), %xmm0");
asm volatile("sha1nexte 0x12(%ebp,%eax,1), %xmm0");
asm volatile("sha1nexte 0x12(%eax,%ecx,1), %xmm0");
asm volatile("sha1nexte 0x12(%eax,%ecx,8), %xmm0");
asm volatile("sha1nexte 0x12345678(%eax), %xmm0");
asm volatile("sha1nexte 0x12345678(%ebp), %xmm0");
asm volatile("sha1nexte 0x12345678(%ecx,%eax,1), %xmm0");
asm volatile("sha1nexte 0x12345678(%ebp,%eax,1), %xmm0");
asm volatile("sha1nexte 0x12345678(%eax,%ecx,1), %xmm0");
asm volatile("sha1nexte 0x12345678(%eax,%ecx,8), %xmm0");
/* sha1msg1 xmm2/m128, xmm1 */
asm volatile("sha1msg1 %xmm1, %xmm0");
asm volatile("sha1msg1 %xmm7, %xmm2");
asm volatile("sha1msg1 (%eax), %xmm0");
asm volatile("sha1msg1 (0x12345678), %xmm0");
asm volatile("sha1msg1 (%eax), %xmm3");
asm volatile("sha1msg1 (%ecx,%eax,1), %xmm0");
asm volatile("sha1msg1 0x12345678(,%eax,1), %xmm0");
asm volatile("sha1msg1 (%eax,%ecx,1), %xmm0");
asm volatile("sha1msg1 (%eax,%ecx,8), %xmm0");
asm volatile("sha1msg1 0x12(%eax), %xmm0");
asm volatile("sha1msg1 0x12(%ebp), %xmm0");
asm volatile("sha1msg1 0x12(%ecx,%eax,1), %xmm0");
asm volatile("sha1msg1 0x12(%ebp,%eax,1), %xmm0");
asm volatile("sha1msg1 0x12(%eax,%ecx,1), %xmm0");
asm volatile("sha1msg1 0x12(%eax,%ecx,8), %xmm0");
asm volatile("sha1msg1 0x12345678(%eax), %xmm0");
asm volatile("sha1msg1 0x12345678(%ebp), %xmm0");
asm volatile("sha1msg1 0x12345678(%ecx,%eax,1), %xmm0");
asm volatile("sha1msg1 0x12345678(%ebp,%eax,1), %xmm0");
asm volatile("sha1msg1 0x12345678(%eax,%ecx,1), %xmm0");
asm volatile("sha1msg1 0x12345678(%eax,%ecx,8), %xmm0");
/* sha1msg2 xmm2/m128, xmm1 */
asm volatile("sha1msg2 %xmm1, %xmm0");
asm volatile("sha1msg2 %xmm7, %xmm2");
asm volatile("sha1msg2 (%eax), %xmm0");
asm volatile("sha1msg2 (0x12345678), %xmm0");
asm volatile("sha1msg2 (%eax), %xmm3");
asm volatile("sha1msg2 (%ecx,%eax,1), %xmm0");
asm volatile("sha1msg2 0x12345678(,%eax,1), %xmm0");
asm volatile("sha1msg2 (%eax,%ecx,1), %xmm0");
asm volatile("sha1msg2 (%eax,%ecx,8), %xmm0");
asm volatile("sha1msg2 0x12(%eax), %xmm0");
asm volatile("sha1msg2 0x12(%ebp), %xmm0");
asm volatile("sha1msg2 0x12(%ecx,%eax,1), %xmm0");
asm volatile("sha1msg2 0x12(%ebp,%eax,1), %xmm0");
asm volatile("sha1msg2 0x12(%eax,%ecx,1), %xmm0");
asm volatile("sha1msg2 0x12(%eax,%ecx,8), %xmm0");
asm volatile("sha1msg2 0x12345678(%eax), %xmm0");
asm volatile("sha1msg2 0x12345678(%ebp), %xmm0");
asm volatile("sha1msg2 0x12345678(%ecx,%eax,1), %xmm0");
asm volatile("sha1msg2 0x12345678(%ebp,%eax,1), %xmm0");
asm volatile("sha1msg2 0x12345678(%eax,%ecx,1), %xmm0");
asm volatile("sha1msg2 0x12345678(%eax,%ecx,8), %xmm0");
/* sha256rnds2 <XMM0>, xmm2/m128, xmm1 */
/* Note sha256rnds2 has an implicit operand 'xmm0' */
asm volatile("sha256rnds2 %xmm4, %xmm1");
asm volatile("sha256rnds2 %xmm7, %xmm2");
asm volatile("sha256rnds2 (%eax), %xmm1");
asm volatile("sha256rnds2 (0x12345678), %xmm1");
asm volatile("sha256rnds2 (%eax), %xmm3");
asm volatile("sha256rnds2 (%ecx,%eax,1), %xmm1");
asm volatile("sha256rnds2 0x12345678(,%eax,1), %xmm1");
asm volatile("sha256rnds2 (%eax,%ecx,1), %xmm1");
asm volatile("sha256rnds2 (%eax,%ecx,8), %xmm1");
asm volatile("sha256rnds2 0x12(%eax), %xmm1");
asm volatile("sha256rnds2 0x12(%ebp), %xmm1");
asm volatile("sha256rnds2 0x12(%ecx,%eax,1), %xmm1");
asm volatile("sha256rnds2 0x12(%ebp,%eax,1), %xmm1");
asm volatile("sha256rnds2 0x12(%eax,%ecx,1), %xmm1");
asm volatile("sha256rnds2 0x12(%eax,%ecx,8), %xmm1");
asm volatile("sha256rnds2 0x12345678(%eax), %xmm1");
asm volatile("sha256rnds2 0x12345678(%ebp), %xmm1");
asm volatile("sha256rnds2 0x12345678(%ecx,%eax,1), %xmm1");
asm volatile("sha256rnds2 0x12345678(%ebp,%eax,1), %xmm1");
asm volatile("sha256rnds2 0x12345678(%eax,%ecx,1), %xmm1");
asm volatile("sha256rnds2 0x12345678(%eax,%ecx,8), %xmm1");
/* sha256msg1 xmm2/m128, xmm1 */
asm volatile("sha256msg1 %xmm1, %xmm0");
asm volatile("sha256msg1 %xmm7, %xmm2");
asm volatile("sha256msg1 (%eax), %xmm0");
asm volatile("sha256msg1 (0x12345678), %xmm0");
asm volatile("sha256msg1 (%eax), %xmm3");
asm volatile("sha256msg1 (%ecx,%eax,1), %xmm0");
asm volatile("sha256msg1 0x12345678(,%eax,1), %xmm0");
asm volatile("sha256msg1 (%eax,%ecx,1), %xmm0");
asm volatile("sha256msg1 (%eax,%ecx,8), %xmm0");
asm volatile("sha256msg1 0x12(%eax), %xmm0");
asm volatile("sha256msg1 0x12(%ebp), %xmm0");
asm volatile("sha256msg1 0x12(%ecx,%eax,1), %xmm0");
asm volatile("sha256msg1 0x12(%ebp,%eax,1), %xmm0");
asm volatile("sha256msg1 0x12(%eax,%ecx,1), %xmm0");
asm volatile("sha256msg1 0x12(%eax,%ecx,8), %xmm0");
asm volatile("sha256msg1 0x12345678(%eax), %xmm0");
asm volatile("sha256msg1 0x12345678(%ebp), %xmm0");
asm volatile("sha256msg1 0x12345678(%ecx,%eax,1), %xmm0");
asm volatile("sha256msg1 0x12345678(%ebp,%eax,1), %xmm0");
asm volatile("sha256msg1 0x12345678(%eax,%ecx,1), %xmm0");
asm volatile("sha256msg1 0x12345678(%eax,%ecx,8), %xmm0");
/* sha256msg2 xmm2/m128, xmm1 */
asm volatile("sha256msg2 %xmm1, %xmm0");
asm volatile("sha256msg2 %xmm7, %xmm2");
asm volatile("sha256msg2 (%eax), %xmm0");
asm volatile("sha256msg2 (0x12345678), %xmm0");
asm volatile("sha256msg2 (%eax), %xmm3");
asm volatile("sha256msg2 (%ecx,%eax,1), %xmm0");
asm volatile("sha256msg2 0x12345678(,%eax,1), %xmm0");
asm volatile("sha256msg2 (%eax,%ecx,1), %xmm0");
asm volatile("sha256msg2 (%eax,%ecx,8), %xmm0");
asm volatile("sha256msg2 0x12(%eax), %xmm0");
asm volatile("sha256msg2 0x12(%ebp), %xmm0");
asm volatile("sha256msg2 0x12(%ecx,%eax,1), %xmm0");
asm volatile("sha256msg2 0x12(%ebp,%eax,1), %xmm0");
asm volatile("sha256msg2 0x12(%eax,%ecx,1), %xmm0");
asm volatile("sha256msg2 0x12(%eax,%ecx,8), %xmm0");
asm volatile("sha256msg2 0x12345678(%eax), %xmm0");
asm volatile("sha256msg2 0x12345678(%ebp), %xmm0");
asm volatile("sha256msg2 0x12345678(%ecx,%eax,1), %xmm0");
asm volatile("sha256msg2 0x12345678(%ebp,%eax,1), %xmm0");
asm volatile("sha256msg2 0x12345678(%eax,%ecx,1), %xmm0");
asm volatile("sha256msg2 0x12345678(%eax,%ecx,8), %xmm0");
/* clflushopt m8 */
asm volatile("clflushopt (%eax)");
asm volatile("clflushopt (0x12345678)");
asm volatile("clflushopt 0x12345678(%eax,%ecx,8)");
/* Also check instructions in the same group encoding as clflushopt */
asm volatile("clflush (%eax)");
asm volatile("sfence");
/* clwb m8 */
asm volatile("clwb (%eax)");
asm volatile("clwb (0x12345678)");
asm volatile("clwb 0x12345678(%eax,%ecx,8)");
/* Also check instructions in the same group encoding as clwb */
asm volatile("xsaveopt (%eax)");
asm volatile("mfence");
/* xsavec mem */
asm volatile("xsavec (%eax)");
asm volatile("xsavec (0x12345678)");
asm volatile("xsavec 0x12345678(%eax,%ecx,8)");
/* xsaves mem */
asm volatile("xsaves (%eax)");
asm volatile("xsaves (0x12345678)");
asm volatile("xsaves 0x12345678(%eax,%ecx,8)");
/* xrstors mem */
asm volatile("xrstors (%eax)");
asm volatile("xrstors (0x12345678)");
asm volatile("xrstors 0x12345678(%eax,%ecx,8)");
#endif /* #ifndef __x86_64__ */
/* pcommit */
asm volatile("pcommit");
/* Following line is a marker for the awk script - do not change */
asm volatile("rdtsc"); /* Stop here */
return 0;
}

View File

@@ -0,0 +1,185 @@
#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"
struct test_data {
u8 data[MAX_INSN_SIZE];
int expected_length;
int expected_rel;
const char *expected_op_str;
const char *expected_branch_str;
const char *asm_rep;
};
struct test_data test_data_32[] = {
#include "insn-x86-dat-32.c"
{{0x0f, 0x01, 0xee}, 3, 0, NULL, NULL, "0f 01 ee \trdpkru"},
{{0x0f, 0x01, 0xef}, 3, 0, NULL, NULL, "0f 01 ef \twrpkru"},
{{0}, 0, 0, NULL, NULL, NULL},
};
struct test_data test_data_64[] = {
#include "insn-x86-dat-64.c"
{{0x0f, 0x01, 0xee}, 3, 0, NULL, NULL, "0f 01 ee \trdpkru"},
{{0x0f, 0x01, 0xef}, 3, 0, NULL, NULL, "0f 01 ef \twrpkru"},
{{0}, 0, 0, NULL, NULL, NULL},
};
static int get_op(const char *op_str)
{
struct val_data {
const char *name;
int val;
} vals[] = {
{"other", INTEL_PT_OP_OTHER},
{"call", INTEL_PT_OP_CALL},
{"ret", INTEL_PT_OP_RET},
{"jcc", INTEL_PT_OP_JCC},
{"jmp", INTEL_PT_OP_JMP},
{"loop", INTEL_PT_OP_LOOP},
{"iret", INTEL_PT_OP_IRET},
{"int", INTEL_PT_OP_INT},
{"syscall", INTEL_PT_OP_SYSCALL},
{"sysret", INTEL_PT_OP_SYSRET},
{NULL, 0},
};
struct val_data *val;
if (!op_str || !strlen(op_str))
return 0;
for (val = vals; val->name; val++) {
if (!strcmp(val->name, op_str))
return val->val;
}
pr_debug("Failed to get op\n");
return -1;
}
static int get_branch(const char *branch_str)
{
struct val_data {
const char *name;
int val;
} vals[] = {
{"no_branch", INTEL_PT_BR_NO_BRANCH},
{"indirect", INTEL_PT_BR_INDIRECT},
{"conditional", INTEL_PT_BR_CONDITIONAL},
{"unconditional", INTEL_PT_BR_UNCONDITIONAL},
{NULL, 0},
};
struct val_data *val;
if (!branch_str || !strlen(branch_str))
return 0;
for (val = vals; val->name; val++) {
if (!strcmp(val->name, branch_str))
return val->val;
}
pr_debug("Failed to get branch\n");
return -1;
}
static int test_data_item(struct test_data *dat, int x86_64)
{
struct intel_pt_insn intel_pt_insn;
struct insn insn;
int op, branch;
insn_init(&insn, dat->data, MAX_INSN_SIZE, x86_64);
insn_get_length(&insn);
if (!insn_complete(&insn)) {
pr_debug("Failed to decode: %s\n", dat->asm_rep);
return -1;
}
if (insn.length != dat->expected_length) {
pr_debug("Failed to decode length (%d vs expected %d): %s\n",
insn.length, dat->expected_length, dat->asm_rep);
return -1;
}
op = get_op(dat->expected_op_str);
branch = get_branch(dat->expected_branch_str);
if (intel_pt_get_insn(dat->data, MAX_INSN_SIZE, x86_64, &intel_pt_insn)) {
pr_debug("Intel PT failed to decode: %s\n", dat->asm_rep);
return -1;
}
if ((int)intel_pt_insn.op != op) {
pr_debug("Failed to decode 'op' value (%d vs expected %d): %s\n",
intel_pt_insn.op, op, dat->asm_rep);
return -1;
}
if ((int)intel_pt_insn.branch != branch) {
pr_debug("Failed to decode 'branch' value (%d vs expected %d): %s\n",
intel_pt_insn.branch, branch, dat->asm_rep);
return -1;
}
if (intel_pt_insn.rel != dat->expected_rel) {
pr_debug("Failed to decode 'rel' value (%#x vs expected %#x): %s\n",
intel_pt_insn.rel, dat->expected_rel, dat->asm_rep);
return -1;
}
pr_debug("Decoded ok: %s\n", dat->asm_rep);
return 0;
}
static int test_data_set(struct test_data *dat_set, int x86_64)
{
struct test_data *dat;
int ret = 0;
for (dat = dat_set; dat->expected_length; dat++) {
if (test_data_item(dat, x86_64))
ret = -1;
}
return ret;
}
/**
* 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.
*/
int test__insn_x86(void)
{
int ret = 0;
if (test_data_set(test_data_32, 0))
ret = -1;
if (test_data_set(test_data_64, 1))
ret = -1;
return ret;
}

View File

@@ -0,0 +1,124 @@
#include "tests/tests.h"
#include "perf.h"
#include "cloexec.h"
#include "debug.h"
#include "evlist.h"
#include "evsel.h"
#include "arch-tests.h"
#include <sys/mman.h>
#include <string.h>
static pid_t spawn(void)
{
pid_t pid;
pid = fork();
if (pid)
return pid;
while(1);
sleep(5);
return 0;
}
/*
* Create an event group that contains both a sampled hardware
* (cpu-cycles) and software (intel_cqm/llc_occupancy/) event. We then
* wait for the hardware perf counter to overflow and generate a PMI,
* which triggers an event read for both of the events in the group.
*
* Since reading Intel CQM event counters requires sending SMP IPIs, the
* CQM pmu needs to handle the above situation gracefully, and return
* the last read counter value to avoid triggering a WARN_ON_ONCE() in
* smp_call_function_many() caused by sending IPIs from NMI context.
*/
int test__intel_cqm_count_nmi_context(void)
{
struct perf_evlist *evlist = NULL;
struct perf_evsel *evsel = NULL;
struct perf_event_attr pe;
int i, fd[2], flag, ret;
size_t mmap_len;
void *event;
pid_t pid;
int err = TEST_FAIL;
flag = perf_event_open_cloexec_flag();
evlist = perf_evlist__new();
if (!evlist) {
pr_debug("perf_evlist__new failed\n");
return TEST_FAIL;
}
ret = parse_events(evlist, "intel_cqm/llc_occupancy/", NULL);
if (ret) {
pr_debug("parse_events failed\n");
err = TEST_SKIP;
goto out;
}
evsel = perf_evlist__first(evlist);
if (!evsel) {
pr_debug("perf_evlist__first failed\n");
goto out;
}
memset(&pe, 0, sizeof(pe));
pe.size = sizeof(pe);
pe.type = PERF_TYPE_HARDWARE;
pe.config = PERF_COUNT_HW_CPU_CYCLES;
pe.read_format = PERF_FORMAT_GROUP;
pe.sample_period = 128;
pe.sample_type = PERF_SAMPLE_IP | PERF_SAMPLE_READ;
pid = spawn();
fd[0] = sys_perf_event_open(&pe, pid, -1, -1, flag);
if (fd[0] < 0) {
pr_debug("failed to open event\n");
goto out;
}
memset(&pe, 0, sizeof(pe));
pe.size = sizeof(pe);
pe.type = evsel->attr.type;
pe.config = evsel->attr.config;
fd[1] = sys_perf_event_open(&pe, pid, -1, fd[0], flag);
if (fd[1] < 0) {
pr_debug("failed to open event\n");
goto out;
}
/*
* Pick a power-of-two number of pages + 1 for the meta-data
* page (struct perf_event_mmap_page). See tools/perf/design.txt.
*/
mmap_len = page_size * 65;
event = mmap(NULL, mmap_len, PROT_READ, MAP_SHARED, fd[0], 0);
if (event == (void *)(-1)) {
pr_debug("failed to mmap %d\n", errno);
goto out;
}
sleep(1);
err = TEST_OK;
munmap(event, mmap_len);
for (i = 0; i < 2; i++)
close(fd[i]);
kill(pid, SIGKILL);
wait(NULL);
out:
perf_evlist__delete(evlist);
return err;
}

View File

@@ -9,7 +9,9 @@
#include "thread_map.h"
#include "cpumap.h"
#include "tsc.h"
#include "tests.h"
#include "tests/tests.h"
#include "arch-tests.h"
#define CHECK__(x) { \
while ((x) < 0) { \

View File

@@ -5,10 +5,9 @@
#include <linux/types.h>
#include "perf.h"
#include "debug.h"
#include "tests.h"
#include "tests/tests.h"
#include "cloexec.h"
#if defined(__x86_64__) || defined(__i386__)
#include "arch-tests.h"
static u64 rdpmc(unsigned int counter)
{
@@ -173,5 +172,3 @@ int test__rdpmc(void)
return 0;
}
#endif

View File

@@ -21,55 +21,109 @@
*/
#include <stddef.h>
#include <errno.h> /* for EINVAL */
#include <string.h> /* for strcmp */
#include <linux/ptrace.h> /* for struct pt_regs */
#include <linux/kernel.h> /* for offsetof */
#include <dwarf-regs.h>
/*
* Generic dwarf analysis helpers
* See arch/x86/kernel/ptrace.c.
* Different from it:
*
* - Since struct pt_regs is defined differently for user and kernel,
* but we want to use 'ax, bx' instead of 'rax, rbx' (which is struct
* field name of user's pt_regs), we make REG_OFFSET_NAME to accept
* both string name and reg field name.
*
* - Since accessing x86_32's pt_regs from x86_64 building is difficult
* and vise versa, we simply fill offset with -1, so
* get_arch_regstr() still works but regs_query_register_offset()
* returns error.
* The only inconvenience caused by it now is that we are not allowed
* to generate BPF prologue for a x86_64 kernel if perf is built for
* x86_32. This is really a rare usecase.
*
* - Order is different from kernel's ptrace.c for get_arch_regstr(). Use
* the order defined by dwarf.
*/
#define X86_32_MAX_REGS 8
const char *x86_32_regs_table[X86_32_MAX_REGS] = {
"%ax",
"%cx",
"%dx",
"%bx",
"$stack", /* Stack address instead of %sp */
"%bp",
"%si",
"%di",
struct pt_regs_offset {
const char *name;
int offset;
};
#define X86_64_MAX_REGS 16
const char *x86_64_regs_table[X86_64_MAX_REGS] = {
"%ax",
"%dx",
"%cx",
"%bx",
"%si",
"%di",
"%bp",
"%sp",
"%r8",
"%r9",
"%r10",
"%r11",
"%r12",
"%r13",
"%r14",
"%r15",
#define REG_OFFSET_END {.name = NULL, .offset = 0}
#ifdef __x86_64__
# define REG_OFFSET_NAME_64(n, r) {.name = n, .offset = offsetof(struct pt_regs, r)}
# define REG_OFFSET_NAME_32(n, r) {.name = n, .offset = -1}
#else
# define REG_OFFSET_NAME_64(n, r) {.name = n, .offset = -1}
# define REG_OFFSET_NAME_32(n, r) {.name = n, .offset = offsetof(struct pt_regs, r)}
#endif
static const struct pt_regs_offset x86_32_regoffset_table[] = {
REG_OFFSET_NAME_32("%ax", eax),
REG_OFFSET_NAME_32("%cx", ecx),
REG_OFFSET_NAME_32("%dx", edx),
REG_OFFSET_NAME_32("%bx", ebx),
REG_OFFSET_NAME_32("$stack", esp), /* Stack address instead of %sp */
REG_OFFSET_NAME_32("%bp", ebp),
REG_OFFSET_NAME_32("%si", esi),
REG_OFFSET_NAME_32("%di", edi),
REG_OFFSET_END,
};
static const struct pt_regs_offset x86_64_regoffset_table[] = {
REG_OFFSET_NAME_64("%ax", rax),
REG_OFFSET_NAME_64("%dx", rdx),
REG_OFFSET_NAME_64("%cx", rcx),
REG_OFFSET_NAME_64("%bx", rbx),
REG_OFFSET_NAME_64("%si", rsi),
REG_OFFSET_NAME_64("%di", rdi),
REG_OFFSET_NAME_64("%bp", rbp),
REG_OFFSET_NAME_64("%sp", rsp),
REG_OFFSET_NAME_64("%r8", r8),
REG_OFFSET_NAME_64("%r9", r9),
REG_OFFSET_NAME_64("%r10", r10),
REG_OFFSET_NAME_64("%r11", r11),
REG_OFFSET_NAME_64("%r12", r12),
REG_OFFSET_NAME_64("%r13", r13),
REG_OFFSET_NAME_64("%r14", r14),
REG_OFFSET_NAME_64("%r15", r15),
REG_OFFSET_END,
};
/* TODO: switching by dwarf address size */
#ifdef __x86_64__
#define ARCH_MAX_REGS X86_64_MAX_REGS
#define arch_regs_table x86_64_regs_table
#define regoffset_table x86_64_regoffset_table
#else
#define ARCH_MAX_REGS X86_32_MAX_REGS
#define arch_regs_table x86_32_regs_table
#define regoffset_table x86_32_regoffset_table
#endif
/* Minus 1 for the ending REG_OFFSET_END */
#define ARCH_MAX_REGS ((sizeof(regoffset_table) / sizeof(regoffset_table[0])) - 1)
/* Return architecture dependent register string (for kprobe-tracer) */
const char *get_arch_regstr(unsigned int n)
{
return (n < ARCH_MAX_REGS) ? arch_regs_table[n] : NULL;
return (n < ARCH_MAX_REGS) ? regoffset_table[n].name : NULL;
}
/* Reuse code from arch/x86/kernel/ptrace.c */
/**
* regs_query_register_offset() - query register offset from its name
* @name: the name of a register
*
* regs_query_register_offset() returns the offset of a register in struct
* pt_regs from its name. If the name is invalid, this returns -EINVAL;
*/
int regs_query_register_offset(const char *name)
{
const struct pt_regs_offset *roff;
for (roff = regoffset_table; roff->name != NULL; roff++)
if (!strcmp(roff->name, name))
return roff->offset;
return -EINVAL;
}

View File

@@ -624,13 +624,49 @@ static int intel_pt_recording_options(struct auxtrace_record *itr,
* threads.
*/
if (have_timing_info && !cpu_map__empty(cpus)) {
err = intel_pt_track_switches(evlist);
if (err == -EPERM)
pr_debug2("Unable to select sched:sched_switch\n");
else if (err)
return err;
else
ptr->have_sched_switch = 1;
if (perf_can_record_switch_events()) {
bool cpu_wide = !target__none(&opts->target) &&
!target__has_task(&opts->target);
if (!cpu_wide && perf_can_record_cpu_wide()) {
struct perf_evsel *switch_evsel;
err = parse_events(evlist, "dummy:u", NULL);
if (err)
return err;
switch_evsel = perf_evlist__last(evlist);
switch_evsel->attr.freq = 0;
switch_evsel->attr.sample_period = 1;
switch_evsel->attr.context_switch = 1;
switch_evsel->system_wide = true;
switch_evsel->no_aux_samples = true;
switch_evsel->immediate = true;
perf_evsel__set_sample_bit(switch_evsel, TID);
perf_evsel__set_sample_bit(switch_evsel, TIME);
perf_evsel__set_sample_bit(switch_evsel, CPU);
opts->record_switch_events = false;
ptr->have_sched_switch = 3;
} else {
opts->record_switch_events = true;
if (cpu_wide)
ptr->have_sched_switch = 3;
else
ptr->have_sched_switch = 2;
}
} else {
err = intel_pt_track_switches(evlist);
if (err == -EPERM)
pr_debug2("Unable to select sched:sched_switch\n");
else if (err)
return err;
else
ptr->have_sched_switch = 1;
}
}
if (intel_pt_evsel) {
@@ -663,8 +699,11 @@ static int intel_pt_recording_options(struct auxtrace_record *itr,
tracking_evsel->attr.sample_period = 1;
/* In per-cpu case, always need the time of mmap events etc */
if (!cpu_map__empty(cpus))
if (!cpu_map__empty(cpus)) {
perf_evsel__set_sample_bit(tracking_evsel, TIME);
/* And the CPU for switch events */
perf_evsel__set_sample_bit(tracking_evsel, CPU);
}
}
/*

View File

@@ -1,6 +1,6 @@
perf-y += sched-messaging.o
perf-y += sched-pipe.o
perf-y += mem-memcpy.o
perf-y += mem-functions.o
perf-y += futex-hash.o
perf-y += futex-wake.o
perf-y += futex-wake-parallel.o

View File

@@ -0,0 +1,379 @@
/*
* mem-memcpy.c
*
* Simple memcpy() and memset() benchmarks
*
* Written by Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
*/
#include "../perf.h"
#include "../util/util.h"
#include "../util/parse-options.h"
#include "../util/header.h"
#include "../util/cloexec.h"
#include "bench.h"
#include "mem-memcpy-arch.h"
#include "mem-memset-arch.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#include <errno.h>
#define K 1024
static const char *size_str = "1MB";
static const char *function_str = "all";
static int nr_loops = 1;
static bool use_cycles;
static int cycles_fd;
static const struct option options[] = {
OPT_STRING('s', "size", &size_str, "1MB",
"Specify the size of the memory buffers. "
"Available units: B, KB, MB, GB and TB (case insensitive)"),
OPT_STRING('f', "function", &function_str, "all",
"Specify the function to run, \"all\" runs all available functions, \"help\" lists them"),
OPT_INTEGER('l', "nr_loops", &nr_loops,
"Specify the number of loops to run. (default: 1)"),
OPT_BOOLEAN('c', "cycles", &use_cycles,
"Use a cycles event instead of gettimeofday() to measure performance"),
OPT_END()
};
typedef void *(*memcpy_t)(void *, const void *, size_t);
typedef void *(*memset_t)(void *, int, size_t);
struct function {
const char *name;
const char *desc;
union {
memcpy_t memcpy;
memset_t memset;
} fn;
};
static struct perf_event_attr cycle_attr = {
.type = PERF_TYPE_HARDWARE,
.config = PERF_COUNT_HW_CPU_CYCLES
};
static void init_cycles(void)
{
cycles_fd = sys_perf_event_open(&cycle_attr, getpid(), -1, -1, perf_event_open_cloexec_flag());
if (cycles_fd < 0 && errno == ENOSYS)
die("No CONFIG_PERF_EVENTS=y kernel support configured?\n");
else
BUG_ON(cycles_fd < 0);
}
static u64 get_cycles(void)
{
int ret;
u64 clk;
ret = read(cycles_fd, &clk, sizeof(u64));
BUG_ON(ret != sizeof(u64));
return clk;
}
static double timeval2double(struct timeval *ts)
{
return (double)ts->tv_sec + (double)ts->tv_usec / (double)1000000;
}
#define print_bps(x) do { \
if (x < K) \
printf(" %14lf bytes/sec\n", x); \
else if (x < K * K) \
printf(" %14lfd KB/sec\n", x / K); \
else if (x < K * K * K) \
printf(" %14lf MB/sec\n", x / K / K); \
else \
printf(" %14lf GB/sec\n", x / K / K / K); \
} while (0)
struct bench_mem_info {
const struct function *functions;
u64 (*do_cycles)(const struct function *r, size_t size);
double (*do_gettimeofday)(const struct function *r, size_t size);
const char *const *usage;
};
static void __bench_mem_function(struct bench_mem_info *info, int r_idx, size_t size, double size_total)
{
const struct function *r = &info->functions[r_idx];
double result_bps = 0.0;
u64 result_cycles = 0;
printf("# function '%s' (%s)\n", r->name, r->desc);
if (bench_format == BENCH_FORMAT_DEFAULT)
printf("# Copying %s bytes ...\n\n", size_str);
if (use_cycles) {
result_cycles = info->do_cycles(r, size);
} else {
result_bps = info->do_gettimeofday(r, size);
}
switch (bench_format) {
case BENCH_FORMAT_DEFAULT:
if (use_cycles) {
printf(" %14lf cycles/byte\n", (double)result_cycles/size_total);
} else {
print_bps(result_bps);
}
break;
case BENCH_FORMAT_SIMPLE:
if (use_cycles) {
printf("%lf\n", (double)result_cycles/size_total);
} else {
printf("%lf\n", result_bps);
}
break;
default:
BUG_ON(1);
break;
}
}
static int bench_mem_common(int argc, const char **argv, struct bench_mem_info *info)
{
int i;
size_t size;
double size_total;
argc = parse_options(argc, argv, options, info->usage, 0);
if (use_cycles)
init_cycles();
size = (size_t)perf_atoll((char *)size_str);
size_total = (double)size * nr_loops;
if ((s64)size <= 0) {
fprintf(stderr, "Invalid size:%s\n", size_str);
return 1;
}
if (!strncmp(function_str, "all", 3)) {
for (i = 0; info->functions[i].name; i++)
__bench_mem_function(info, i, size, size_total);
return 0;
}
for (i = 0; info->functions[i].name; i++) {
if (!strcmp(info->functions[i].name, function_str))
break;
}
if (!info->functions[i].name) {
if (strcmp(function_str, "help") && strcmp(function_str, "h"))
printf("Unknown function: %s\n", function_str);
printf("Available functions:\n");
for (i = 0; info->functions[i].name; i++) {
printf("\t%s ... %s\n",
info->functions[i].name, info->functions[i].desc);
}
return 1;
}
__bench_mem_function(info, i, size, size_total);
return 0;
}
static void memcpy_alloc_mem(void **dst, void **src, size_t size)
{
*dst = zalloc(size);
if (!*dst)
die("memory allocation failed - maybe size is too large?\n");
*src = zalloc(size);
if (!*src)
die("memory allocation failed - maybe size is too large?\n");
/* Make sure to always prefault zero pages even if MMAP_THRESH is crossed: */
memset(*src, 0, size);
}
static u64 do_memcpy_cycles(const struct function *r, size_t size)
{
u64 cycle_start = 0ULL, cycle_end = 0ULL;
void *src = NULL, *dst = NULL;
memcpy_t fn = r->fn.memcpy;
int i;
memcpy_alloc_mem(&dst, &src, size);
/*
* We prefault the freshly allocated memory range here,
* to not measure page fault overhead:
*/
fn(dst, src, size);
cycle_start = get_cycles();
for (i = 0; i < nr_loops; ++i)
fn(dst, src, size);
cycle_end = get_cycles();
free(src);
free(dst);
return cycle_end - cycle_start;
}
static double do_memcpy_gettimeofday(const struct function *r, size_t size)
{
struct timeval tv_start, tv_end, tv_diff;
memcpy_t fn = r->fn.memcpy;
void *src = NULL, *dst = NULL;
int i;
memcpy_alloc_mem(&dst, &src, size);
/*
* We prefault the freshly allocated memory range here,
* to not measure page fault overhead:
*/
fn(dst, src, size);
BUG_ON(gettimeofday(&tv_start, NULL));
for (i = 0; i < nr_loops; ++i)
fn(dst, src, size);
BUG_ON(gettimeofday(&tv_end, NULL));
timersub(&tv_end, &tv_start, &tv_diff);
free(src);
free(dst);
return (double)(((double)size * nr_loops) / timeval2double(&tv_diff));
}
struct function memcpy_functions[] = {
{ .name = "default",
.desc = "Default memcpy() provided by glibc",
.fn.memcpy = memcpy },
#ifdef HAVE_ARCH_X86_64_SUPPORT
# define MEMCPY_FN(_fn, _name, _desc) {.name = _name, .desc = _desc, .fn.memcpy = _fn},
# include "mem-memcpy-x86-64-asm-def.h"
# undef MEMCPY_FN
#endif
{ .name = NULL, }
};
static const char * const bench_mem_memcpy_usage[] = {
"perf bench mem memcpy <options>",
NULL
};
int bench_mem_memcpy(int argc, const char **argv, const char *prefix __maybe_unused)
{
struct bench_mem_info info = {
.functions = memcpy_functions,
.do_cycles = do_memcpy_cycles,
.do_gettimeofday = do_memcpy_gettimeofday,
.usage = bench_mem_memcpy_usage,
};
return bench_mem_common(argc, argv, &info);
}
static void memset_alloc_mem(void **dst, size_t size)
{
*dst = zalloc(size);
if (!*dst)
die("memory allocation failed - maybe size is too large?\n");
}
static u64 do_memset_cycles(const struct function *r, size_t size)
{
u64 cycle_start = 0ULL, cycle_end = 0ULL;
memset_t fn = r->fn.memset;
void *dst = NULL;
int i;
memset_alloc_mem(&dst, size);
/*
* We prefault the freshly allocated memory range here,
* to not measure page fault overhead:
*/
fn(dst, -1, size);
cycle_start = get_cycles();
for (i = 0; i < nr_loops; ++i)
fn(dst, i, size);
cycle_end = get_cycles();
free(dst);
return cycle_end - cycle_start;
}
static double do_memset_gettimeofday(const struct function *r, size_t size)
{
struct timeval tv_start, tv_end, tv_diff;
memset_t fn = r->fn.memset;
void *dst = NULL;
int i;
memset_alloc_mem(&dst, size);
/*
* We prefault the freshly allocated memory range here,
* to not measure page fault overhead:
*/
fn(dst, -1, size);
BUG_ON(gettimeofday(&tv_start, NULL));
for (i = 0; i < nr_loops; ++i)
fn(dst, i, size);
BUG_ON(gettimeofday(&tv_end, NULL));
timersub(&tv_end, &tv_start, &tv_diff);
free(dst);
return (double)(((double)size * nr_loops) / timeval2double(&tv_diff));
}
static const char * const bench_mem_memset_usage[] = {
"perf bench mem memset <options>",
NULL
};
static const struct function memset_functions[] = {
{ .name = "default",
.desc = "Default memset() provided by glibc",
.fn.memset = memset },
#ifdef HAVE_ARCH_X86_64_SUPPORT
# define MEMSET_FN(_fn, _name, _desc) { .name = _name, .desc = _desc, .fn.memset = _fn },
# include "mem-memset-x86-64-asm-def.h"
# undef MEMSET_FN
#endif
{ .name = NULL, }
};
int bench_mem_memset(int argc, const char **argv, const char *prefix __maybe_unused)
{
struct bench_mem_info info = {
.functions = memset_functions,
.do_cycles = do_memset_cycles,
.do_gettimeofday = do_memset_gettimeofday,
.usage = bench_mem_memset_usage,
};
return bench_mem_common(argc, argv, &info);
}

View File

@@ -1,434 +0,0 @@
/*
* mem-memcpy.c
*
* memcpy: Simple memory copy in various ways
*
* Written by Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
*/
#include "../perf.h"
#include "../util/util.h"
#include "../util/parse-options.h"
#include "../util/header.h"
#include "../util/cloexec.h"
#include "bench.h"
#include "mem-memcpy-arch.h"
#include "mem-memset-arch.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#include <errno.h>
#define K 1024
static const char *length_str = "1MB";
static const char *routine = "default";
static int iterations = 1;
static bool use_cycle;
static int cycle_fd;
static bool only_prefault;
static bool no_prefault;
static const struct option options[] = {
OPT_STRING('l', "length", &length_str, "1MB",
"Specify length of memory to copy. "
"Available units: B, KB, MB, GB and TB (upper and lower)"),
OPT_STRING('r', "routine", &routine, "default",
"Specify routine to copy, \"all\" runs all available routines"),
OPT_INTEGER('i', "iterations", &iterations,
"repeat memcpy() invocation this number of times"),
OPT_BOOLEAN('c', "cycle", &use_cycle,
"Use cycles event instead of gettimeofday() for measuring"),
OPT_BOOLEAN('o', "only-prefault", &only_prefault,
"Show only the result with page faults before memcpy()"),
OPT_BOOLEAN('n', "no-prefault", &no_prefault,
"Show only the result without page faults before memcpy()"),
OPT_END()
};
typedef void *(*memcpy_t)(void *, const void *, size_t);
typedef void *(*memset_t)(void *, int, size_t);
struct routine {
const char *name;
const char *desc;
union {
memcpy_t memcpy;
memset_t memset;
} fn;
};
struct routine memcpy_routines[] = {
{ .name = "default",
.desc = "Default memcpy() provided by glibc",
.fn.memcpy = memcpy },
#ifdef HAVE_ARCH_X86_64_SUPPORT
#define MEMCPY_FN(_fn, _name, _desc) {.name = _name, .desc = _desc, .fn.memcpy = _fn},
#include "mem-memcpy-x86-64-asm-def.h"
#undef MEMCPY_FN
#endif
{ NULL,
NULL,
{NULL} }
};
static const char * const bench_mem_memcpy_usage[] = {
"perf bench mem memcpy <options>",
NULL
};
static struct perf_event_attr cycle_attr = {
.type = PERF_TYPE_HARDWARE,
.config = PERF_COUNT_HW_CPU_CYCLES
};
static void init_cycle(void)
{
cycle_fd = sys_perf_event_open(&cycle_attr, getpid(), -1, -1,
perf_event_open_cloexec_flag());
if (cycle_fd < 0 && errno == ENOSYS)
die("No CONFIG_PERF_EVENTS=y kernel support configured?\n");
else
BUG_ON(cycle_fd < 0);
}
static u64 get_cycle(void)
{
int ret;
u64 clk;
ret = read(cycle_fd, &clk, sizeof(u64));
BUG_ON(ret != sizeof(u64));
return clk;
}
static double timeval2double(struct timeval *ts)
{
return (double)ts->tv_sec +
(double)ts->tv_usec / (double)1000000;
}
#define pf (no_prefault ? 0 : 1)
#define print_bps(x) do { \
if (x < K) \
printf(" %14lf B/Sec", x); \
else if (x < K * K) \
printf(" %14lfd KB/Sec", x / K); \
else if (x < K * K * K) \
printf(" %14lf MB/Sec", x / K / K); \
else \
printf(" %14lf GB/Sec", x / K / K / K); \
} while (0)
struct bench_mem_info {
const struct routine *routines;
u64 (*do_cycle)(const struct routine *r, size_t len, bool prefault);
double (*do_gettimeofday)(const struct routine *r, size_t len, bool prefault);
const char *const *usage;
};
static void __bench_mem_routine(struct bench_mem_info *info, int r_idx, size_t len, double totallen)
{
const struct routine *r = &info->routines[r_idx];
double result_bps[2];
u64 result_cycle[2];
result_cycle[0] = result_cycle[1] = 0ULL;
result_bps[0] = result_bps[1] = 0.0;
printf("Routine %s (%s)\n", r->name, r->desc);
if (bench_format == BENCH_FORMAT_DEFAULT)
printf("# Copying %s Bytes ...\n\n", length_str);
if (!only_prefault && !no_prefault) {
/* show both of results */
if (use_cycle) {
result_cycle[0] = info->do_cycle(r, len, false);
result_cycle[1] = info->do_cycle(r, len, true);
} else {
result_bps[0] = info->do_gettimeofday(r, len, false);
result_bps[1] = info->do_gettimeofday(r, len, true);
}
} else {
if (use_cycle)
result_cycle[pf] = info->do_cycle(r, len, only_prefault);
else
result_bps[pf] = info->do_gettimeofday(r, len, only_prefault);
}
switch (bench_format) {
case BENCH_FORMAT_DEFAULT:
if (!only_prefault && !no_prefault) {
if (use_cycle) {
printf(" %14lf Cycle/Byte\n",
(double)result_cycle[0]
/ totallen);
printf(" %14lf Cycle/Byte (with prefault)\n",
(double)result_cycle[1]
/ totallen);
} else {
print_bps(result_bps[0]);
printf("\n");
print_bps(result_bps[1]);
printf(" (with prefault)\n");
}
} else {
if (use_cycle) {
printf(" %14lf Cycle/Byte",
(double)result_cycle[pf]
/ totallen);
} else
print_bps(result_bps[pf]);
printf("%s\n", only_prefault ? " (with prefault)" : "");
}
break;
case BENCH_FORMAT_SIMPLE:
if (!only_prefault && !no_prefault) {
if (use_cycle) {
printf("%lf %lf\n",
(double)result_cycle[0] / totallen,
(double)result_cycle[1] / totallen);
} else {
printf("%lf %lf\n",
result_bps[0], result_bps[1]);
}
} else {
if (use_cycle) {
printf("%lf\n", (double)result_cycle[pf]
/ totallen);
} else
printf("%lf\n", result_bps[pf]);
}
break;
default:
/* reaching this means there's some disaster: */
die("unknown format: %d\n", bench_format);
break;
}
}
static int bench_mem_common(int argc, const char **argv,
const char *prefix __maybe_unused,
struct bench_mem_info *info)
{
int i;
size_t len;
double totallen;
argc = parse_options(argc, argv, options,
info->usage, 0);
if (no_prefault && only_prefault) {
fprintf(stderr, "Invalid options: -o and -n are mutually exclusive\n");
return 1;
}
if (use_cycle)
init_cycle();
len = (size_t)perf_atoll((char *)length_str);
totallen = (double)len * iterations;
if ((s64)len <= 0) {
fprintf(stderr, "Invalid length:%s\n", length_str);
return 1;
}
/* same to without specifying either of prefault and no-prefault */
if (only_prefault && no_prefault)
only_prefault = no_prefault = false;
if (!strncmp(routine, "all", 3)) {
for (i = 0; info->routines[i].name; i++)
__bench_mem_routine(info, i, len, totallen);
return 0;
}
for (i = 0; info->routines[i].name; i++) {
if (!strcmp(info->routines[i].name, routine))
break;
}
if (!info->routines[i].name) {
printf("Unknown routine:%s\n", routine);
printf("Available routines...\n");
for (i = 0; info->routines[i].name; i++) {
printf("\t%s ... %s\n",
info->routines[i].name, info->routines[i].desc);
}
return 1;
}
__bench_mem_routine(info, i, len, totallen);
return 0;
}
static void memcpy_alloc_mem(void **dst, void **src, size_t length)
{
*dst = zalloc(length);
if (!*dst)
die("memory allocation failed - maybe length is too large?\n");
*src = zalloc(length);
if (!*src)
die("memory allocation failed - maybe length is too large?\n");
/* Make sure to always replace the zero pages even if MMAP_THRESH is crossed */
memset(*src, 0, length);
}
static u64 do_memcpy_cycle(const struct routine *r, size_t len, bool prefault)
{
u64 cycle_start = 0ULL, cycle_end = 0ULL;
void *src = NULL, *dst = NULL;
memcpy_t fn = r->fn.memcpy;
int i;
memcpy_alloc_mem(&dst, &src, len);
if (prefault)
fn(dst, src, len);
cycle_start = get_cycle();
for (i = 0; i < iterations; ++i)
fn(dst, src, len);
cycle_end = get_cycle();
free(src);
free(dst);
return cycle_end - cycle_start;
}
static double do_memcpy_gettimeofday(const struct routine *r, size_t len,
bool prefault)
{
struct timeval tv_start, tv_end, tv_diff;
memcpy_t fn = r->fn.memcpy;
void *src = NULL, *dst = NULL;
int i;
memcpy_alloc_mem(&dst, &src, len);
if (prefault)
fn(dst, src, len);
BUG_ON(gettimeofday(&tv_start, NULL));
for (i = 0; i < iterations; ++i)
fn(dst, src, len);
BUG_ON(gettimeofday(&tv_end, NULL));
timersub(&tv_end, &tv_start, &tv_diff);
free(src);
free(dst);
return (double)(((double)len * iterations) / timeval2double(&tv_diff));
}
int bench_mem_memcpy(int argc, const char **argv,
const char *prefix __maybe_unused)
{
struct bench_mem_info info = {
.routines = memcpy_routines,
.do_cycle = do_memcpy_cycle,
.do_gettimeofday = do_memcpy_gettimeofday,
.usage = bench_mem_memcpy_usage,
};
return bench_mem_common(argc, argv, prefix, &info);
}
static void memset_alloc_mem(void **dst, size_t length)
{
*dst = zalloc(length);
if (!*dst)
die("memory allocation failed - maybe length is too large?\n");
}
static u64 do_memset_cycle(const struct routine *r, size_t len, bool prefault)
{
u64 cycle_start = 0ULL, cycle_end = 0ULL;
memset_t fn = r->fn.memset;
void *dst = NULL;
int i;
memset_alloc_mem(&dst, len);
if (prefault)
fn(dst, -1, len);
cycle_start = get_cycle();
for (i = 0; i < iterations; ++i)
fn(dst, i, len);
cycle_end = get_cycle();
free(dst);
return cycle_end - cycle_start;
}
static double do_memset_gettimeofday(const struct routine *r, size_t len,
bool prefault)
{
struct timeval tv_start, tv_end, tv_diff;
memset_t fn = r->fn.memset;
void *dst = NULL;
int i;
memset_alloc_mem(&dst, len);
if (prefault)
fn(dst, -1, len);
BUG_ON(gettimeofday(&tv_start, NULL));
for (i = 0; i < iterations; ++i)
fn(dst, i, len);
BUG_ON(gettimeofday(&tv_end, NULL));
timersub(&tv_end, &tv_start, &tv_diff);
free(dst);
return (double)(((double)len * iterations) / timeval2double(&tv_diff));
}
static const char * const bench_mem_memset_usage[] = {
"perf bench mem memset <options>",
NULL
};
static const struct routine memset_routines[] = {
{ .name ="default",
.desc = "Default memset() provided by glibc",
.fn.memset = memset },
#ifdef HAVE_ARCH_X86_64_SUPPORT
#define MEMSET_FN(_fn, _name, _desc) { .name = _name, .desc = _desc, .fn.memset = _fn },
#include "mem-memset-x86-64-asm-def.h"
#undef MEMSET_FN
#endif
{ .name = NULL,
.desc = NULL,
.fn.memset = NULL }
};
int bench_mem_memset(int argc, const char **argv,
const char *prefix __maybe_unused)
{
struct bench_mem_info info = {
.routines = memset_routines,
.do_cycle = do_memset_cycle,
.do_gettimeofday = do_memset_gettimeofday,
.usage = bench_mem_memset_usage,
};
return bench_mem_common(argc, argv, prefix, &info);
}

View File

@@ -164,8 +164,8 @@ static const struct option options[] = {
OPT_STRING('L', "mb_proc_locked", &p0.mb_proc_locked_str,"MB", "process serialized/locked memory access (MBs), <= process_memory"),
OPT_STRING('T', "mb_thread" , &p0.mb_thread_str, "MB", "thread memory (MBs)"),
OPT_UINTEGER('l', "nr_loops" , &p0.nr_loops, "max number of loops to run"),
OPT_UINTEGER('s', "nr_secs" , &p0.nr_secs, "max number of seconds to run"),
OPT_UINTEGER('l', "nr_loops" , &p0.nr_loops, "max number of loops to run (default: unlimited)"),
OPT_UINTEGER('s', "nr_secs" , &p0.nr_secs, "max number of seconds to run (default: 5 secs)"),
OPT_UINTEGER('u', "usleep" , &p0.sleep_usecs, "usecs to sleep per loop iteration"),
OPT_BOOLEAN('R', "data_reads" , &p0.data_reads, "access the data via writes (can be mixed with -W)"),

View File

@@ -33,7 +33,7 @@
#define DATASIZE 100
static bool use_pipes = false;
static unsigned int loops = 100;
static unsigned int nr_loops = 100;
static bool thread_mode = false;
static unsigned int num_groups = 10;
@@ -79,7 +79,7 @@ static void ready(int ready_out, int wakefd)
err(EXIT_FAILURE, "poll");
}
/* Sender sprays loops messages down each file descriptor */
/* Sender sprays nr_loops messages down each file descriptor */
static void *sender(struct sender_context *ctx)
{
char data[DATASIZE];
@@ -88,7 +88,7 @@ static void *sender(struct sender_context *ctx)
ready(ctx->ready_out, ctx->wakefd);
/* Now pump to every receiver. */
for (i = 0; i < loops; i++) {
for (i = 0; i < nr_loops; i++) {
for (j = 0; j < ctx->num_fds; j++) {
int ret, done = 0;
@@ -213,7 +213,7 @@ static unsigned int group(pthread_t *pth,
/* Create the pipe between client and server */
fdpair(fds);
ctx->num_packets = num_fds * loops;
ctx->num_packets = num_fds * nr_loops;
ctx->in_fds[0] = fds[0];
ctx->in_fds[1] = fds[1];
ctx->ready_out = ready_out;
@@ -250,7 +250,7 @@ static const struct option options[] = {
OPT_BOOLEAN('t', "thread", &thread_mode,
"Be multi thread instead of multi process"),
OPT_UINTEGER('g', "group", &num_groups, "Specify number of groups"),
OPT_UINTEGER('l', "loop", &loops, "Specify number of loops"),
OPT_UINTEGER('l', "nr_loops", &nr_loops, "Specify the number of loops to run (default: 100)"),
OPT_END()
};

View File

@@ -211,7 +211,7 @@ static int __cmd_annotate(struct perf_annotate *ann)
}
if (!objdump_path) {
ret = perf_session_env__lookup_objdump(&session->header.env);
ret = perf_env__lookup_objdump(&session->header.env);
if (ret)
goto out;
}

View File

@@ -36,7 +36,7 @@ struct bench {
#ifdef HAVE_LIBNUMA_SUPPORT
static struct bench numa_benchmarks[] = {
{ "mem", "Benchmark for NUMA workloads", bench_numa },
{ "all", "Test all NUMA benchmarks", NULL },
{ "all", "Run all NUMA benchmarks", NULL },
{ NULL, NULL, NULL }
};
#endif
@@ -44,14 +44,14 @@ static struct bench numa_benchmarks[] = {
static struct bench sched_benchmarks[] = {
{ "messaging", "Benchmark for scheduling and IPC", bench_sched_messaging },
{ "pipe", "Benchmark for pipe() between two processes", bench_sched_pipe },
{ "all", "Test all scheduler benchmarks", NULL },
{ "all", "Run all scheduler benchmarks", NULL },
{ NULL, NULL, NULL }
};
static struct bench mem_benchmarks[] = {
{ "memcpy", "Benchmark for memcpy()", bench_mem_memcpy },
{ "memset", "Benchmark for memset() tests", bench_mem_memset },
{ "all", "Test all memory benchmarks", NULL },
{ "memcpy", "Benchmark for memcpy() functions", bench_mem_memcpy },
{ "memset", "Benchmark for memset() functions", bench_mem_memset },
{ "all", "Run all memory access benchmarks", NULL },
{ NULL, NULL, NULL }
};
@@ -62,7 +62,7 @@ static struct bench futex_benchmarks[] = {
{ "requeue", "Benchmark for futex requeue calls", bench_futex_requeue },
/* pi-futexes */
{ "lock-pi", "Benchmark for futex lock_pi calls", bench_futex_lock_pi },
{ "all", "Test all futex benchmarks", NULL },
{ "all", "Run all futex benchmarks", NULL },
{ NULL, NULL, NULL }
};
@@ -110,7 +110,7 @@ int bench_format = BENCH_FORMAT_DEFAULT;
unsigned int bench_repeat = 10; /* default number of times to repeat the run */
static const struct option bench_options[] = {
OPT_STRING('f', "format", &bench_format_str, "default", "Specify format style"),
OPT_STRING('f', "format", &bench_format_str, "default|simple", "Specify the output formatting style"),
OPT_UINTEGER('r', "repeat", &bench_repeat, "Specify amount of times to repeat the run"),
OPT_END()
};

View File

@@ -61,8 +61,8 @@ int cmd_evlist(int argc, const char **argv, const char *prefix __maybe_unused)
usage_with_options(evlist_usage, options);
if (details.event_group && (details.verbose || details.freq)) {
pr_err("--group option is not compatible with other options\n");
usage_with_options(evlist_usage, options);
usage_with_options_msg(evlist_usage, options,
"--group option is not compatible with other options\n");
}
return __cmd_evlist(input_name, &details);

View File

@@ -463,7 +463,7 @@ int cmd_help(int argc, const char **argv, const char *prefix __maybe_unused)
builtin_help_subcommands, builtin_help_usage, 0);
if (show_all) {
printf("\n usage: %s\n\n", perf_usage_string);
printf("\n Usage: %s\n\n", perf_usage_string);
list_commands("perf commands", &main_cmds, &other_cmds);
printf(" %s\n\n", perf_more_info_string);
return 0;

View File

@@ -28,9 +28,11 @@ struct perf_inject {
bool build_ids;
bool sched_stat;
bool have_auxtrace;
bool strip;
const char *input_name;
struct perf_data_file output;
u64 bytes_written;
u64 aux_id;
struct list_head samples;
struct itrace_synth_opts itrace_synth_opts;
};
@@ -176,6 +178,27 @@ static int perf_event__repipe(struct perf_tool *tool,
return perf_event__repipe_synth(tool, event);
}
static int perf_event__drop(struct perf_tool *tool __maybe_unused,
union perf_event *event __maybe_unused,
struct perf_sample *sample __maybe_unused,
struct machine *machine __maybe_unused)
{
return 0;
}
static int perf_event__drop_aux(struct perf_tool *tool,
union perf_event *event __maybe_unused,
struct perf_sample *sample,
struct machine *machine __maybe_unused)
{
struct perf_inject *inject = container_of(tool, struct perf_inject, tool);
if (!inject->aux_id)
inject->aux_id = sample->id;
return 0;
}
typedef int (*inject_handler)(struct perf_tool *tool,
union perf_event *event,
struct perf_sample *sample,
@@ -466,6 +489,78 @@ static int perf_evsel__check_stype(struct perf_evsel *evsel,
return 0;
}
static int drop_sample(struct perf_tool *tool __maybe_unused,
union perf_event *event __maybe_unused,
struct perf_sample *sample __maybe_unused,
struct perf_evsel *evsel __maybe_unused,
struct machine *machine __maybe_unused)
{
return 0;
}
static void strip_init(struct perf_inject *inject)
{
struct perf_evlist *evlist = inject->session->evlist;
struct perf_evsel *evsel;
inject->tool.context_switch = perf_event__drop;
evlist__for_each(evlist, evsel)
evsel->handler = drop_sample;
}
static bool has_tracking(struct perf_evsel *evsel)
{
return evsel->attr.mmap || evsel->attr.mmap2 || evsel->attr.comm ||
evsel->attr.task;
}
#define COMPAT_MASK (PERF_SAMPLE_ID | PERF_SAMPLE_TID | PERF_SAMPLE_TIME | \
PERF_SAMPLE_ID | PERF_SAMPLE_CPU | PERF_SAMPLE_IDENTIFIER)
/*
* In order that the perf.data file is parsable, tracking events like MMAP need
* their selected event to exist, except if there is only 1 selected event left
* and it has a compatible sample type.
*/
static bool ok_to_remove(struct perf_evlist *evlist,
struct perf_evsel *evsel_to_remove)
{
struct perf_evsel *evsel;
int cnt = 0;
bool ok = false;
if (!has_tracking(evsel_to_remove))
return true;
evlist__for_each(evlist, evsel) {
if (evsel->handler != drop_sample) {
cnt += 1;
if ((evsel->attr.sample_type & COMPAT_MASK) ==
(evsel_to_remove->attr.sample_type & COMPAT_MASK))
ok = true;
}
}
return ok && cnt == 1;
}
static void strip_fini(struct perf_inject *inject)
{
struct perf_evlist *evlist = inject->session->evlist;
struct perf_evsel *evsel, *tmp;
/* Remove non-synthesized evsels if possible */
evlist__for_each_safe(evlist, tmp, evsel) {
if (evsel->handler == drop_sample &&
ok_to_remove(evlist, evsel)) {
pr_debug("Deleting %s\n", perf_evsel__name(evsel));
perf_evlist__remove(evlist, evsel);
perf_evsel__delete(evsel);
}
}
}
static int __cmd_inject(struct perf_inject *inject)
{
int ret = -EINVAL;
@@ -512,10 +607,14 @@ static int __cmd_inject(struct perf_inject *inject)
inject->tool.id_index = perf_event__repipe_id_index;
inject->tool.auxtrace_info = perf_event__process_auxtrace_info;
inject->tool.auxtrace = perf_event__process_auxtrace;
inject->tool.aux = perf_event__drop_aux;
inject->tool.itrace_start = perf_event__drop_aux,
inject->tool.ordered_events = true;
inject->tool.ordering_requires_timestamps = true;
/* Allow space in the header for new attributes */
output_data_offset = 4096;
if (inject->strip)
strip_init(inject);
}
if (!inject->itrace_synth_opts.set)
@@ -535,11 +634,28 @@ static int __cmd_inject(struct perf_inject *inject)
}
/*
* The AUX areas have been removed and replaced with
* synthesized hardware events, so clear the feature flag.
* synthesized hardware events, so clear the feature flag and
* remove the evsel.
*/
if (inject->itrace_synth_opts.set)
if (inject->itrace_synth_opts.set) {
struct perf_evsel *evsel;
perf_header__clear_feat(&session->header,
HEADER_AUXTRACE);
if (inject->itrace_synth_opts.last_branch)
perf_header__set_feat(&session->header,
HEADER_BRANCH_STACK);
evsel = perf_evlist__id2evsel_strict(session->evlist,
inject->aux_id);
if (evsel) {
pr_debug("Deleting %s\n",
perf_evsel__name(evsel));
perf_evlist__remove(session->evlist, evsel);
perf_evsel__delete(evsel);
}
if (inject->strip)
strip_fini(inject);
}
session->header.data_offset = output_data_offset;
session->header.data_size = inject->bytes_written;
perf_session__write_header(session, session->evlist, fd, true);
@@ -604,6 +720,8 @@ int cmd_inject(int argc, const char **argv, const char *prefix __maybe_unused)
OPT_CALLBACK_OPTARG(0, "itrace", &inject.itrace_synth_opts,
NULL, "opts", "Instruction Tracing options",
itrace_parse_synth_opts),
OPT_BOOLEAN(0, "strip", &inject.strip,
"strip non-synthesized events (use with --itrace)"),
OPT_END()
};
const char * const inject_usage[] = {
@@ -619,6 +737,11 @@ int cmd_inject(int argc, const char **argv, const char *prefix __maybe_unused)
if (argc)
usage_with_options(inject_usage, options);
if (inject.strip && !inject.itrace_synth_opts.set) {
pr_err("--strip option requires --itrace option\n");
return -1;
}
if (perf_data_file__open(&inject.output)) {
perror("failed to create output file");
return -1;

View File

@@ -329,7 +329,7 @@ static int build_alloc_func_list(void)
return -EINVAL;
}
kernel_map = machine->vmlinux_maps[MAP__FUNCTION];
kernel_map = machine__kernel_map(machine);
if (map__load(kernel_map, NULL) < 0) {
pr_err("cannot load kernel map\n");
return -ENOENT;

View File

@@ -13,7 +13,6 @@
#include "util/parse-options.h"
#include "util/trace-event.h"
#include "util/debug.h"
#include <api/fs/debugfs.h>
#include "util/tool.h"
#include "util/stat.h"
#include "util/top.h"

View File

@@ -36,7 +36,7 @@ int cmd_list(int argc, const char **argv, const char *prefix __maybe_unused)
setup_pager();
if (!raw_dump)
if (!raw_dump && pager_in_use())
printf("\nList of pre-defined events (to be used in -e):\n\n");
if (argc == 0) {
@@ -45,6 +45,8 @@ int cmd_list(int argc, const char **argv, const char *prefix __maybe_unused)
}
for (i = 0; i < argc; ++i) {
char *sep, *s;
if (strcmp(argv[i], "tracepoint") == 0)
print_tracepoint_events(NULL, NULL, raw_dump);
else if (strcmp(argv[i], "hw") == 0 ||
@@ -60,8 +62,7 @@ int cmd_list(int argc, const char **argv, const char *prefix __maybe_unused)
print_hwcache_events(NULL, raw_dump);
else if (strcmp(argv[i], "pmu") == 0)
print_pmu_events(NULL, raw_dump);
else {
char *sep = strchr(argv[i], ':'), *s;
else if ((sep = strchr(argv[i], ':')) != NULL) {
int sep_idx;
if (sep == NULL) {
@@ -76,6 +77,19 @@ int cmd_list(int argc, const char **argv, const char *prefix __maybe_unused)
s[sep_idx] = '\0';
print_tracepoint_events(s, s + sep_idx + 1, raw_dump);
free(s);
} else {
if (asprintf(&s, "*%s*", argv[i]) < 0) {
printf("Critical: Not enough memory! Trying to continue...\n");
continue;
}
print_symbol_events(s, PERF_TYPE_HARDWARE,
event_symbols_hw, PERF_COUNT_HW_MAX, raw_dump);
print_symbol_events(s, PERF_TYPE_SOFTWARE,
event_symbols_sw, PERF_COUNT_SW_MAX, raw_dump);
print_hwcache_events(s, raw_dump);
print_pmu_events(s, raw_dump);
print_tracepoint_events(NULL, s, raw_dump);
free(s);
}
}
return 0;

View File

@@ -37,10 +37,10 @@
#include "util/strfilter.h"
#include "util/symbol.h"
#include "util/debug.h"
#include <api/fs/debugfs.h>
#include "util/parse-options.h"
#include "util/probe-finder.h"
#include "util/probe-event.h"
#include "util/probe-file.h"
#define DEFAULT_VAR_FILTER "!__k???tab_* & !__crc_*"
#define DEFAULT_FUNC_FILTER "!_*"
@@ -182,10 +182,8 @@ static int opt_set_target(const struct option *opt, const char *str,
if (str) {
if (!strcmp(opt->long_name, "exec"))
params.uprobes = true;
#ifdef HAVE_DWARF_SUPPORT
else if (!strcmp(opt->long_name, "module"))
params.uprobes = false;
#endif
else
return ret;
@@ -311,6 +309,119 @@ static void pr_err_with_code(const char *msg, int err)
pr_err("\n");
}
static int perf_add_probe_events(struct perf_probe_event *pevs, int npevs)
{
int ret;
int i, k;
const char *event = NULL, *group = NULL;
ret = init_probe_symbol_maps(pevs->uprobes);
if (ret < 0)
return ret;
ret = convert_perf_probe_events(pevs, npevs);
if (ret < 0)
goto out_cleanup;
ret = apply_perf_probe_events(pevs, npevs);
if (ret < 0)
goto out_cleanup;
for (i = k = 0; i < npevs; i++)
k += pevs[i].ntevs;
pr_info("Added new event%s\n", (k > 1) ? "s:" : ":");
for (i = 0; i < npevs; i++) {
struct perf_probe_event *pev = &pevs[i];
for (k = 0; k < pev->ntevs; k++) {
struct probe_trace_event *tev = &pev->tevs[k];
/* We use tev's name for showing new events */
show_perf_probe_event(tev->group, tev->event, pev,
tev->point.module, false);
/* Save the last valid name */
event = tev->event;
group = tev->group;
}
}
/* Note that it is possible to skip all events because of blacklist */
if (event) {
/* Show how to use the event. */
pr_info("\nYou can now use it in all perf tools, such as:\n\n");
pr_info("\tperf record -e %s:%s -aR sleep 1\n\n", group, event);
}
out_cleanup:
cleanup_perf_probe_events(pevs, npevs);
exit_probe_symbol_maps();
return ret;
}
static int perf_del_probe_events(struct strfilter *filter)
{
int ret, ret2, ufd = -1, kfd = -1;
char *str = strfilter__string(filter);
struct strlist *klist = NULL, *ulist = NULL;
struct str_node *ent;
if (!str)
return -EINVAL;
pr_debug("Delete filter: \'%s\'\n", str);
/* Get current event names */
ret = probe_file__open_both(&kfd, &ufd, PF_FL_RW);
if (ret < 0)
goto out;
klist = strlist__new(NULL, NULL);
ulist = strlist__new(NULL, NULL);
if (!klist || !ulist) {
ret = -ENOMEM;
goto out;
}
ret = probe_file__get_events(kfd, filter, klist);
if (ret == 0) {
strlist__for_each(ent, klist)
pr_info("Removed event: %s\n", ent->s);
ret = probe_file__del_strlist(kfd, klist);
if (ret < 0)
goto error;
}
ret2 = probe_file__get_events(ufd, filter, ulist);
if (ret2 == 0) {
strlist__for_each(ent, ulist)
pr_info("Removed event: %s\n", ent->s);
ret2 = probe_file__del_strlist(ufd, ulist);
if (ret2 < 0)
goto error;
}
if (ret == -ENOENT && ret2 == -ENOENT)
pr_debug("\"%s\" does not hit any event.\n", str);
/* Note that this is silently ignored */
ret = 0;
error:
if (kfd >= 0)
close(kfd);
if (ufd >= 0)
close(ufd);
out:
strlist__delete(klist);
strlist__delete(ulist);
free(str);
return ret;
}
static int
__cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
{
@@ -377,9 +488,6 @@ __cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
"file", "vmlinux pathname"),
OPT_STRING('s', "source", &symbol_conf.source_prefix,
"directory", "path to kernel source"),
OPT_CALLBACK('m', "module", NULL, "modname|path",
"target module name (for online) or path (for offline)",
opt_set_target),
OPT_BOOLEAN('\0', "no-inlines", &probe_conf.no_inlines,
"Don't search inlined functions"),
#endif
@@ -396,6 +504,9 @@ __cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
opt_set_filter),
OPT_CALLBACK('x', "exec", NULL, "executable|path",
"target executable name or path", opt_set_target),
OPT_CALLBACK('m', "module", NULL, "modname|path",
"target module name (for online) or path (for offline)",
opt_set_target),
OPT_BOOLEAN(0, "demangle", &symbol_conf.demangle,
"Enable symbol demangling"),
OPT_BOOLEAN(0, "demangle-kernel", &symbol_conf.demangle_kernel,
@@ -417,12 +528,12 @@ __cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
PARSE_OPT_STOP_AT_NON_OPTION);
if (argc > 0) {
if (strcmp(argv[0], "-") == 0) {
pr_warning(" Error: '-' is not supported.\n");
usage_with_options(probe_usage, options);
usage_with_options_msg(probe_usage, options,
"'-' is not supported.\n");
}
if (params.command && params.command != 'a') {
pr_warning(" Error: another command except --add is set.\n");
usage_with_options(probe_usage, options);
usage_with_options_msg(probe_usage, options,
"another command except --add is set.\n");
}
ret = parse_probe_event_argv(argc, argv);
if (ret < 0) {
@@ -451,8 +562,10 @@ __cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
switch (params.command) {
case 'l':
if (params.uprobes) {
pr_warning(" Error: Don't use --list with --exec.\n");
usage_with_options(probe_usage, options);
pr_err(" Error: Don't use --list with --exec.\n");
parse_options_usage(probe_usage, options, "l", true);
parse_options_usage(NULL, options, "x", true);
return -EINVAL;
}
ret = show_perf_probe_events(params.filter);
if (ret < 0)
@@ -483,7 +596,7 @@ __cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
return ret;
#endif
case 'd':
ret = del_perf_probe_events(params.filter);
ret = perf_del_probe_events(params.filter);
if (ret < 0) {
pr_err_with_code(" Error: Failed to delete events.", ret);
return ret;
@@ -492,11 +605,13 @@ __cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
case 'a':
/* Ensure the last given target is used */
if (params.target && !params.target_used) {
pr_warning(" Error: -x/-m must follow the probe definitions.\n");
usage_with_options(probe_usage, options);
pr_err(" Error: -x/-m must follow the probe definitions.\n");
parse_options_usage(probe_usage, options, "m", true);
parse_options_usage(NULL, options, "x", true);
return -EINVAL;
}
ret = add_perf_probe_events(params.events, params.nevents);
ret = perf_add_probe_events(params.events, params.nevents);
if (ret < 0) {
pr_err_with_code(" Error: Failed to add events.", ret);
return ret;

View File

@@ -31,6 +31,7 @@
#include "util/auxtrace.h"
#include "util/parse-branch-options.h"
#include "util/parse-regs-options.h"
#include "util/llvm-utils.h"
#include <unistd.h>
#include <sched.h>
@@ -49,7 +50,7 @@ struct record {
int realtime_prio;
bool no_buildid;
bool no_buildid_cache;
long samples;
unsigned long long samples;
};
static int record__write(struct record *rec, void *bf, size_t size)
@@ -636,8 +637,29 @@ static int __cmd_record(struct record *rec, int argc, const char **argv)
/*
* Let the child rip
*/
if (forks)
if (forks) {
union perf_event *event;
event = malloc(sizeof(event->comm) + machine->id_hdr_size);
if (event == NULL) {
err = -ENOMEM;
goto out_child;
}
/*
* Some H/W events are generated before COMM event
* which is emitted during exec(), so perf script
* cannot see a correct process name for those events.
* Synthesize COMM event to prevent it.
*/
perf_event__synthesize_comm(tool, event,
rec->evlist->workload.pid,
process_synthesized_event,
machine);
free(event);
perf_evlist__start_workload(rec->evlist);
}
if (opts->initial_delay) {
usleep(opts->initial_delay * 1000);
@@ -646,7 +668,7 @@ static int __cmd_record(struct record *rec, int argc, const char **argv)
auxtrace_snapshot_enabled = 1;
for (;;) {
int hits = rec->samples;
unsigned long long hits = rec->samples;
if (record__mmap_read_all(rec) < 0) {
auxtrace_snapshot_enabled = 0;
@@ -989,13 +1011,8 @@ static struct record record = {
},
};
#define CALLCHAIN_HELP "setup and enables call-graph (stack chain/backtrace) recording: "
#ifdef HAVE_DWARF_UNWIND_SUPPORT
const char record_callchain_help[] = CALLCHAIN_HELP "fp dwarf lbr";
#else
const char record_callchain_help[] = CALLCHAIN_HELP "fp lbr";
#endif
const char record_callchain_help[] = CALLCHAIN_RECORD_HELP
"\n\t\t\t\tDefault: fp";
/*
* XXX Will stay a global variable till we fix builtin-script.c to stop messing
@@ -1043,7 +1060,7 @@ struct option __record_options[] = {
NULL, "enables call-graph recording" ,
&record_callchain_opt),
OPT_CALLBACK(0, "call-graph", &record.opts,
"mode[,dump_size]", record_callchain_help,
"record_mode[,record_size]", record_callchain_help,
&record_parse_callchain_opt),
OPT_INCR('v', "verbose", &verbose,
"be more verbose (show counter open errors, etc)"),
@@ -1096,6 +1113,12 @@ struct option __record_options[] = {
"per thread proc mmap processing timeout in ms"),
OPT_BOOLEAN(0, "switch-events", &record.opts.record_switch_events,
"Record context switch events"),
#ifdef HAVE_LIBBPF_SUPPORT
OPT_STRING(0, "clang-path", &llvm_param.clang_path, "clang path",
"clang binary to use for compiling BPF scriptlets"),
OPT_STRING(0, "clang-opt", &llvm_param.clang_opt, "clang options",
"options passed to clang when compiling BPF scriptlets"),
#endif
OPT_END()
};
@@ -1119,14 +1142,15 @@ int cmd_record(int argc, const char **argv, const char *prefix __maybe_unused)
usage_with_options(record_usage, record_options);
if (nr_cgroups && !rec->opts.target.system_wide) {
ui__error("cgroup monitoring only available in"
" system-wide mode\n");
usage_with_options(record_usage, record_options);
usage_with_options_msg(record_usage, record_options,
"cgroup monitoring only available in system-wide mode");
}
if (rec->opts.record_switch_events &&
!perf_can_record_switch_events()) {
ui__error("kernel does not support recording context switch events (--switch-events option)\n");
usage_with_options(record_usage, record_options);
ui__error("kernel does not support recording context switch events\n");
parse_options_usage(record_usage, record_options, "switch-events", 0);
return -EINVAL;
}
if (!rec->itr) {

View File

@@ -62,6 +62,7 @@ struct report {
float min_percent;
u64 nr_entries;
u64 queue_size;
int socket_filter;
DECLARE_BITMAP(cpu_bitmap, MAX_NR_CPUS);
};
@@ -162,14 +163,21 @@ static int process_sample_event(struct perf_tool *tool,
if (rep->cpu_list && !test_bit(sample->cpu, rep->cpu_bitmap))
goto out_put;
if (sort__mode == SORT_MODE__BRANCH)
if (sort__mode == SORT_MODE__BRANCH) {
/*
* A non-synthesized event might not have a branch stack if
* branch stacks have been synthesized (using itrace options).
*/
if (!sample->branch_stack)
goto out_put;
iter.ops = &hist_iter_branch;
else if (rep->mem_mode)
} else if (rep->mem_mode) {
iter.ops = &hist_iter_mem;
else if (symbol_conf.cumulate_callchain)
} else if (symbol_conf.cumulate_callchain) {
iter.ops = &hist_iter_cumulative;
else
} else {
iter.ops = &hist_iter_normal;
}
if (al.map != NULL)
al.map->dso->hit = 1;
@@ -213,6 +221,15 @@ static int report__setup_sample_type(struct report *rep)
u64 sample_type = perf_evlist__combined_sample_type(session->evlist);
bool is_pipe = perf_data_file__is_pipe(session->file);
if (session->itrace_synth_opts->callchain ||
(!is_pipe &&
perf_header__has_feat(&session->header, HEADER_AUXTRACE) &&
!session->itrace_synth_opts->set))
sample_type |= PERF_SAMPLE_CALLCHAIN;
if (session->itrace_synth_opts->last_branch)
sample_type |= PERF_SAMPLE_BRANCH_STACK;
if (!is_pipe && !(sample_type & PERF_SAMPLE_CALLCHAIN)) {
if (sort__has_parent) {
ui__error("Selected --sort parent, but no "
@@ -286,6 +303,7 @@ static size_t hists__fprintf_nr_sample_events(struct hists *hists, struct report
struct perf_evsel *evsel = hists_to_evsel(hists);
char buf[512];
size_t size = sizeof(buf);
int socked_id = hists->socket_filter;
if (symbol_conf.filter_relative) {
nr_samples = hists->stats.nr_non_filtered_samples;
@@ -326,6 +344,10 @@ static size_t hists__fprintf_nr_sample_events(struct hists *hists, struct report
ret += fprintf(fp, "\n# Sort order : %s", sort_order ? : default_mem_sort_order);
} else
ret += fprintf(fp, "\n# Event count (approx.): %" PRIu64, nr_events);
if (socked_id > -1)
ret += fprintf(fp, "\n# Processor Socket: %d", socked_id);
return ret + fprintf(fp, "\n#\n");
}
@@ -365,7 +387,7 @@ static int perf_evlist__tty_browse_hists(struct perf_evlist *evlist,
static void report__warn_kptr_restrict(const struct report *rep)
{
struct map *kernel_map = rep->session->machines.host.vmlinux_maps[MAP__FUNCTION];
struct map *kernel_map = machine__kernel_map(&rep->session->machines.host);
struct kmap *kernel_kmap = kernel_map ? map__kmap(kernel_map) : NULL;
if (kernel_map == NULL ||
@@ -450,6 +472,8 @@ static void report__collapse_hists(struct report *rep)
if (pos->idx == 0)
hists->symbol_filter_str = rep->symbol_filter_str;
hists->socket_filter = rep->socket_filter;
hists__collapse_resort(hists, &prog);
/* Non-group events are considered as leader */
@@ -601,6 +625,12 @@ parse_percent_limit(const struct option *opt, const char *str,
return 0;
}
#define CALLCHAIN_DEFAULT_OPT "graph,0.5,caller,function"
const char report_callchain_help[] = "Display call graph (stack chain/backtrace):\n\n"
CALLCHAIN_REPORT_HELP
"\n\t\t\t\tDefault: " CALLCHAIN_DEFAULT_OPT;
int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
{
struct perf_session *session;
@@ -609,7 +639,7 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
bool has_br_stack = false;
int branch_mode = -1;
bool branch_call_mode = false;
char callchain_default_opt[] = "fractal,0.5,callee";
char callchain_default_opt[] = CALLCHAIN_DEFAULT_OPT;
const char * const report_usage[] = {
"perf report [<options>]",
NULL
@@ -635,6 +665,7 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
},
.max_stack = PERF_MAX_STACK_DEPTH,
.pretty_printing_style = "normal",
.socket_filter = -1,
};
const struct option options[] = {
OPT_STRING('i', "input", &input_name, "file",
@@ -668,15 +699,18 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
" Please refer the man page for the complete list."),
OPT_STRING('F', "fields", &field_order, "key[,keys...]",
"output field(s): overhead, period, sample plus all of sort keys"),
OPT_BOOLEAN(0, "showcpuutilization", &symbol_conf.show_cpu_utilization,
OPT_BOOLEAN(0, "show-cpu-utilization", &symbol_conf.show_cpu_utilization,
"Show sample percentage for different cpu modes"),
OPT_BOOLEAN_FLAG(0, "showcpuutilization", &symbol_conf.show_cpu_utilization,
"Show sample percentage for different cpu modes", PARSE_OPT_HIDDEN),
OPT_STRING('p', "parent", &parent_pattern, "regex",
"regex filter to identify parent, see: '--sort parent'"),
OPT_BOOLEAN('x', "exclude-other", &symbol_conf.exclude_other,
"Only display entries with parent-match"),
OPT_CALLBACK_DEFAULT('g', "call-graph", &report, "output_type,min_percent[,print_limit],call_order[,branch]",
"Display callchains using output_type (graph, flat, fractal, or none) , min percent threshold, optional print limit, callchain order, key (function or address), add branches. "
"Default: fractal,0.5,callee,function", &report_parse_callchain_opt, callchain_default_opt),
OPT_CALLBACK_DEFAULT('g', "call-graph", &report,
"print_type,threshold[,print_limit],order,sort_key[,branch]",
report_callchain_help, &report_parse_callchain_opt,
callchain_default_opt),
OPT_BOOLEAN(0, "children", &symbol_conf.cumulate_callchain,
"Accumulate callchains of children and show total overhead as well"),
OPT_INTEGER(0, "max-stack", &report.max_stack,
@@ -747,6 +781,8 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
"Show full source file name path for source lines"),
OPT_BOOLEAN(0, "show-ref-call-graph", &symbol_conf.show_ref_callgraph,
"Show callgraph from reference event"),
OPT_INTEGER(0, "socket-filter", &report.socket_filter,
"only show processor socket that match with this filter"),
OPT_END()
};
struct perf_data_file file = {
@@ -781,6 +817,12 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
if (report.inverted_callchain)
callchain_param.order = ORDER_CALLER;
if (symbol_conf.cumulate_callchain && !callchain_param.order_set)
callchain_param.order = ORDER_CALLER;
if (itrace_synth_opts.callchain &&
(int)itrace_synth_opts.callchain_sz > report.max_stack)
report.max_stack = itrace_synth_opts.callchain_sz;
if (!input_name || !strlen(input_name)) {
if (!fstat(STDIN_FILENO, &st) && S_ISFIFO(st.st_mode))
@@ -809,6 +851,9 @@ repeat:
has_br_stack = perf_header__has_feat(&session->header,
HEADER_BRANCH_STACK);
if (itrace_synth_opts.last_branch)
has_br_stack = true;
/*
* Branch mode is a tristate:
* -1 means default, so decide based on the file having branch data.

View File

@@ -1728,8 +1728,8 @@ static void setup_sorting(struct perf_sched *sched, const struct option *options
for (tok = strtok_r(str, ", ", &tmp);
tok; tok = strtok_r(NULL, ", ", &tmp)) {
if (sort_dimension__add(tok, &sched->sort_list) < 0) {
error("Unknown --sort key: `%s'", tok);
usage_with_options(usage_msg, options);
usage_with_options_msg(usage_msg, options,
"Unknown --sort key: `%s'", tok);
}
}

View File

@@ -29,9 +29,12 @@ static bool no_callchain;
static bool latency_format;
static bool system_wide;
static bool print_flags;
static bool nanosecs;
static const char *cpu_list;
static DECLARE_BITMAP(cpu_bitmap, MAX_NR_CPUS);
unsigned int scripting_max_stack = PERF_MAX_STACK_DEPTH;
enum perf_output_field {
PERF_OUTPUT_COMM = 1U << 0,
PERF_OUTPUT_TID = 1U << 1,
@@ -48,6 +51,8 @@ enum perf_output_field {
PERF_OUTPUT_SRCLINE = 1U << 12,
PERF_OUTPUT_PERIOD = 1U << 13,
PERF_OUTPUT_IREGS = 1U << 14,
PERF_OUTPUT_BRSTACK = 1U << 15,
PERF_OUTPUT_BRSTACKSYM = 1U << 16,
};
struct output_option {
@@ -69,6 +74,8 @@ struct output_option {
{.str = "srcline", .field = PERF_OUTPUT_SRCLINE},
{.str = "period", .field = PERF_OUTPUT_PERIOD},
{.str = "iregs", .field = PERF_OUTPUT_IREGS},
{.str = "brstack", .field = PERF_OUTPUT_BRSTACK},
{.str = "brstacksym", .field = PERF_OUTPUT_BRSTACKSYM},
};
/* default set to maintain compatibility with current format */
@@ -415,10 +422,84 @@ static void print_sample_start(struct perf_sample *sample,
secs = nsecs / NSECS_PER_SEC;
nsecs -= secs * NSECS_PER_SEC;
usecs = nsecs / NSECS_PER_USEC;
printf("%5lu.%06lu: ", secs, usecs);
if (nanosecs)
printf("%5lu.%09llu: ", secs, nsecs);
else
printf("%5lu.%06lu: ", secs, usecs);
}
}
static inline char
mispred_str(struct branch_entry *br)
{
if (!(br->flags.mispred || br->flags.predicted))
return '-';
return br->flags.predicted ? 'P' : 'M';
}
static void print_sample_brstack(union perf_event *event __maybe_unused,
struct perf_sample *sample,
struct thread *thread __maybe_unused,
struct perf_event_attr *attr __maybe_unused)
{
struct branch_stack *br = sample->branch_stack;
u64 i;
if (!(br && br->nr))
return;
for (i = 0; i < br->nr; i++) {
printf(" 0x%"PRIx64"/0x%"PRIx64"/%c/%c/%c/%d ",
br->entries[i].from,
br->entries[i].to,
mispred_str( br->entries + i),
br->entries[i].flags.in_tx? 'X' : '-',
br->entries[i].flags.abort? 'A' : '-',
br->entries[i].flags.cycles);
}
}
static void print_sample_brstacksym(union perf_event *event __maybe_unused,
struct perf_sample *sample,
struct thread *thread __maybe_unused,
struct perf_event_attr *attr __maybe_unused)
{
struct branch_stack *br = sample->branch_stack;
struct addr_location alf, alt;
u8 cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK;
u64 i, from, to;
if (!(br && br->nr))
return;
for (i = 0; i < br->nr; i++) {
memset(&alf, 0, sizeof(alf));
memset(&alt, 0, sizeof(alt));
from = br->entries[i].from;
to = br->entries[i].to;
thread__find_addr_map(thread, cpumode, MAP__FUNCTION, from, &alf);
if (alf.map)
alf.sym = map__find_symbol(alf.map, alf.addr, NULL);
thread__find_addr_map(thread, cpumode, MAP__FUNCTION, to, &alt);
if (alt.map)
alt.sym = map__find_symbol(alt.map, alt.addr, NULL);
symbol__fprintf_symname_offs(alf.sym, &alf, stdout);
putchar('/');
symbol__fprintf_symname_offs(alt.sym, &alt, stdout);
printf("/%c/%c/%c/%d ",
mispred_str( br->entries + i),
br->entries[i].flags.in_tx? 'X' : '-',
br->entries[i].flags.abort? 'A' : '-',
br->entries[i].flags.cycles);
}
}
static void print_sample_addr(union perf_event *event,
struct perf_sample *sample,
struct thread *thread,
@@ -471,7 +552,7 @@ static void print_sample_bts(union perf_event *event,
}
}
perf_evsel__print_ip(evsel, sample, al, print_opts,
PERF_MAX_STACK_DEPTH);
scripting_max_stack);
}
/* print branch_to information */
@@ -548,12 +629,17 @@ static void process_event(union perf_event *event, struct perf_sample *sample,
perf_evsel__print_ip(evsel, sample, al,
output[attr->type].print_ip_opts,
PERF_MAX_STACK_DEPTH);
scripting_max_stack);
}
if (PRINT_FIELD(IREGS))
print_sample_iregs(event, sample, thread, attr);
if (PRINT_FIELD(BRSTACK))
print_sample_brstack(event, sample, thread, attr);
else if (PRINT_FIELD(BRSTACKSYM))
print_sample_brstacksym(event, sample, thread, attr);
printf("\n");
}
@@ -680,7 +766,10 @@ static int process_attr(struct perf_tool *tool, union perf_event *event,
set_print_ip_opts(&evsel->attr);
return perf_evsel__check_attr(evsel, scr->session);
if (evsel->attr.sample_type)
err = perf_evsel__check_attr(evsel, scr->session);
return err;
}
static int process_comm_event(struct perf_tool *tool,
@@ -1672,7 +1761,7 @@ int cmd_script(int argc, const char **argv, const char *prefix __maybe_unused)
"comma separated output fields prepend with 'type:'. "
"Valid types: hw,sw,trace,raw. "
"Fields: comm,tid,pid,time,cpu,event,trace,ip,sym,dso,"
"addr,symoff,period,iregs,flags", parse_output_fields),
"addr,symoff,period,iregs,brstack,brstacksym,flags", parse_output_fields),
OPT_BOOLEAN('a', "all-cpus", &system_wide,
"system-wide collection from all CPUs"),
OPT_STRING('S', "symbols", &symbol_conf.sym_list_str, "symbol[,symbol...]",
@@ -1695,6 +1784,8 @@ int cmd_script(int argc, const char **argv, const char *prefix __maybe_unused)
OPT_BOOLEAN('\0', "show-switch-events", &script.show_switch_events,
"Show context switch events (if recorded)"),
OPT_BOOLEAN('f', "force", &file.force, "don't complain, do it"),
OPT_BOOLEAN(0, "ns", &nanosecs,
"Use 9 decimal places when displaying time"),
OPT_CALLBACK_OPTARG(0, "itrace", &itrace_synth_opts, NULL, "opts",
"Instruction Tracing options",
itrace_parse_synth_opts),
@@ -1740,6 +1831,10 @@ int cmd_script(int argc, const char **argv, const char *prefix __maybe_unused)
}
}
if (itrace_synth_opts.callchain &&
itrace_synth_opts.callchain_sz > scripting_max_stack)
scripting_max_stack = itrace_synth_opts.callchain_sz;
/* make sure PERF_EXEC_PATH is set for scripts */
perf_set_argv_exec_path(perf_exec_path());
@@ -1752,9 +1847,9 @@ int cmd_script(int argc, const char **argv, const char *prefix __maybe_unused)
rep_script_path = get_script_path(argv[0], REPORT_SUFFIX);
if (!rec_script_path && !rep_script_path) {
fprintf(stderr, " Couldn't find script %s\n\n See perf"
usage_with_options_msg(script_usage, options,
"Couldn't find script `%s'\n\n See perf"
" script -l for available scripts.\n", argv[0]);
usage_with_options(script_usage, options);
}
if (is_top_script(argv[0])) {
@@ -1765,10 +1860,10 @@ int cmd_script(int argc, const char **argv, const char *prefix __maybe_unused)
rep_args = has_required_arg(rep_script_path);
rec_args = (argc - 1) - rep_args;
if (rec_args < 0) {
fprintf(stderr, " %s script requires options."
usage_with_options_msg(script_usage, options,
"`%s' script requires options."
"\n\n See perf script -l for available "
"scripts and options.\n", argv[0]);
usage_with_options(script_usage, options);
}
}

View File

@@ -100,6 +100,8 @@ static struct target target = {
.uid = UINT_MAX,
};
typedef int (*aggr_get_id_t)(struct cpu_map *m, int cpu);
static int run_count = 1;
static bool no_inherit = false;
static volatile pid_t child_pid = -1;
@@ -119,7 +121,7 @@ static unsigned int unit_width = 4; /* strlen("unit") */
static bool forever = false;
static struct timespec ref_time;
static struct cpu_map *aggr_map;
static int (*aggr_get_id)(struct cpu_map *m, int cpu);
static aggr_get_id_t aggr_get_id;
static volatile int done = 0;
@@ -215,7 +217,7 @@ static void read_counters(bool close_counters)
evlist__for_each(evsel_list, counter) {
if (read_counter(counter))
pr_warning("failed to read counter %s\n", counter->name);
pr_debug("failed to read counter %s\n", counter->name);
if (perf_stat_process_counter(&stat_config, counter))
pr_warning("failed to process counter %s\n", counter->name);
@@ -434,7 +436,7 @@ static void print_noise_pct(double total, double avg)
static void print_noise(struct perf_evsel *evsel, double avg)
{
struct perf_stat *ps;
struct perf_stat_evsel *ps;
if (run_count == 1)
return;
@@ -479,6 +481,7 @@ static void aggr_printout(struct perf_evsel *evsel, int id, int nr)
csv_sep);
break;
case AGGR_GLOBAL:
case AGGR_UNSET:
default:
break;
}
@@ -671,7 +674,7 @@ static void print_aggr_thread(struct perf_evsel *counter, char *prefix)
static void print_counter_aggr(struct perf_evsel *counter, char *prefix)
{
FILE *output = stat_config.output;
struct perf_stat *ps = counter->priv;
struct perf_stat_evsel *ps = counter->priv;
double avg = avg_stats(&ps->res_stats[0]);
int scaled = counter->counts->scaled;
double uval;
@@ -799,6 +802,8 @@ static void print_interval(char *prefix, struct timespec *ts)
case AGGR_GLOBAL:
default:
fprintf(output, "# time counts %*s events\n", unit_width, "unit");
case AGGR_UNSET:
break;
}
}
@@ -880,6 +885,7 @@ static void print_counters(struct timespec *ts, int argc, const char **argv)
evlist__for_each(evsel_list, counter)
print_counter(counter, prefix);
break;
case AGGR_UNSET:
default:
break;
}
@@ -940,30 +946,90 @@ static int stat__set_big_num(const struct option *opt __maybe_unused,
return 0;
}
static int perf_stat__get_socket(struct cpu_map *map, int cpu)
{
return cpu_map__get_socket(map, cpu, NULL);
}
static int perf_stat__get_core(struct cpu_map *map, int cpu)
{
return cpu_map__get_core(map, cpu, NULL);
}
static int cpu_map__get_max(struct cpu_map *map)
{
int i, max = -1;
for (i = 0; i < map->nr; i++) {
if (map->map[i] > max)
max = map->map[i];
}
return max;
}
static struct cpu_map *cpus_aggr_map;
static int perf_stat__get_aggr(aggr_get_id_t get_id, struct cpu_map *map, int idx)
{
int cpu;
if (idx >= map->nr)
return -1;
cpu = map->map[idx];
if (cpus_aggr_map->map[cpu] == -1)
cpus_aggr_map->map[cpu] = get_id(map, idx);
return cpus_aggr_map->map[cpu];
}
static int perf_stat__get_socket_cached(struct cpu_map *map, int idx)
{
return perf_stat__get_aggr(perf_stat__get_socket, map, idx);
}
static int perf_stat__get_core_cached(struct cpu_map *map, int idx)
{
return perf_stat__get_aggr(perf_stat__get_core, map, idx);
}
static int perf_stat_init_aggr_mode(void)
{
int nr;
switch (stat_config.aggr_mode) {
case AGGR_SOCKET:
if (cpu_map__build_socket_map(evsel_list->cpus, &aggr_map)) {
perror("cannot build socket map");
return -1;
}
aggr_get_id = cpu_map__get_socket;
aggr_get_id = perf_stat__get_socket_cached;
break;
case AGGR_CORE:
if (cpu_map__build_core_map(evsel_list->cpus, &aggr_map)) {
perror("cannot build core map");
return -1;
}
aggr_get_id = cpu_map__get_core;
aggr_get_id = perf_stat__get_core_cached;
break;
case AGGR_NONE:
case AGGR_GLOBAL:
case AGGR_THREAD:
case AGGR_UNSET:
default:
break;
}
return 0;
/*
* The evsel_list->cpus is the base we operate on,
* taking the highest cpu number to be the size of
* the aggregation translate cpumap.
*/
nr = cpu_map__get_max(evsel_list->cpus);
cpus_aggr_map = cpu_map__empty_new(nr + 1);
return cpus_aggr_map ? 0 : -ENOMEM;
}
/*
@@ -1179,7 +1245,7 @@ int cmd_stat(int argc, const char **argv, const char *prefix __maybe_unused)
OPT_STRING(0, "post", &post_cmd, "command",
"command to run after to the measured command"),
OPT_UINTEGER('I', "interval-print", &stat_config.interval,
"print counts at regular interval in ms (>= 100)"),
"print counts at regular interval in ms (>= 10)"),
OPT_SET_UINT(0, "per-socket", &stat_config.aggr_mode,
"aggregate counts per processor socket", AGGR_SOCKET),
OPT_SET_UINT(0, "per-core", &stat_config.aggr_mode,
@@ -1332,9 +1398,14 @@ int cmd_stat(int argc, const char **argv, const char *prefix __maybe_unused)
thread_map__read_comms(evsel_list->threads);
if (interval && interval < 100) {
pr_err("print interval must be >= 100ms\n");
parse_options_usage(stat_usage, options, "I", 1);
goto out;
if (interval < 10) {
pr_err("print interval must be >= 10ms\n");
parse_options_usage(stat_usage, options, "I", 1);
goto out;
} else
pr_warning("print interval < 100ms. "
"The overhead percentage could be high in some cases. "
"Please proceed with caution.\n");
}
if (perf_evlist__alloc_stats(evsel_list, interval))

View File

@@ -655,7 +655,7 @@ static int symbol_filter(struct map *map, struct symbol *sym)
{
const char *name = sym->name;
if (!map->dso->kernel)
if (!__map__is_kernel(map))
return 0;
/*
* ppc64 uses function descriptors and appends a '.' to the
@@ -857,9 +857,12 @@ static void perf_top__mmap_read_idx(struct perf_top *top, int idx)
* TODO: we don't process guest user from host side
* except simple counting.
*/
/* Fall thru */
default:
goto next_event;
default:
if (event->header.type == PERF_RECORD_SAMPLE)
goto next_event;
machine = &session->machines.host;
break;
}
@@ -952,7 +955,7 @@ static int __cmd_top(struct perf_top *top)
machines__set_symbol_filter(&top->session->machines, symbol_filter);
if (!objdump_path) {
ret = perf_session_env__lookup_objdump(&top->session->header.env);
ret = perf_env__lookup_objdump(&top->session->header.env);
if (ret)
goto out_delete;
}
@@ -961,8 +964,18 @@ static int __cmd_top(struct perf_top *top)
if (ret)
goto out_delete;
if (perf_session__register_idle_thread(top->session) == NULL)
goto out_delete;
machine__synthesize_threads(&top->session->machines.host, &opts->target,
top->evlist->threads, false, opts->proc_map_timeout);
if (sort__has_socket) {
ret = perf_env__read_cpu_topology_map(&perf_env);
if (ret < 0)
goto out_err_cpu_topo;
}
ret = perf_top__start_counters(top);
if (ret)
goto out_delete;
@@ -1020,6 +1033,14 @@ out_delete:
top->session = NULL;
return ret;
out_err_cpu_topo: {
char errbuf[BUFSIZ];
const char *err = strerror_r(-ret, errbuf, sizeof(errbuf));
ui__error("Could not read the CPU topology map: %s\n", err);
goto out_delete;
}
}
static int
@@ -1032,8 +1053,22 @@ callchain_opt(const struct option *opt, const char *arg, int unset)
static int
parse_callchain_opt(const struct option *opt, const char *arg, int unset)
{
symbol_conf.use_callchain = true;
return record_parse_callchain_opt(opt, arg, unset);
struct record_opts *record = (struct record_opts *)opt->value;
record->callgraph_set = true;
callchain_param.enabled = !unset;
callchain_param.record_mode = CALLCHAIN_FP;
/*
* --no-call-graph
*/
if (unset) {
symbol_conf.use_callchain = false;
callchain_param.record_mode = CALLCHAIN_NONE;
return 0;
}
return parse_callchain_top_opt(arg);
}
static int perf_top_config(const char *var, const char *value, void *cb)
@@ -1058,6 +1093,9 @@ parse_percent_limit(const struct option *opt, const char *arg,
return 0;
}
const char top_callchain_help[] = CALLCHAIN_RECORD_HELP CALLCHAIN_REPORT_HELP
"\n\t\t\t\tDefault: fp,graph,0.5,caller,function";
int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
{
char errbuf[BUFSIZ];
@@ -1133,11 +1171,11 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
OPT_BOOLEAN('n', "show-nr-samples", &symbol_conf.show_nr_samples,
"Show a column with the number of samples"),
OPT_CALLBACK_NOOPT('g', NULL, &top.record_opts,
NULL, "enables call-graph recording",
NULL, "enables call-graph recording and display",
&callchain_opt),
OPT_CALLBACK(0, "call-graph", &top.record_opts,
"mode[,dump_size]", record_callchain_help,
&parse_callchain_opt),
"record_mode[,record_size],print_type,threshold[,print_limit],order,sort_key[,branch]",
top_callchain_help, &parse_callchain_opt),
OPT_BOOLEAN(0, "children", &symbol_conf.cumulate_callchain,
"Accumulate callchains of children and show total overhead as well"),
OPT_INTEGER(0, "max-stack", &top.max_stack,
@@ -1267,6 +1305,9 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
perf_hpp__cancel_cumulate();
}
if (symbol_conf.cumulate_callchain && !callchain_param.order_set)
callchain_param.order = ORDER_CALLER;
symbol_conf.priv_size = sizeof(struct annotation);
symbol_conf.try_vmlinux_path = (symbol_conf.vmlinux_name == NULL);

View File

@@ -17,6 +17,7 @@
*/
#include <traceevent/event-parse.h>
#include <api/fs/tracing_path.h>
#include "builtin.h"
#include "util/color.h"
#include "util/debug.h"
@@ -37,6 +38,7 @@
#include <stdlib.h>
#include <sys/mman.h>
#include <linux/futex.h>
#include <linux/err.h>
/* For older distros: */
#ifndef MAP_STACK
@@ -244,13 +246,14 @@ static struct perf_evsel *perf_evsel__syscall_newtp(const char *direction, void
struct perf_evsel *evsel = perf_evsel__newtp("raw_syscalls", direction);
/* older kernel (e.g., RHEL6) use syscalls:{enter,exit} */
if (evsel == NULL)
if (IS_ERR(evsel))
evsel = perf_evsel__newtp("syscalls", direction);
if (evsel) {
if (perf_evsel__init_syscall_tp(evsel, handler))
goto out_delete;
}
if (IS_ERR(evsel))
return NULL;
if (perf_evsel__init_syscall_tp(evsel, handler))
goto out_delete;
return evsel;
@@ -582,6 +585,12 @@ static size_t syscall_arg__scnprintf_futex_op(char *bf, size_t size, struct sysc
#define SCA_FUTEX_OP syscall_arg__scnprintf_futex_op
static const char *bpf_cmd[] = {
"MAP_CREATE", "MAP_LOOKUP_ELEM", "MAP_UPDATE_ELEM", "MAP_DELETE_ELEM",
"MAP_GET_NEXT_KEY", "PROG_LOAD",
};
static DEFINE_STRARRAY(bpf_cmd);
static const char *epoll_ctl_ops[] = { "ADD", "DEL", "MOD", };
static DEFINE_STRARRAY_OFFSET(epoll_ctl_ops, 1);
@@ -1008,6 +1017,7 @@ static struct syscall_fmt {
.arg_scnprintf = { [0] = SCA_FILENAME, /* filename */
[1] = SCA_ACCMODE, /* mode */ }, },
{ .name = "arch_prctl", .errmsg = true, .alias = "prctl", },
{ .name = "bpf", .errmsg = true, STRARRAY(0, cmd, bpf_cmd), },
{ .name = "brk", .hexret = true,
.arg_scnprintf = { [0] = SCA_HEX, /* brk */ }, },
{ .name = "chdir", .errmsg = true,
@@ -1704,12 +1714,12 @@ static int trace__read_syscall_info(struct trace *trace, int id)
snprintf(tp_name, sizeof(tp_name), "sys_enter_%s", sc->name);
sc->tp_format = trace_event__tp_format("syscalls", tp_name);
if (sc->tp_format == NULL && sc->fmt && sc->fmt->alias) {
if (IS_ERR(sc->tp_format) && sc->fmt && sc->fmt->alias) {
snprintf(tp_name, sizeof(tp_name), "sys_enter_%s", sc->fmt->alias);
sc->tp_format = trace_event__tp_format("syscalls", tp_name);
}
if (sc->tp_format == NULL)
if (IS_ERR(sc->tp_format))
return -1;
sc->args = sc->tp_format->format.fields;
@@ -2389,7 +2399,8 @@ static size_t trace__fprintf_thread_summary(struct trace *trace, FILE *fp);
static bool perf_evlist__add_vfs_getname(struct perf_evlist *evlist)
{
struct perf_evsel *evsel = perf_evsel__newtp("probe", "vfs_getname");
if (evsel == NULL)
if (IS_ERR(evsel))
return false;
if (perf_evsel__field(evsel, "pathname") == NULL) {
@@ -2686,11 +2697,11 @@ out_delete_evlist:
char errbuf[BUFSIZ];
out_error_sched_stat_runtime:
debugfs__strerror_open_tp(errno, errbuf, sizeof(errbuf), "sched", "sched_stat_runtime");
tracing_path__strerror_open_tp(errno, errbuf, sizeof(errbuf), "sched", "sched_stat_runtime");
goto out_error;
out_error_raw_syscalls:
debugfs__strerror_open_tp(errno, errbuf, sizeof(errbuf), "raw_syscalls", "sys_(enter|exit)");
tracing_path__strerror_open_tp(errno, errbuf, sizeof(errbuf), "raw_syscalls", "sys_(enter|exit)");
goto out_error;
out_error_mmap:

View File

@@ -106,9 +106,14 @@ ifdef LIBBABELTRACE
FEATURE_CHECK_LDFLAGS-libbabeltrace := $(LIBBABELTRACE_LDFLAGS) -lbabeltrace-ctf
endif
FEATURE_CHECK_CFLAGS-bpf = -I. -I$(srctree)/tools/include -I$(srctree)/arch/$(ARCH)/include/uapi -I$(srctree)/include/uapi
# include ARCH specific config
-include $(src-perf)/arch/$(ARCH)/Makefile
ifdef PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET
CFLAGS += -DHAVE_ARCH_REGS_QUERY_REGISTER_OFFSET
endif
include $(src-perf)/config/utilities.mak
ifeq ($(call get-executable,$(FLEX)),)
@@ -233,6 +238,7 @@ ifdef NO_LIBELF
NO_DEMANGLE := 1
NO_LIBUNWIND := 1
NO_LIBDW_DWARF_UNWIND := 1
NO_LIBBPF := 1
else
ifeq ($(feature-libelf), 0)
ifeq ($(feature-glibc), 1)
@@ -242,13 +248,14 @@ else
LIBC_SUPPORT := 1
endif
ifeq ($(LIBC_SUPPORT),1)
msg := $(warning No libelf found, disables 'probe' tool, please install elfutils-libelf-devel/libelf-dev);
msg := $(warning No libelf found, disables 'probe' tool and BPF support in 'perf record', please install elfutils-libelf-devel/libelf-dev);
NO_LIBELF := 1
NO_DWARF := 1
NO_DEMANGLE := 1
NO_LIBUNWIND := 1
NO_LIBDW_DWARF_UNWIND := 1
NO_LIBBPF := 1
else
ifneq ($(filter s% -static%,$(LDFLAGS),),)
msg := $(error No static glibc found, please install glibc-static);
@@ -305,6 +312,13 @@ ifndef NO_LIBELF
$(call detected,CONFIG_DWARF)
endif # PERF_HAVE_DWARF_REGS
endif # NO_DWARF
ifndef NO_LIBBPF
ifeq ($(feature-bpf), 1)
CFLAGS += -DHAVE_LIBBPF_SUPPORT
$(call detected,CONFIG_LIBBPF)
endif
endif # NO_LIBBPF
endif # NO_LIBELF
ifeq ($(ARCH),powerpc)
@@ -320,6 +334,13 @@ ifndef NO_LIBUNWIND
endif
endif
ifndef NO_LIBBPF
ifneq ($(feature-bpf), 1)
msg := $(warning BPF API too old. Please install recent kernel headers. BPF support in 'perf record' is disabled.)
NO_LIBBPF := 1
endif
endif
dwarf-post-unwind := 1
dwarf-post-unwind-text := BUG

View File

@@ -8,14 +8,16 @@
*/
#include "builtin.h"
#include "util/env.h"
#include "util/exec_cmd.h"
#include "util/cache.h"
#include "util/quote.h"
#include "util/run-command.h"
#include "util/parse-events.h"
#include "util/parse-options.h"
#include "util/bpf-loader.h"
#include "util/debug.h"
#include <api/fs/debugfs.h>
#include <api/fs/tracing_path.h>
#include <pthread.h>
const char perf_usage_string[] =
@@ -160,6 +162,20 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
if (!strcmp(cmd, "--help") || !strcmp(cmd, "--version"))
break;
/*
* Shortcut for '-h' and '-v' options to invoke help
* and version command.
*/
if (!strcmp(cmd, "-h")) {
(*argv)[0] = "--help";
break;
}
if (!strcmp(cmd, "-v")) {
(*argv)[0] = "--version";
break;
}
/*
* Check remaining flags.
*/
@@ -214,7 +230,7 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
fprintf(stderr, "No directory given for --debugfs-dir.\n");
usage(perf_usage_string);
}
perf_debugfs_set_path((*argv)[1]);
tracing_path_set((*argv)[1]);
if (envchanged)
*envchanged = 1;
(*argv)++;
@@ -230,7 +246,7 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
(*argv)++;
(*argc)--;
} else if (!prefixcmp(cmd, CMD_DEBUGFS_DIR)) {
perf_debugfs_set_path(cmd + strlen(CMD_DEBUGFS_DIR));
tracing_path_set(cmd + strlen(CMD_DEBUGFS_DIR));
fprintf(stderr, "dir: %s\n", tracing_path);
if (envchanged)
*envchanged = 1;
@@ -369,6 +385,8 @@ static int run_builtin(struct cmd_struct *p, int argc, const char **argv)
status = p->fn(argc, argv, prefix);
exit_browser(status);
perf_env__exit(&perf_env);
bpf__clear();
if (status)
return status & 0xff;
@@ -517,8 +535,10 @@ int main(int argc, const char **argv)
cmd = perf_extract_argv0_path(argv[0]);
if (!cmd)
cmd = "perf-help";
/* get debugfs mount point from /proc/mounts */
perf_debugfs_mount(NULL);
/* get debugfs/tracefs mount point from /proc/mounts */
tracing_path_mount();
/*
* "perf-xxxx" is the same as "perf xxxx", but we obviously:
*

View File

@@ -15,14 +15,14 @@
import perf
def main():
def main(context_switch = 0, thread = -1):
cpus = perf.cpu_map()
threads = perf.thread_map()
threads = perf.thread_map(thread)
evsel = perf.evsel(type = perf.TYPE_SOFTWARE,
config = perf.COUNT_SW_DUMMY,
task = 1, comm = 1, mmap = 0, freq = 0,
wakeup_events = 1, watermark = 1,
sample_id_all = 1,
sample_id_all = 1, context_switch = context_switch,
sample_type = perf.SAMPLE_PERIOD | perf.SAMPLE_TID | perf.SAMPLE_CPU)
"""What we want are just the PERF_RECORD_ lifetime events for threads,
@@ -48,4 +48,21 @@ def main():
print event
if __name__ == '__main__':
"""
To test the PERF_RECORD_SWITCH record, pick a pid and replace
in the following line.
Example output:
cpu: 3, pid: 31463, tid: 31593 { type: context_switch, next_prev_pid: 31463, next_prev_tid: 31593, switch_out: 1 }
cpu: 1, pid: 31463, tid: 31489 { type: context_switch, next_prev_pid: 31463, next_prev_tid: 31489, switch_out: 1 }
cpu: 2, pid: 31463, tid: 31496 { type: context_switch, next_prev_pid: 31463, next_prev_tid: 31496, switch_out: 1 }
cpu: 3, pid: 31463, tid: 31491 { type: context_switch, next_prev_pid: 31463, next_prev_tid: 31491, switch_out: 0 }
It is possible as well to use event.misc & perf.PERF_RECORD_MISC_SWITCH_OUT
to figure out if this is a context switch in or out of the monitored threads.
If bored, please add command line option parsing support for these options :-)
"""
# main(context_switch = 1, thread = 31463)
main()

View File

@@ -61,6 +61,142 @@ import datetime
#
# An example of using the database is provided by the script
# call-graph-from-postgresql.py. Refer to that script for details.
#
# Tables:
#
# The tables largely correspond to perf tools' data structures. They are largely self-explanatory.
#
# samples
#
# 'samples' is the main table. It represents what instruction was executing at a point in time
# when something (a selected event) happened. The memory address is the instruction pointer or 'ip'.
#
# calls
#
# 'calls' represents function calls and is related to 'samples' by 'call_id' and 'return_id'.
# 'calls' is only created when the 'calls' option to this script is specified.
#
# call_paths
#
# 'call_paths' represents all the call stacks. Each 'call' has an associated record in 'call_paths'.
# 'calls_paths' is only created when the 'calls' option to this script is specified.
#
# branch_types
#
# 'branch_types' provides descriptions for each type of branch.
#
# comm_threads
#
# 'comm_threads' shows how 'comms' relates to 'threads'.
#
# comms
#
# 'comms' contains a record for each 'comm' - the name given to the executable that is running.
#
# dsos
#
# 'dsos' contains a record for each executable file or library.
#
# machines
#
# 'machines' can be used to distinguish virtual machines if virtualization is supported.
#
# selected_events
#
# 'selected_events' contains a record for each kind of event that has been sampled.
#
# symbols
#
# 'symbols' contains a record for each symbol. Only symbols that have samples are present.
#
# threads
#
# 'threads' contains a record for each thread.
#
# Views:
#
# Most of the tables have views for more friendly display. The views are:
#
# calls_view
# call_paths_view
# comm_threads_view
# dsos_view
# machines_view
# samples_view
# symbols_view
# threads_view
#
# More examples of browsing the database with psql:
# Note that some of the examples are not the most optimal SQL query.
# Note that call information is only available if the script's 'calls' option has been used.
#
# Top 10 function calls (not aggregated by symbol):
#
# SELECT * FROM calls_view ORDER BY elapsed_time DESC LIMIT 10;
#
# Top 10 function calls (aggregated by symbol):
#
# SELECT symbol_id,(SELECT name FROM symbols WHERE id = symbol_id) AS symbol,
# SUM(elapsed_time) AS tot_elapsed_time,SUM(branch_count) AS tot_branch_count
# FROM calls_view GROUP BY symbol_id ORDER BY tot_elapsed_time DESC LIMIT 10;
#
# Note that the branch count gives a rough estimation of cpu usage, so functions
# that took a long time but have a relatively low branch count must have spent time
# waiting.
#
# Find symbols by pattern matching on part of the name (e.g. names containing 'alloc'):
#
# SELECT * FROM symbols_view WHERE name LIKE '%alloc%';
#
# Top 10 function calls for a specific symbol (e.g. whose symbol_id is 187):
#
# SELECT * FROM calls_view WHERE symbol_id = 187 ORDER BY elapsed_time DESC LIMIT 10;
#
# Show function calls made by function in the same context (i.e. same call path) (e.g. one with call_path_id 254):
#
# SELECT * FROM calls_view WHERE parent_call_path_id = 254;
#
# Show branches made during a function call (e.g. where call_id is 29357 and return_id is 29370 and tid is 29670)
#
# SELECT * FROM samples_view WHERE id >= 29357 AND id <= 29370 AND tid = 29670 AND event LIKE 'branches%';
#
# Show transactions:
#
# SELECT * FROM samples_view WHERE event = 'transactions';
#
# Note transaction start has 'in_tx' true whereas, transaction end has 'in_tx' false.
# Transaction aborts have branch_type_name 'transaction abort'
#
# Show transaction aborts:
#
# SELECT * FROM samples_view WHERE event = 'transactions' AND branch_type_name = 'transaction abort';
#
# To print a call stack requires walking the call_paths table. For example this python script:
# #!/usr/bin/python2
#
# import sys
# from PySide.QtSql import *
#
# if __name__ == '__main__':
# if (len(sys.argv) < 3):
# print >> sys.stderr, "Usage is: printcallstack.py <database name> <call_path_id>"
# raise Exception("Too few arguments")
# dbname = sys.argv[1]
# call_path_id = sys.argv[2]
# db = QSqlDatabase.addDatabase('QPSQL')
# db.setDatabaseName(dbname)
# if not db.open():
# raise Exception("Failed to open database " + dbname + " error: " + db.lastError().text())
# query = QSqlQuery(db)
# print " id ip symbol_id symbol dso_id dso_short_name"
# while call_path_id != 0 and call_path_id != 1:
# ret = query.exec_('SELECT * FROM call_paths_view WHERE id = ' + str(call_path_id))
# if not ret:
# raise Exception("Query failed: " + query.lastError().text())
# if not query.next():
# raise Exception("Query failed")
# print "{0:>6} {1:>10} {2:>9} {3:<30} {4:>6} {5:<30}".format(query.value(0), query.value(1), query.value(2), query.value(3), query.value(4), query.value(5))
# call_path_id = query.value(6)
from PySide.QtSql import *
@@ -244,6 +380,91 @@ if perf_db_export_calls:
'parent_call_path_id bigint,'
'flags integer)')
do_query(query, 'CREATE VIEW machines_view AS '
'SELECT '
'id,'
'pid,'
'root_dir,'
'CASE WHEN id=0 THEN \'unknown\' WHEN pid=-1 THEN \'host\' ELSE \'guest\' END AS host_or_guest'
' FROM machines')
do_query(query, 'CREATE VIEW dsos_view AS '
'SELECT '
'id,'
'machine_id,'
'(SELECT host_or_guest FROM machines_view WHERE id = machine_id) AS host_or_guest,'
'short_name,'
'long_name,'
'build_id'
' FROM dsos')
do_query(query, 'CREATE VIEW symbols_view AS '
'SELECT '
'id,'
'name,'
'(SELECT short_name FROM dsos WHERE id=dso_id) AS dso,'
'dso_id,'
'sym_start,'
'sym_end,'
'CASE WHEN binding=0 THEN \'local\' WHEN binding=1 THEN \'global\' ELSE \'weak\' END AS binding'
' FROM symbols')
do_query(query, 'CREATE VIEW threads_view AS '
'SELECT '
'id,'
'machine_id,'
'(SELECT host_or_guest FROM machines_view WHERE id = machine_id) AS host_or_guest,'
'process_id,'
'pid,'
'tid'
' FROM threads')
do_query(query, 'CREATE VIEW comm_threads_view AS '
'SELECT '
'comm_id,'
'(SELECT comm FROM comms WHERE id = comm_id) AS command,'
'thread_id,'
'(SELECT pid FROM threads WHERE id = thread_id) AS pid,'
'(SELECT tid FROM threads WHERE id = thread_id) AS tid'
' FROM comm_threads')
if perf_db_export_calls:
do_query(query, 'CREATE VIEW call_paths_view AS '
'SELECT '
'c.id,'
'to_hex(c.ip) AS ip,'
'c.symbol_id,'
'(SELECT name FROM symbols WHERE id = c.symbol_id) AS symbol,'
'(SELECT dso_id FROM symbols WHERE id = c.symbol_id) AS dso_id,'
'(SELECT dso FROM symbols_view WHERE id = c.symbol_id) AS dso_short_name,'
'c.parent_id,'
'to_hex(p.ip) AS parent_ip,'
'p.symbol_id AS parent_symbol_id,'
'(SELECT name FROM symbols WHERE id = p.symbol_id) AS parent_symbol,'
'(SELECT dso_id FROM symbols WHERE id = p.symbol_id) AS parent_dso_id,'
'(SELECT dso FROM symbols_view WHERE id = p.symbol_id) AS parent_dso_short_name'
' FROM call_paths c INNER JOIN call_paths p ON p.id = c.parent_id')
do_query(query, 'CREATE VIEW calls_view AS '
'SELECT '
'calls.id,'
'thread_id,'
'(SELECT pid FROM threads WHERE id = thread_id) AS pid,'
'(SELECT tid FROM threads WHERE id = thread_id) AS tid,'
'(SELECT comm FROM comms WHERE id = comm_id) AS command,'
'call_path_id,'
'to_hex(ip) AS ip,'
'symbol_id,'
'(SELECT name FROM symbols WHERE id = symbol_id) AS symbol,'
'call_time,'
'return_time,'
'return_time - call_time AS elapsed_time,'
'branch_count,'
'call_id,'
'return_id,'
'CASE WHEN flags=1 THEN \'no call\' WHEN flags=2 THEN \'no return\' WHEN flags=3 THEN \'no call/return\' ELSE \'\' END AS flags,'
'parent_call_path_id'
' FROM calls INNER JOIN call_paths ON call_paths.id = call_path_id')
do_query(query, 'CREATE VIEW samples_view AS '
'SELECT '
'id,'

View File

@@ -8,7 +8,6 @@ perf-y += openat-syscall-all-cpus.o
perf-y += openat-syscall-tp-fields.o
perf-y += mmap-basic.o
perf-y += perf-record.o
perf-y += rdpmc.o
perf-y += evsel-roundtrip-name.o
perf-y += evsel-tp-sched.o
perf-y += fdarray.o
@@ -33,8 +32,7 @@ perf-y += parse-no-sample-id-all.o
perf-y += kmod-path.o
perf-y += thread-map.o
perf-y += llvm.o
perf-$(CONFIG_X86) += perf-time-to-tsc.o
perf-y += topology.o
ifeq ($(ARCH),$(filter $(ARCH),x86 arm arm64))
perf-$(CONFIG_DWARF_UNWIND) += dwarf-unwind.o

View File

@@ -0,0 +1,44 @@
#ifndef LINUX_VERSION_CODE
# error Need LINUX_VERSION_CODE
# error Example: for 4.2 kernel, put 'clang-opt="-DLINUX_VERSION_CODE=0x40200" into llvm section of ~/.perfconfig'
#endif
#define BPF_ANY 0
#define BPF_MAP_TYPE_ARRAY 2
#define BPF_FUNC_map_lookup_elem 1
#define BPF_FUNC_map_update_elem 2
static void *(*bpf_map_lookup_elem)(void *map, void *key) =
(void *) BPF_FUNC_map_lookup_elem;
static void *(*bpf_map_update_elem)(void *map, void *key, void *value, int flags) =
(void *) BPF_FUNC_map_update_elem;
struct bpf_map_def {
unsigned int type;
unsigned int key_size;
unsigned int value_size;
unsigned int max_entries;
};
#define SEC(NAME) __attribute__((section(NAME), used))
struct bpf_map_def SEC("maps") flip_table = {
.type = BPF_MAP_TYPE_ARRAY,
.key_size = sizeof(int),
.value_size = sizeof(int),
.max_entries = 1,
};
SEC("func=sys_epoll_pwait")
int bpf_func__sys_epoll_pwait(void *ctx)
{
int ind =0;
int *flag = bpf_map_lookup_elem(&flip_table, &ind);
int new_flag;
if (!flag)
return 0;
/* flip flag and store back */
new_flag = !*flag;
bpf_map_update_elem(&flip_table, &ind, &new_flag, BPF_ANY);
return new_flag;
}
char _license[] SEC("license") = "GPL";
int _version SEC("version") = LINUX_VERSION_CODE;

View File

@@ -14,10 +14,13 @@
#include "parse-options.h"
#include "symbol.h"
static struct test {
const char *desc;
int (*func)(void);
} tests[] = {
struct test __weak arch_tests[] = {
{
.func = NULL,
},
};
static struct test generic_tests[] = {
{
.desc = "vmlinux symtab matches kallsyms",
.func = test__vmlinux_matches_kallsyms,
@@ -38,12 +41,6 @@ static struct test {
.desc = "parse events tests",
.func = test__parse_events,
},
#if defined(__x86_64__) || defined(__i386__)
{
.desc = "x86 rdpmc test",
.func = test__rdpmc,
},
#endif
{
.desc = "Validate PERF_RECORD_* events & perf_sample fields",
.func = test__PERF_RECORD,
@@ -104,12 +101,6 @@ static struct test {
.desc = "Test software clock events have valid period values",
.func = test__sw_clock_freq,
},
#if defined(__x86_64__) || defined(__i386__)
{
.desc = "Test converting perf time to TSC",
.func = test__perf_time_to_tsc,
},
#endif
{
.desc = "Test object code reading",
.func = test__code_reading,
@@ -126,14 +117,6 @@ static struct test {
.desc = "Test parsing with no sample_id_all bit set",
.func = test__parse_no_sample_id_all,
},
#if defined(__x86_64__) || defined(__i386__) || defined(__arm__) || defined(__aarch64__)
#ifdef HAVE_DWARF_UNWIND_SUPPORT
{
.desc = "Test dwarf unwind",
.func = test__dwarf_unwind,
},
#endif
#endif
{
.desc = "Test filtering hist entries",
.func = test__hists_filter,
@@ -178,12 +161,21 @@ static struct test {
.desc = "Test LLVM searching and compiling",
.func = test__llvm,
},
{
.desc = "Test topology in session",
.func = test_session_topology,
},
{
.func = NULL,
},
};
static bool perf_test__matches(int curr, int argc, const char *argv[])
static struct test *tests[] = {
generic_tests,
arch_tests,
};
static bool perf_test__matches(struct test *test, int curr, int argc, const char *argv[])
{
int i;
@@ -200,7 +192,7 @@ static bool perf_test__matches(int curr, int argc, const char *argv[])
continue;
}
if (strstr(tests[curr].desc, argv[i]))
if (strstr(test->desc, argv[i]))
return true;
}
@@ -237,27 +229,31 @@ static int run_test(struct test *test)
return err;
}
#define for_each_test(j, t) \
for (j = 0; j < ARRAY_SIZE(tests); j++) \
for (t = &tests[j][0]; t->func; t++)
static int __cmd_test(int argc, const char *argv[], struct intlist *skiplist)
{
struct test *t;
unsigned int j;
int i = 0;
int width = 0;
while (tests[i].func) {
int len = strlen(tests[i].desc);
for_each_test(j, t) {
int len = strlen(t->desc);
if (width < len)
width = len;
++i;
}
i = 0;
while (tests[i].func) {
for_each_test(j, t) {
int curr = i++, err;
if (!perf_test__matches(curr, argc, argv))
if (!perf_test__matches(t, curr, argc, argv))
continue;
pr_info("%2d: %-*s:", i, width, tests[curr].desc);
pr_info("%2d: %-*s:", i, width, t->desc);
if (intlist__find(skiplist, i)) {
color_fprintf(stderr, PERF_COLOR_YELLOW, " Skip (user override)\n");
@@ -265,8 +261,8 @@ static int __cmd_test(int argc, const char *argv[], struct intlist *skiplist)
}
pr_debug("\n--- start ---\n");
err = run_test(&tests[curr]);
pr_debug("---- end ----\n%s:", tests[curr].desc);
err = run_test(t);
pr_debug("---- end ----\n%s:", t->desc);
switch (err) {
case TEST_OK:
@@ -287,15 +283,15 @@ static int __cmd_test(int argc, const char *argv[], struct intlist *skiplist)
static int perf_test__list(int argc, const char **argv)
{
unsigned int j;
struct test *t;
int i = 0;
while (tests[i].func) {
int curr = i++;
if (argc > 1 && !strstr(tests[curr].desc, argv[1]))
for_each_test(j, t) {
if (argc > 1 && !strstr(t->desc, argv[1]))
continue;
pr_info("%2d: %s\n", i, tests[curr].desc);
pr_info("%2d: %s\n", ++i, t->desc);
}
return 0;

Some files were not shown because too many files have changed in this diff Show More