perf/urgent fixes
Subsystems (2)
Arnaldo Carvalho de Melo
maintainerHi Ingo,
Please consider pulling,
- Arnaldo
Test results at the end of this message, as usual.
The following changes since commit 02e184476eff848273826c1d6617bb37e5bcc7ad:
perf/core: Force USER_DS when recording user stack data (2018-09-10 14:01:46 +0200)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-urgent-for-mingo-4.19-20180912
for you to fetch changes up to 03db8b583d1c3c84963e08e2abf6c79081da5c31:
perf tools: Fix maps__find_symbol_by_name() (2018-09-11 14:12:51 -0300)
----------------------------------------------------------------
perf/urgent fixes:
- Fix finding a symbol by name when multiple maps use the same backing DSO, so we must first see if that symbol name is in the DSO, then see if it is inside the range of addresses for that specific map (Adrian Hunter)
- Update the tools copies of UAPI headers, which silences the warnings emitted when building the tools and in some cases, like for the new KVM ioctls, results in 'perf trace' being able to translate that ioctl number to a string (Arnaldo Carvalho de Melo)
----------------------------------------------------------------
Adrian Hunter (1):
perf tools: Fix maps__find_symbol_by_name()
Arnaldo Carvalho de Melo (6):
tools headers uapi: Update tools's copy of linux/perf_event.h tools headers uapi: Update tools's copy of asm-generic/unistd.h tools headers uapi: Update tools's copy of drm/drm.h tools headers uapi: Update tools's copies of kvm headers tools headers uapi: Update tools's copy of linux/vhost.h tools headers uapi: Update tools's copy of linux/if_link.h
tools/arch/arm/include/uapi/asm/kvm.h | 13 ++++++++++++ tools/arch/arm64/include/uapi/asm/kvm.h | 13 ++++++++++++ tools/arch/s390/include/uapi/asm/kvm.h | 5 ++++- tools/arch/x86/include/uapi/asm/kvm.h | 37 +++++++++++++++++++++++++++++++++ tools/include/uapi/asm-generic/unistd.h | 4 +++- tools/include/uapi/drm/drm.h | 9 ++++++++ tools/include/uapi/linux/if_link.h | 17 +++++++++++++++ tools/include/uapi/linux/kvm.h | 6 ++++++ tools/include/uapi/linux/perf_event.h | 2 +- tools/include/uapi/linux/vhost.h | 18 ++++++++++++++++ tools/perf/util/map.c | 11 ++++++++++ 11 files changed, 132 insertions(+), 3 deletions(-)
Test results:
The first ones are container (docker) based builds of tools/perf with and without libelf support. Where clang is available, it is also used to build perf with/without libelf, and building with LIBCLANGLLVM=1 (built-in clang) with gcc and clang when clang and its devel libraries are installed.
The objtool and samples/bpf/ builds are disabled now that I'm switching from using the sources in a local volume to fetching them from a http server to build it inside the container, to make it easier to build in a container cluster. Those will come back later.
Several are cross builds, the ones with -x-ARCH and the android one, and those may not have all the features built, due to lack of multi-arch devel packages, available and being used so far on just a few, like debian:experimental-x-{arm64,mipsel}.
The 'perf test' one will perform a variety of tests exercising tools/perf/util/, tools/lib/{bpf,traceevent,etc}, as well as run perf commands with a variety of command line event specifications to then intercept the sys_perf_event syscall to check that the perf_event_attr fields are set up as expected, among a variety of other unit tests.
Then there is the 'make -C tools/perf build-test' ones, that build tools/perf/ with a variety of feature sets, exercising the build with an incomplete set of features as well as with a complete one. It is planned to have it run on each of the containers mentioned above, using some container orchestration infrastructure. Get in contact if interested in helping having this in place.
The alpine ones are failing due to a XSI/POSIX/GNU disagreement on how strerror_r() should be implemented, a fix is in the works to make libbpf to use the str_error_r() that tools/perf/ has been using to work on libraries such as MUSL, that Alpine Linux uses. This problem was not introduced by any patch in this series.
# dm
1 alpine:3.4 : FAIL gcc (Alpine 5.3.0) 5.3.0
2 alpine:3.5 : FAIL gcc (Alpine 6.2.1) 6.2.1 20160822
3 alpine:3.6 : FAIL gcc (Alpine 6.3.0) 6.3.0
4 alpine:3.7 : FAIL gcc (Alpine 6.4.0) 6.4.0
5 alpine:3.8 : FAIL gcc (Alpine 6.4.0) 6.4.0
6 alpine:edge : FAIL gcc (Alpine 6.4.0) 6.4.0
libbpf.c: In function 'bpf_object__elf_init':
libbpf.c:472:15: error: initialization makes pointer from integer without a cast [-Werror=int-conversion]
char *cp = strerror_r(errno, errmsg, sizeof(errmsg));
7 amazonlinux:1 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28)
8 amazonlinux:2 : Ok gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)
9 android-ndk:r12b-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease)
10 android-ndk:r15c-arm : Ok arm-linux-androideabi-gcc (GCC) 4.9.x 20150123 (prerelease)
11 centos:5 : Ok gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-55)
12 centos:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23)
13 centos:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28)
14 debian:7 : Ok gcc (Debian 4.7.2-5) 4.7.2
15 debian:8 : Ok gcc (Debian 4.9.2-10+deb8u1) 4.9.2
16 debian:9 : Ok gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516
17 debian:experimental : Ok gcc (Debian 8.2.0-4) 8.2.0
18 debian:experimental-x-arm64 : Ok aarch64-linux-gnu-gcc (Debian 8.1.0-12) 8.1.0
19 debian:experimental-x-mips : Ok mips-linux-gnu-gcc (Debian 8.1.0-12) 8.1.0
20 debian:experimental-x-mips64 : Ok mips64-linux-gnuabi64-gcc (Debian 8.1.0-12) 8.1.0
21 debian:experimental-x-mipsel : Ok mipsel-linux-gnu-gcc (Debian 8.1.0-12) 8.1.0
22 fedora:20 : Ok gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-7)
23 fedora:21 : Ok gcc (GCC) 4.9.2 20150212 (Red Hat 4.9.2-6)
24 fedora:22 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6)
25 fedora:23 : Ok gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6)
26 fedora:24 : Ok gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1)
27 fedora:24-x-ARC-uClibc : Ok arc-linux-gcc (ARCompact ISA Linux uClibc toolchain 2017.09-rc2) 7.1.1 20170710
28 fedora:25 : Ok gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1)
29 fedora:26 : Ok gcc (GCC) 7.3.1 20180130 (Red Hat 7.3.1-2)
30 fedora:27 : Ok gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-6)
31 fedora:28 : Ok gcc (GCC) 8.1.1 20180712 (Red Hat 8.1.1-5)
32 fedora:rawhide : Ok gcc (GCC) 8.2.1 20180801 (Red Hat 8.2.1-2)
33 gentoo-stage3-amd64:latest : Ok gcc (Gentoo 7.3.0-r3 p1.4) 7.3.0
34 mageia:5 : Ok gcc (GCC) 4.9.2
35 mageia:6 : Ok gcc (Mageia 5.5.0-1.mga6) 5.5.0
36 opensuse:13.2 : Ok gcc (SUSE Linux) 4.8.3 20140627 [gcc-4_8-branch revision 212064]
37 opensuse:42.1 : Ok gcc (SUSE Linux) 4.8.5
38 opensuse:42.2 : Ok gcc (SUSE Linux) 4.8.5
39 opensuse:42.3 : Ok gcc (SUSE Linux) 4.8.5
40 opensuse:tumbleweed : Ok gcc (SUSE Linux) 7.3.1 20180323 [gcc-7-branch revision 258812]
41 oraclelinux:6 : Ok gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23.0.1)
42 oraclelinux:7 : Ok gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28.0.1)
43 ubuntu:12.04.5 : Ok gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
44 ubuntu:14.04.4 : Ok gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
45 ubuntu:14.04.4-x-linaro-arm64 : Ok aarch64-linux-gnu-gcc (Linaro GCC 5.5-2017.10) 5.5.0
46 ubuntu:16.04 : Ok gcc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609
47 ubuntu:16.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
48 ubuntu:16.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
49 ubuntu:16.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
50 ubuntu:16.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
51 ubuntu:16.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
52 ubuntu:16.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
53 ubuntu:16.10 : Ok gcc (Ubuntu 6.2.0-5ubuntu12) 6.2.0 20161005
54 ubuntu:17.10 : Ok gcc (Ubuntu 7.2.0-8ubuntu3.2) 7.2.0
55 ubuntu:18.04 : Ok gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0
56 ubuntu:18.04-x-arm : Ok arm-linux-gnueabihf-gcc (Ubuntu/Linaro 7.3.0-16ubuntu3) 7.3.0
57 ubuntu:18.04-x-arm64 : Ok aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.3.0-16ubuntu3) 7.3.0
58 ubuntu:18.04-x-m68k : Ok m68k-linux-gnu-gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0
59 ubuntu:18.04-x-powerpc : Ok powerpc-linux-gnu-gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0
60 ubuntu:18.04-x-powerpc64 : Ok powerpc64-linux-gnu-gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0
61 ubuntu:18.04-x-powerpc64el : Ok powerpc64le-linux-gnu-gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0
62 ubuntu:18.04-x-riscv64 : Ok riscv64-linux-gnu-gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0
63 ubuntu:18.04-x-s390 : Ok s390x-linux-gnu-gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0
64 ubuntu:18.04-x-sh4 : Ok sh4-linux-gnu-gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0
65 ubuntu:18.04-x-sparc64 : Ok sparc64-linux-gnu-gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0
66 ubuntu:18.10 : Ok gcc (Ubuntu 8.2.0-4ubuntu1) 8.2.0
#Test "x86 bp modify" fails because this is a kernel that doesn't have the underlying kernel feature fixed.
# uname -a
Linux seventh 4.19.0-rc2-00176-gdb44bf4b4768 #1 SMP Thu Sep 6 14:38:21 -03 2018 x86_64 x86_64 x86_64 GNU/Linux
# git log --oneline -1
03db8b583d1c perf tools: Fix maps__find_symbol_by_name()
# perf version --build-options
perf version 4.19.rc2.g03db8b
dwarf: [ on ] # HAVE_DWARF_SUPPORT
dwarf_getlocations: [ on ] # HAVE_DWARF_GETLOCATIONS_SUPPORT
glibc: [ on ] # HAVE_GLIBC_SUPPORT
gtk2: [ on ] # HAVE_GTK2_SUPPORT
syscall_table: [ on ] # HAVE_SYSCALL_TABLE_SUPPORT
libbfd: [ on ] # HAVE_LIBBFD_SUPPORT
libelf: [ on ] # HAVE_LIBELF_SUPPORT
libnuma: [ on ] # HAVE_LIBNUMA_SUPPORT
numa_num_possible_cpus: [ on ] # HAVE_LIBNUMA_SUPPORT
libperl: [ on ] # HAVE_LIBPERL_SUPPORT
libpython: [ on ] # HAVE_LIBPYTHON_SUPPORT
libslang: [ on ] # HAVE_SLANG_SUPPORT
libcrypto: [ on ] # HAVE_LIBCRYPTO_SUPPORT
libunwind: [ on ] # HAVE_LIBUNWIND_SUPPORT
libdw-dwarf-unwind: [ on ] # HAVE_DWARF_SUPPORT
zlib: [ on ] # HAVE_ZLIB_SUPPORT
lzma: [ on ] # HAVE_LZMA_SUPPORT
get_cpuid: [ on ] # HAVE_AUXTRACE_SUPPORT
bpf: [ on ] # HAVE_LIBBPF_SUPPORT
# perf test
1: vmlinux symtab matches kallsyms : Ok
2: Detect openat syscall event : Ok
3: Detect openat syscall event on all cpus : Ok
4: Read samples using the mmap interface : Ok
5: Test data source output : Ok
6: Parse event definition strings : Ok
7: Simple expression parser : Ok
8: PERF_RECORD_* events & perf_sample fields : Ok
9: Parse perf pmu format : Ok
10: DSO data read : Ok
11: DSO data cache : Ok
12: DSO data reopen : Ok
13: Roundtrip evsel->name : Ok
14: Parse sched tracepoints fields : Ok
15: syscalls:sys_enter_openat event fields : Ok
16: Setup struct perf_event_attr : Ok
17: Match and link multiple hists : Ok
18: 'import perf' in python : Ok
19: Breakpoint overflow signal handler : Ok
20: Breakpoint overflow sampling : Ok
21: Breakpoint accounting : Ok
22: Number of exit events of a simple workload : Ok
23: Software clock events period values : Ok
24: Object code reading : Ok
25: Sample parsing : Ok
26: Use a dummy software event to keep tracking : Ok
27: Parse with no sample_id_all bit set : Ok
28: Filter hist entries : Ok
29: Lookup mmap thread : Ok
30: Share thread mg : Ok
31: Sort output of hist entries : Ok
32: Cumulate child hist entries : Ok
33: Track with sched_switch : Ok
34: Filter fds with revents mask in a fdarray : Ok
35: Add fd to a fdarray, making it autogrow : Ok
36: kmod_path__parse : Ok
37: Thread map : Ok
38: LLVM search and compile :
38.1: Basic BPF llvm compile : Ok
38.2: kbuild searching : Ok
38.3: Compile source for BPF prologue generation : Ok
38.4: Compile source for BPF relocation : Ok
39: Session topology : Ok
40: BPF filter :
40.1: Basic BPF filtering : Ok
40.2: BPF pinning : Ok
40.3: BPF prologue generation : Ok
40.4: BPF relocation checker : Ok
41: Synthesize thread map : Ok
42: Remove thread map : Ok
43: Synthesize cpu map : Ok
44: Synthesize stat config : Ok
45: Synthesize stat : Ok
46: Synthesize stat round : Ok
47: Synthesize attr update : Ok
48: Event times : Ok
49: Read backward ring buffer : Ok
50: Print cpu map : Ok
51: Probe SDT events : Ok
52: is_printable_array : Ok
53: Print bitmap : Ok
54: perf hooks : Ok
55: builtin clang support : Skip (not compiled in)
56: unit_number__scnprintf : Ok
57: mem2node : Ok
58: x86 rdpmc : Ok
59: Convert perf time to TSC : Ok
60: DWARF unwind : Ok
61: x86 instruction decoder - new instructions : Ok
62: x86 bp modify : FAILED!
63: probe libc's inet_pton & backtrace it with ping : Ok
64: Check open filename arg using perf trace + vfs_getname: Ok
65: Use vfs_getname probe to get syscall args filenames : Ok
66: Add vfs_getname probe to get syscall args filenames : Ok $ make -C tools/perf build-test
make: Entering directory '/home/acme/git/perf/tools/perf'
- tarpkg: ./tests/perf-targz-src-pkg .
make_no_libbpf_O: make NO_LIBBPF=1
make_no_ui_O: make NO_NEWT=1 NO_SLANG=1 NO_GTK2=1
make_util_map_o_O: make util/map.o
make_tags_O: make tags
make_no_demangle_O: make NO_DEMANGLE=1
make_no_libunwind_O: make NO_LIBUNWIND=1
make_static_O: make LDFLAGS=-static
make_doc_O: make doc
make_install_prefix_slash_O: make install prefix=/tmp/krava/
make_clean_all_O: make clean all
make_no_auxtrace_O: make NO_AUXTRACE=1
make_debug_O: make DEBUG=1
make_no_libperl_O: make NO_LIBPERL=1
make_no_libdw_dwarf_unwind_O: make NO_LIBDW_DWARF_UNWIND=1
make_no_backtrace_O: make NO_BACKTRACE=1
make_help_O: make help
make_with_clangllvm_O: make LIBCLANGLLVM=1
make_perf_o_O: make perf.o
make_util_pmu_bison_o_O: make util/pmu-bison.o
make_with_babeltrace_O: make LIBBABELTRACE=1
make_no_gtk2_O: make NO_GTK2=1
make_install_bin_O: make install-bin
make_no_newt_O: make NO_NEWT=1
make_cscope_O: make cscope
make_minimal_O: make NO_LIBPERL=1 NO_LIBPYTHON=1 NO_NEWT=1 NO_GTK2=1 NO_DEMANGLE=1 NO_LIBELF=1 NO_LIBUNWIND=1 NO_BACKTRACE=1 NO_LIBNUMA=1 NO_LIBAUDIT=1 NO_LIBBIONIC=1 NO_LIBDW_DWARF_UNWIND=1 NO_AUXTRACE=1 NO_LIBBPF=1 NO_LIBCRYPTO=1 NO_SDT=1 NO_JVMTI=1
make_no_libbionic_O: make NO_LIBBIONIC=1
make_install_prefix_O: make install prefix=/tmp/krava
make_no_libpython_O: make NO_LIBPYTHON=1
make_no_slang_O: make NO_SLANG=1
make_pure_O: make
make_no_libnuma_O: make NO_LIBNUMA=1
make_no_scripts_O: make NO_LIBPYTHON=1 NO_LIBPERL=1
make_no_libaudit_O: make NO_LIBAUDIT=1
make_install_O: make install
make_no_libelf_O: make NO_LIBELF=1
OK
make: Leaving directory '/home/acme/git/perf/tools/perf'
$Arnaldo Carvalho de Melo
maintainerPATCH 1/7 tools headers uapi: Update tools's copy of linux/perf_event.h
From: Arnaldo Carvalho de Melo <[email protected]>
To get the changes in:
09121255c784 ("perf/UAPI: Clearly mark __PERF_SAMPLE_CALLCHAIN_EARLY as internal use")This cures the following warning during perf's build:
Warning: Kernel ABI header at 'tools/include/uapi/linux/perf_event.h' differs from latest version at 'include/uapi/linux/perf_event.h' diff -u tools/include/uapi/linux/perf_event.h include/uapi/linux/perf_event.h
--- tools/include/uapi/linux/perf_event.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/include/uapi/linux/perf_event.h +1 -1
@@ -144,7 +144,7 @@ enum perf_event_sample_format {PERF_SAMPLE_MAX =1U <<20 ,/* non-ABI */ - __PERF_SAMPLE_CALLCHAIN_EARLY = 1ULL << 63, + __PERF_SAMPLE_CALLCHAIN_EARLY = 1ULL << 63, /* non-ABI; internal use */ };/*
Signature · 1 line
2.14.4
Arnaldo Carvalho de Melo
maintainerPATCH 2/7 tools headers uapi: Update tools's copy of asm-generic/unistd.h
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
To get the changes in:
db7a2d1809a5 ("asm-generic: unistd.h: Wire up sys_rseq")That wires up the new 'rsec' system call, which will automagically support that syscall in the syscall table used by 'perf trace' on arm/arm64.
This cures the following warning during perf's build:
Warning: Kernel ABI header at 'tools/include/uapi/asm-generic/unistd.h' differs from latest version at 'include/uapi/asm-generic/unistd.h' diff -u tools/include/uapi/asm-generic/unistd.h include/uapi/asm-generic/unistd.h
--- tools/include/uapi/asm-generic/unistd.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
tools/include/uapi/asm-generic/unistd.h +3 -1
@@ -734,9 +734,11 @@ __SYSCALL(__NR_pkey_free, sys_pkey_free) __SYSCALL(__NR_statx, sys_statx)#define __NR_io_pgetevents 292 __SC_COMP(__NR_io_pgetevents, sys_io_pgetevents, compat_sys_io_pgetevents) +#define __NR_rseq 293 +__SYSCALL(__NR_rseq, sys_rseq)#undef __NR_syscalls -#define __NR_syscalls 293 +#define __NR_syscalls 294/* * 32 bit systems traditionally used different
Signature · 1 line
2.14.4
Arnaldo Carvalho de Melo
maintainerPATCH 3/7 tools headers uapi: Update tools's copy of drm/drm.h
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
To get the changes in:
d67b6a206507 ("drm: writeback: Add client capability for exposing writeback connectors")
This is for an argument to a DRM ioctl, which is not being prettyfied in the 'perf trace' DRM ioctl beautifier, but will now that syscalls are starting to have pointer arguments augmented via BPF.
This time around this just cures the following warning during perf's build:
Warning: Kernel ABI header at 'tools/include/uapi/drm/drm.h' differs from latest version at 'include/uapi/drm/drm.h' diff -u tools/include/uapi/drm/drm.h include/uapi/drm/drm.h
--- tools/include/uapi/drm/drm.h | 9 +++++++++ 1 file changed, 9 insertions(+)
tools/include/uapi/drm/drm.h +9 -0
@@ -687,6 +687,15 @@ struct drm_get_cap {*/ #define DRM_CLIENT_CAP_ASPECT_RATIO 4 +/** +* DRM_CLIENT_CAP_WRITEBACK_CONNECTORS +* +* If set to 1, the DRM core will expose special connectors to be used for +* writing back to memory the scene setup in the commit. Depends on client +* also supporting DRM_CLIENT_CAP_ATOMIC +*/ +#define DRM_CLIENT_CAP_WRITEBACK_CONNECTORS 5 +/** DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */ struct drm_set_client_cap {__u64 capability;
Signature · 1 line
2.14.4
Arnaldo Carvalho de Melo
maintainerPATCH 4/7 tools headers uapi: Update tools's copies of kvm headers
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
To get the changes in:
a449938297e5 ("KVM: s390: Add huge page enablement control")
8fcc4b5923af ("kvm: nVMX: Introduce KVM_CAP_NESTED_STATE")
be26b3a73413 ("arm64: KVM: export the capability to set guest SError syndrome")
b7b27facc7b5 ("arm/arm64: KVM: Add KVM_GET/SET_VCPU_EVENTS")
b0960b9569db ("KVM: arm: Add 32bit get/set events support")
a3da7b4a3be5 ("KVM: s390: add etoken support for guests")This makes 'perf trace' automagically get aware of these new ioctls:
$ cp include/uapi/linux/kvm.h tools/include/uapi/linux/kvm.h
$ tools/perf/trace/beauty/kvm_ioctl.sh > /tmp/after
$ diff -u /tmp/before /tmp/after
--- /tmp/before 2018-09-11 11:18:29.173207586 -0300
+++ /tmp/after 2018-09-11 11:18:38.488200446 -0300
@@ -84,6 +84,8 @@
[0xbb] = "MEMORY_ENCRYPT_REG_REGION",
[0xbc] = "MEMORY_ENCRYPT_UNREG_REGION",
[0xbd] = "HYPERV_EVENTFD",
+ [0xbe] = "GET_NESTED_STATE",
+ [0xbf] = "SET_NESTED_STATE",
[0xe0] = "CREATE_DEVICE",
[0xe1] = "SET_DEVICE_ATTR",
[0xe2] = "GAnd cures the following warning during perf's build:
Warning: Kernel ABI header at 'tools/include/uapi/linux/kvm.h' differs from latest version at 'include/uapi/linux/kvm.h' diff -u tools/include/uapi/linux/kvm.h include/uapi/linux/kvm.h
--- tools/arch/arm/include/uapi/asm/kvm.h | 13 ++++++++++++ tools/arch/arm64/include/uapi/asm/kvm.h | 13 ++++++++++++ tools/arch/s390/include/uapi/asm/kvm.h | 5 ++++- tools/arch/x86/include/uapi/asm/kvm.h | 37 +++++++++++++++++++++++++++++++++ tools/include/uapi/linux/kvm.h | 6 ++++++ 5 files changed, 73 insertions(+), 1 deletion(-)
tools/arch/arm/include/uapi/asm/kvm.h +13 -0
@@ -27,6 +27,7 @@#define __KVM_HAVE_GUEST_DEBUG#define __KVM_HAVE_IRQ_LINE#define __KVM_HAVE_READONLY_MEM +#define __KVM_HAVE_VCPU_EVENTS#define KVM_COALESCED_MMIO_PAGE_OFFSET 1
@@ -125,6 +126,18 @@ struct kvm_sync_regs {struct kvm_arch_memory_slot { }; +/* for KVM_GET/SET_VCPU_EVENTS */ +struct kvm_vcpu_events { +struct { +__u8 serror_pending; +__u8 serror_has_esr; +/* Align it to 8 bytes */ +__u8 pad[6 ]; +__u64 serror_esr; + } exception; +__u32 reserved[12 ]; +}; +/* If you need to interpret the index values, here is the key: */ #define KVM_REG_ARM_COPROC_MASK 0x000000000FFF0000#define KVM_REG_ARM_COPROC_SHIFT 16
tools/arch/arm64/include/uapi/asm/kvm.h +13 -0
@@ -39,6 +39,7 @@#define __KVM_HAVE_GUEST_DEBUG#define __KVM_HAVE_IRQ_LINE#define __KVM_HAVE_READONLY_MEM +#define __KVM_HAVE_VCPU_EVENTS#define KVM_COALESCED_MMIO_PAGE_OFFSET 1
@@ -154,6 +155,18 @@ struct kvm_sync_regs {struct kvm_arch_memory_slot { }; +/* for KVM_GET/SET_VCPU_EVENTS */ +struct kvm_vcpu_events { +struct { +__u8 serror_pending; +__u8 serror_has_esr; +/* Align it to 8 bytes */ +__u8 pad[6 ]; +__u64 serror_esr; + } exception; +__u32 reserved[12 ]; +}; +/* If you need to interpret the index values, here is the key: */ #define KVM_REG_ARM_COPROC_MASK 0x000000000FFF0000#define KVM_REG_ARM_COPROC_SHIFT 16
tools/arch/s390/include/uapi/asm/kvm.h +4 -1
@@ -4,7 +4,7 @@/* * KVM s390 specific structures and definitions * -* Copyright IBM Corp. 2008 +* Copyright IBM Corp. 2008, 2018 * * Author(s): Carsten Otte <[email protected]> * Christian Borntraeger <[email protected]>
@@ -225,6 +225,7 @@ struct kvm_guest_debug_arch {#define KVM_SYNC_FPRS (1UL << 8)#define KVM_SYNC_GSCB (1UL << 9)#define KVM_SYNC_BPBC (1UL << 10) +#define KVM_SYNC_ETOKEN (1UL << 11)/* length and alignment of the sdnx as a power of two */ #define SDNXC 8#define SDNXL (1UL << SDNXC)
@@ -258,6 +259,8 @@ struct kvm_sync_regs {struct {__u64 reserved1[2 ];__u64 gscb[4 ]; +__u64 etoken; +__u64 etoken_extension; }; }; };
tools/arch/x86/include/uapi/asm/kvm.h +37 -0
@@ -378,4 +378,41 @@ struct kvm_sync_regs {#define KVM_X86_QUIRK_LINT0_REENABLED (1 << 0)#define KVM_X86_QUIRK_CD_NW_CLEARED (1 << 1) +#define KVM_STATE_NESTED_GUEST_MODE 0x00000001 +#define KVM_STATE_NESTED_RUN_PENDING 0x00000002 + +#define KVM_STATE_NESTED_SMM_GUEST_MODE 0x00000001 +#define KVM_STATE_NESTED_SMM_VMXON 0x00000002 + +struct kvm_vmx_nested_state { +__u64 vmxon_pa; +__u64 vmcs_pa; + +struct { +__u16 flags; + } smm; +}; + +/* for KVM_CAP_NESTED_STATE */ +struct kvm_nested_state { +/* KVM_STATE_* flags */ +__u16 flags; + +/* 0 for VMX, 1 for SVM. */ +__u16 format; + +/* 128 for SVM, 128 + VMCS size for VMX. */ +__u32 size; + +union { +/* VMXON, VMCS */ +struct kvm_vmx_nested_state vmx; + +/* Pad the header to 128 bytes. */ +__u8 pad[120 ]; + }; + +__u8 data[0 ]; +}; +#endif /* _ASM_X86_KVM_H */
tools/include/uapi/linux/kvm.h +6 -0
@@ -949,6 +949,9 @@ struct kvm_ppc_resize_hpt {#define KVM_CAP_GET_MSR_FEATURES 153#define KVM_CAP_HYPERV_EVENTFD 154#define KVM_CAP_HYPERV_TLBFLUSH 155 +#define KVM_CAP_S390_HPAGE_1M 156 +#define KVM_CAP_NESTED_STATE 157 +#define KVM_CAP_ARM_INJECT_SERROR_ESR 158#ifdef KVM_CAP_IRQ_ROUTING
@@ -1391,6 +1394,9 @@ struct kvm_enc_region {/* Available with KVM_CAP_HYPERV_EVENTFD */ #define KVM_HYPERV_EVENTFD _IOW(KVMIO, 0xbd, struct kvm_hyperv_eventfd) +/* Available with KVM_CAP_NESTED_STATE */ +#define KVM_GET_NESTED_STATE _IOWR(KVMIO, 0xbe, struct kvm_nested_state) +#define KVM_SET_NESTED_STATE _IOW(KVMIO, 0xbf, struct kvm_nested_state)/* Secure Encrypted Virtualization command */ enum sev_cmd_id {
Signature · 1 line
2.14.4
Arnaldo Carvalho de Melo
maintainerPATCH 5/7 tools headers uapi: Update tools's copy of linux/vhost.h
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
To get the changes in:
c48300c92ad9 ("vhost: fix VHOST_GET_BACKEND_FEATURES ioctl request definition")
This makes 'perf trace' and other tools in the future using its beautifiers in a libbeauty.so library be able to translate these new ioctl to strings:
$ tools/perf/trace/beauty/vhost_virtio_ioctl.sh > /tmp/after
$ diff -u /tmp/before /tmp/after
--- /tmp/before 2018-09-11 13:10:57.923038244 -0300
+++ /tmp/after 2018-09-11 13:11:20.329012685 -0300
@@ -15,6 +15,7 @@
[0x22] = "SET_VRING_ERR",
[0x23] = "SET_VRING_BUSYLOOP_TIMEOUT",
[0x24] = "GET_VRING_BUSYLOOP_TIMEOUT",
+ [0x25] = "SET_BACKEND_FEATURES",
[0x30] = "NET_SET_BACKEND",
[0x40] = "SCSI_SET_ENDPOINT",
[0x41] = "SCSI_CLEAR_ENDPOINT",
@@ -27,4 +28,5 @@
static const char *vhost_virtio_ioctl_read_cmds[] = {
[0x00] = "GET_FEATURES",
[0x12] = "GET_VRING_BASE",
+ [0x26] = "GET_BACKEND_FEATURES",
};
$We'll also use this to be able to express syscall filters using symbolic these symbolic names, something like:
# perf trace --all-cpus -e ioctl(cmd=*GET_FEATURES)
This silences the following warning during perf's build:
Warning: Kernel ABI header at 'tools/include/uapi/linux/vhost.h' differs from latest version at 'include/uapi/linux/vhost.h' diff -u tools/include/uapi/linux/vhost.h include/uapi/linux/vhost.h
--- tools/include/uapi/linux/vhost.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
tools/include/uapi/linux/vhost.h +18 -0
@@ -65,6 +65,7 @@ struct vhost_iotlb_msg { };#define VHOST_IOTLB_MSG 0x1 +#define VHOST_IOTLB_MSG_V2 0x2struct vhost_msg {int type;
@@ -74,6 +75,15 @@ struct vhost_msg { }; }; +struct vhost_msg_v2 { +__u32 type; +__u32 reserved; +union { +struct vhost_iotlb_msg iotlb; +__u8 padding[64 ]; + }; +}; +struct vhost_memory_region {__u64 guest_phys_addr;__u64 memory_size;/* bytes */
@@ -160,6 +170,14 @@ struct vhost_memory {#define VHOST_GET_VRING_BUSYLOOP_TIMEOUT _IOW(VHOST_VIRTIO, 0x24, \ struct vhost_vring_state) +/* Set or get vhost backend capability */ + +/* Use message type V2 */ +#define VHOST_BACKEND_F_IOTLB_MSG_V2 0x1 + +#define VHOST_SET_BACKEND_FEATURES _IOW(VHOST_VIRTIO, 0x25, __u64) +#define VHOST_GET_BACKEND_FEATURES _IOR(VHOST_VIRTIO, 0x26, __u64) +/* VHOST_NET specific defines */ /* Attach virtio net ring to a raw socket, or tap device.
Signature · 1 line
2.14.4
Arnaldo Carvalho de Melo
maintainerPATCH 6/7 tools headers uapi: Update tools's copy of linux/if_link.h
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
To get the changes in:
3e7a50ceb11e ("net: report min and max mtu network device settings") 2756f68c3149 ("net: bridge: add support for backup port") a25717d2b604 ("xdp: support simultaneous driver and hw XDP attachment") 4f91da26c811 ("xdp: add per mode attributes for attached programs") f203b76d7809 ("xfrm: Add virtual xfrm interfaces")
Silencing this libbpf build warning:
Warning: Kernel ABI header at 'tools/include/uapi/linux/if_link.h' differs from latest version at 'include/uapi/linux/if_link.h'
--- tools/include/uapi/linux/if_link.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
tools/include/uapi/linux/if_link.h +17 -0
@@ -164,6 +164,8 @@ enum {IFLA_CARRIER_UP_COUNT ,IFLA_CARRIER_DOWN_COUNT ,IFLA_NEW_IFINDEX , +IFLA_MIN_MTU , +IFLA_MAX_MTU , __IFLA_MAX };
@@ -334,6 +336,7 @@ enum {IFLA_BRPORT_GROUP_FWD_MASK ,IFLA_BRPORT_NEIGH_SUPPRESS ,IFLA_BRPORT_ISOLATED , +IFLA_BRPORT_BACKUP_PORT , __IFLA_BRPORT_MAX };#define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)
@@ -459,6 +462,16 @@ enum {#define IFLA_MACSEC_MAX (__IFLA_MACSEC_MAX - 1) +/* XFRM section */ +enum { +IFLA_XFRM_UNSPEC , +IFLA_XFRM_LINK , +IFLA_XFRM_IF_ID , + __IFLA_XFRM_MAX +}; + +#define IFLA_XFRM_MAX (__IFLA_XFRM_MAX - 1) +enum macsec_validation_type {MACSEC_VALIDATE_DISABLED =0 ,MACSEC_VALIDATE_CHECK =1 ,
@@ -920,6 +933,7 @@ enum {XDP_ATTACHED_DRV ,XDP_ATTACHED_SKB ,XDP_ATTACHED_HW , + XDP_ATTACHED_MULTI, }; enum {
@@ -928,6 +942,9 @@ enum {IFLA_XDP_ATTACHED ,IFLA_XDP_FLAGS ,IFLA_XDP_PROG_ID , +IFLA_XDP_DRV_PROG_ID , +IFLA_XDP_SKB_PROG_ID , +IFLA_XDP_HW_PROG_ID , __IFLA_XDP_MAX, };
Signature · 1 line
2.14.4
Arnaldo Carvalho de Melo
maintainerPATCH 7/7 perf tools: Fix maps__find_symbol_by_name()
In reply to Arnaldo Carvalho de MeloFrom: Adrian Hunter <[email protected]>
Commit 1c5aae7710bb ("perf machine: Create maps for x86 PTI entry trampolines") revealed a problem with maps__find_symbol_by_name() that resulted in probes not being found e.g.
$ sudo perf probe xsk_mmap xsk_mmap is out of .text, skip it. Probe point 'xsk_mmap' not found. Error: Failed to add events.
maps__find_symbol_by_name() can optionally return the map of the found symbol. It can get the map wrong because, in fact, the symbol is found on the map's dso, not allowing for the possibility that the dso has more than one map. Fix by always checking the map contains the symbol.
--- tools/perf/util/map.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
tools/perf/util/map.c +11 -0
@@ -576,6 +576,13 @@ struct symbol *map_groups__find_symbol(struct map_groups *mg,return NULL ; } +static bool map__contains_symbol (struct map *map,struct symbol *sym) +{ +u64 ip = map->unmap_ip (map, sym->start); + +return ip >= map->start && ip < map->end; +} +struct symbol *maps__find_symbol_by_name (struct maps *maps,const char *name,struct map **mapp) {
@@ -591,6 +598,10 @@ struct symbol *maps__find_symbol_by_name(struct maps *maps, const char *name,if (sym ==NULL )continue ; +if (!map__contains_symbol (pos, sym)) { + sym =NULL ; +continue ; + }if (mapp !=NULL ) *mapp = pos; goto out;
Signature · 1 line
2.14.4
Quoted 46 lines · Arnaldo Carvalho de Melo
Hi Ingo,
Please consider pulling,
- Arnaldo
Test results at the end of this message, as usual.
The following changes since commit
02e184476eff848273826c1d6617bb37e5bcc7ad:perf/core: Force
USER_DSwhen recording user stack data (2018-09-10 14:01:46 +0200)are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.gittags/perf-urgent-for-mingo-4.19-20180912for you to fetch changes up to
03db8b583d1c3c84963e08e2abf6c79081da5c31:perf tools: Fix
maps__find_symbol_by_name()(2018-09-11 14:12:51 -0300)----------------------------------------------------------------
perf/urgent fixes:- Fix finding a symbol by name when multiple maps use the same backing DSO, so we must first see if that symbol name is in the DSO, then see if it is inside the range of addresses for that specific map (Adrian Hunter)
- Update the tools copies of UAPI headers, which silences the warnings emitted when building the tools and in some cases, like for the new KVM ioctls, results in 'perf trace' being able to translate that ioctl number to a string (Arnaldo Carvalho de Melo)
Signed-off-by Arnaldo Carvalho de Melo <[email protected]>----------------------------------------------------------------
Adrian Hunter (1):
perf tools: Fixmaps__find_symbol_by_name()Arnaldo Carvalho de Melo (6):
tools headers uapi: Update tools's copy oflinux/perf_event.htools headers uapi: Update tools's copy ofasm-generic/unistd.htools headers uapi: Update tools's copy ofdrm/drm.htools headers uapi: Update tools's copies of kvm headers tools headers uapi: Update tools's copy oflinux/vhost.htools headers uapi: Update tools's copy oflinux/if_link.h
Quoted 12 lines
tools/arch/arm/include/uapi/asm/kvm.h | 13 ++++++++++++ tools/arch/arm64/include/uapi/asm/kvm.h | 13 ++++++++++++ tools/arch/s390/include/uapi/asm/kvm.h | 5 ++++- tools/arch/x86/include/uapi/asm/kvm.h | 37 +++++++++++++++++++++++++++++++++ tools/include/uapi/asm-generic/unistd.h | 4 +++- tools/include/uapi/drm/drm.h | 9 ++++++++ tools/include/uapi/linux/if_link.h | 17 +++++++++++++++ tools/include/uapi/linux/kvm.h | 6 ++++++ tools/include/uapi/linux/perf_event.h | 2 +- tools/include/uapi/linux/vhost.h | 18 ++++++++++++++++ tools/perf/util/map.c | 11 ++++++++++ 11 files changed, 132 insertions(+), 3 deletions(-)
Pulled, thanks a lot Arnaldo!
Ingo