aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-04-30 08:14:55 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-04-30 08:14:55 -0400
commit7b6c81f46c5dd7af316bf09aa1991ceed7e53dcd (patch)
tree21e779c6c6d68a41ffd640228359eac060c2e0fe /tools/perf
parent0a84bae7edfb44b50978225c6819c59edfebf645 (diff)
parent6da6c0db5316275015e8cc2959f12a17584aeb64 (diff)
Merge 4.17-rc3 into tty-next
We want the tty and serial driver fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/Documentation/perf-config.txt5
-rw-r--r--tools/perf/Documentation/perf-mem.txt42
-rw-r--r--tools/perf/Documentation/perf-sched.txt4
-rw-r--r--tools/perf/Documentation/perf-script.txt17
-rw-r--r--tools/perf/Documentation/perf-stat.txt2
-rw-r--r--tools/perf/Makefile.config4
-rw-r--r--tools/perf/arch/arm/include/arch-tests.h12
-rw-r--r--tools/perf/arch/arm/tests/Build2
-rw-r--r--tools/perf/arch/arm/tests/arch-tests.c16
-rw-r--r--tools/perf/arch/arm/util/auxtrace.c13
-rw-r--r--tools/perf/arch/arm/util/cs-etm.c13
-rw-r--r--tools/perf/arch/arm/util/cs-etm.h13
-rw-r--r--tools/perf/arch/arm/util/pmu.c13
-rw-r--r--tools/perf/arch/s390/util/auxtrace.c1
-rw-r--r--tools/perf/arch/s390/util/header.c18
-rw-r--r--tools/perf/arch/x86/Makefile2
-rw-r--r--tools/perf/arch/x86/annotate/instructions.c67
-rw-r--r--tools/perf/arch/x86/entry/syscalls/syscall_64.tbl712
-rw-r--r--tools/perf/builtin-help.c2
-rw-r--r--tools/perf/builtin-mem.c4
-rw-r--r--tools/perf/builtin-script.c9
-rw-r--r--tools/perf/builtin-stat.c54
-rw-r--r--tools/perf/builtin-version.c3
-rw-r--r--tools/perf/perf.c4
-rw-r--r--tools/perf/pmu-events/arch/s390/mapfile.csv10
-rw-r--r--tools/perf/tests/attr/test-record-group-sampling3
-rw-r--r--tools/perf/tests/bpf-script-example.c2
-rw-r--r--tools/perf/tests/bpf-script-test-kbuild.c1
-rw-r--r--tools/perf/tests/builtin-test.c1
-rw-r--r--tools/perf/tests/mmap-basic.c2
-rwxr-xr-xtools/perf/tests/shell/record+probe_libc_inet_pton.sh6
-rw-r--r--tools/perf/trace/beauty/mmap.c3
-rw-r--r--tools/perf/ui/browsers/annotate.c5
-rw-r--r--tools/perf/ui/browsers/hists.c2
-rw-r--r--tools/perf/util/annotate.c26
-rw-r--r--tools/perf/util/annotate.h9
-rw-r--r--tools/perf/util/cs-etm-decoder/cs-etm-decoder.c3
-rw-r--r--tools/perf/util/cs-etm.c3
-rw-r--r--tools/perf/util/cs-etm.h13
-rw-r--r--tools/perf/util/event.c4
-rw-r--r--tools/perf/util/evsel.c24
-rw-r--r--tools/perf/util/evsel.h1
-rwxr-xr-xtools/perf/util/generate-cmdlist.sh2
-rw-r--r--tools/perf/util/header.c3
-rw-r--r--tools/perf/util/machine.c30
-rw-r--r--tools/perf/util/parse-events.y8
-rw-r--r--tools/perf/util/pmu.c28
-rw-r--r--tools/perf/util/symbol.c8
-rw-r--r--tools/perf/util/syscalltbl.c6
-rw-r--r--tools/perf/util/trace-event-scripting.c4
50 files changed, 686 insertions, 553 deletions
diff --git a/tools/perf/Documentation/perf-config.txt b/tools/perf/Documentation/perf-config.txt
index 5b4fff3adc4b..32f4a898e3f2 100644
--- a/tools/perf/Documentation/perf-config.txt
+++ b/tools/perf/Documentation/perf-config.txt
@@ -334,6 +334,11 @@ annotate.*::
334 334
335 99.93 │ mov %eax,%eax 335 99.93 │ mov %eax,%eax
336 336
337 annotate.offset_level::
338 Default is '1', meaning just jump targets will have offsets show right beside
339 the instruction. When set to '2' 'call' instructions will also have its offsets
340 shown, 3 or higher will show offsets for all instructions.
341
337hist.*:: 342hist.*::
338 hist.percentage:: 343 hist.percentage::
339 This option control the way to calculate overhead of filtered entries - 344 This option control the way to calculate overhead of filtered entries -
diff --git a/tools/perf/Documentation/perf-mem.txt b/tools/perf/Documentation/perf-mem.txt
index b0211410969b..f8d2167cf3e7 100644
--- a/tools/perf/Documentation/perf-mem.txt
+++ b/tools/perf/Documentation/perf-mem.txt
@@ -28,29 +28,46 @@ OPTIONS
28<command>...:: 28<command>...::
29 Any command you can specify in a shell. 29 Any command you can specify in a shell.
30 30
31-i::
32--input=<file>::
33 Input file name.
34
31-f:: 35-f::
32--force:: 36--force::
33 Don't do ownership validation 37 Don't do ownership validation
34 38
35-t:: 39-t::
36--type=:: 40--type=<type>::
37 Select the memory operation type: load or store (default: load,store) 41 Select the memory operation type: load or store (default: load,store)
38 42
39-D:: 43-D::
40--dump-raw-samples=:: 44--dump-raw-samples::
41 Dump the raw decoded samples on the screen in a format that is easy to parse with 45 Dump the raw decoded samples on the screen in a format that is easy to parse with
42 one sample per line. 46 one sample per line.
43 47
44-x:: 48-x::
45--field-separator:: 49--field-separator=<separator>::
46 Specify the field separator used when dump raw samples (-D option). By default, 50 Specify the field separator used when dump raw samples (-D option). By default,
47 The separator is the space character. 51 The separator is the space character.
48 52
49-C:: 53-C::
50--cpu-list:: 54--cpu=<cpu>::
51 Restrict dump of raw samples to those provided via this option. Note that the same 55 Monitor only on the list of CPUs provided. Multiple CPUs can be provided as a
52 option can be passed in record mode. It will be interpreted the same way as perf 56 comma-separated list with no space: 0,1. Ranges of CPUs are specified with -: 0-2. Default
53 record. 57 is to monitor all CPUS.
58-U::
59--hide-unresolved::
60 Only display entries resolved to a symbol.
61
62-p::
63--phys-data::
64 Record/Report sample physical addresses
65
66RECORD OPTIONS
67--------------
68-e::
69--event <event>::
70 Event selector. Use 'perf mem record -e list' to list available events.
54 71
55-K:: 72-K::
56--all-kernel:: 73--all-kernel::
@@ -60,12 +77,15 @@ OPTIONS
60--all-user:: 77--all-user::
61 Configure all used events to run in user space. 78 Configure all used events to run in user space.
62 79
63--ldload:: 80-v::
81--verbose::
82 Be more verbose (show counter open errors, etc)
83
84--ldlat <n>::
64 Specify desired latency for loads event. 85 Specify desired latency for loads event.
65 86
66-p:: 87In addition, for report all perf report options are valid, and for record
67--phys-data:: 88all perf record options.
68 Record/Report sample physical addresses
69 89
70SEE ALSO 90SEE ALSO
71-------- 91--------
diff --git a/tools/perf/Documentation/perf-sched.txt b/tools/perf/Documentation/perf-sched.txt
index bb33601a823b..63f938b887dd 100644
--- a/tools/perf/Documentation/perf-sched.txt
+++ b/tools/perf/Documentation/perf-sched.txt
@@ -104,8 +104,8 @@ OPTIONS for 'perf sched timehist'
104 kallsyms pathname 104 kallsyms pathname
105 105
106-g:: 106-g::
107--no-call-graph:: 107--call-graph::
108 Do not display call chains if present. 108 Display call chains if present (default on).
109 109
110--max-stack:: 110--max-stack::
111 Maximum number of functions to display in backtrace, default 5. 111 Maximum number of functions to display in backtrace, default 5.
diff --git a/tools/perf/Documentation/perf-script.txt b/tools/perf/Documentation/perf-script.txt
index 36ec0257f8d3..afdafe2110a1 100644
--- a/tools/perf/Documentation/perf-script.txt
+++ b/tools/perf/Documentation/perf-script.txt
@@ -228,14 +228,15 @@ OPTIONS
228 For sample events it's possible to display misc field with -F +misc option, 228 For sample events it's possible to display misc field with -F +misc option,
229 following letters are displayed for each bit: 229 following letters are displayed for each bit:
230 230
231 PERF_RECORD_MISC_KERNEL K 231 PERF_RECORD_MISC_KERNEL K
232 PERF_RECORD_MISC_USER U 232 PERF_RECORD_MISC_USER U
233 PERF_RECORD_MISC_HYPERVISOR H 233 PERF_RECORD_MISC_HYPERVISOR H
234 PERF_RECORD_MISC_GUEST_KERNEL G 234 PERF_RECORD_MISC_GUEST_KERNEL G
235 PERF_RECORD_MISC_GUEST_USER g 235 PERF_RECORD_MISC_GUEST_USER g
236 PERF_RECORD_MISC_MMAP_DATA* M 236 PERF_RECORD_MISC_MMAP_DATA* M
237 PERF_RECORD_MISC_COMM_EXEC E 237 PERF_RECORD_MISC_COMM_EXEC E
238 PERF_RECORD_MISC_SWITCH_OUT S 238 PERF_RECORD_MISC_SWITCH_OUT S
239 PERF_RECORD_MISC_SWITCH_OUT_PREEMPT Sp
239 240
240 $ perf script -F +misc ... 241 $ perf script -F +misc ...
241 sched-messaging 1414 K 28690.636582: 4590 cycles ... 242 sched-messaging 1414 K 28690.636582: 4590 cycles ...
diff --git a/tools/perf/Documentation/perf-stat.txt b/tools/perf/Documentation/perf-stat.txt
index f15b306be183..e6c3b4e555c2 100644
--- a/tools/perf/Documentation/perf-stat.txt
+++ b/tools/perf/Documentation/perf-stat.txt
@@ -153,7 +153,7 @@ perf stat --repeat 10 --null --sync --pre 'make -s O=defconfig-build/clean' -- m
153 153
154-I msecs:: 154-I msecs::
155--interval-print msecs:: 155--interval-print msecs::
156Print count deltas every N milliseconds (minimum: 10ms) 156Print count deltas every N milliseconds (minimum: 1ms)
157The overhead percentage could be high in some cases, for instance with small, sub 100ms intervals. Use with caution. 157The overhead percentage could be high in some cases, for instance with small, sub 100ms intervals. Use with caution.
158 example: 'perf stat -I 1000 -e cycles -a sleep 5' 158 example: 'perf stat -I 1000 -e cycles -a sleep 5'
159 159
diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index c7abd83a8e19..ae7dc46e8f8a 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -68,7 +68,7 @@ ifeq ($(NO_PERF_REGS),0)
68endif 68endif
69 69
70ifneq ($(NO_SYSCALL_TABLE),1) 70ifneq ($(NO_SYSCALL_TABLE),1)
71 CFLAGS += -DHAVE_SYSCALL_TABLE 71 CFLAGS += -DHAVE_SYSCALL_TABLE_SUPPORT
72endif 72endif
73 73
74# So far there's only x86 and arm libdw unwind support merged in perf. 74# So far there's only x86 and arm libdw unwind support merged in perf.
@@ -847,7 +847,7 @@ ifndef NO_JVMTI
847 ifeq ($(feature-jvmti), 1) 847 ifeq ($(feature-jvmti), 1)
848 $(call detected_var,JDIR) 848 $(call detected_var,JDIR)
849 else 849 else
850 $(warning No openjdk development package found, please install JDK package) 850 $(warning No openjdk development package found, please install JDK package, e.g. openjdk-8-jdk, java-1.8.0-openjdk-devel)
851 NO_JVMTI := 1 851 NO_JVMTI := 1
852 endif 852 endif
853endif 853endif
diff --git a/tools/perf/arch/arm/include/arch-tests.h b/tools/perf/arch/arm/include/arch-tests.h
new file mode 100644
index 000000000000..90ec4c8cb880
--- /dev/null
+++ b/tools/perf/arch/arm/include/arch-tests.h
@@ -0,0 +1,12 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef ARCH_TESTS_H
3#define ARCH_TESTS_H
4
5#ifdef HAVE_DWARF_UNWIND_SUPPORT
6struct thread;
7struct perf_sample;
8#endif
9
10extern struct test arch_tests[];
11
12#endif
diff --git a/tools/perf/arch/arm/tests/Build b/tools/perf/arch/arm/tests/Build
index b30eff9bcc83..883c57ff0c08 100644
--- a/tools/perf/arch/arm/tests/Build
+++ b/tools/perf/arch/arm/tests/Build
@@ -1,2 +1,4 @@
1libperf-y += regs_load.o 1libperf-y += regs_load.o
2libperf-y += dwarf-unwind.o 2libperf-y += dwarf-unwind.o
3
4libperf-y += arch-tests.o
diff --git a/tools/perf/arch/arm/tests/arch-tests.c b/tools/perf/arch/arm/tests/arch-tests.c
new file mode 100644
index 000000000000..5b1543c98022
--- /dev/null
+++ b/tools/perf/arch/arm/tests/arch-tests.c
@@ -0,0 +1,16 @@
1// SPDX-License-Identifier: GPL-2.0
2#include <string.h>
3#include "tests/tests.h"
4#include "arch-tests.h"
5
6struct test arch_tests[] = {
7#ifdef HAVE_DWARF_UNWIND_SUPPORT
8 {
9 .desc = "DWARF unwind",
10 .func = test__dwarf_unwind,
11 },
12#endif
13 {
14 .func = NULL,
15 },
16};
diff --git a/tools/perf/arch/arm/util/auxtrace.c b/tools/perf/arch/arm/util/auxtrace.c
index fa639e3e52ac..1ce6bdbda561 100644
--- a/tools/perf/arch/arm/util/auxtrace.c
+++ b/tools/perf/arch/arm/util/auxtrace.c
@@ -1,18 +1,7 @@
1// SPDX-License-Identifier: GPL-2.0
1/* 2/*
2 * Copyright(C) 2015 Linaro Limited. All rights reserved. 3 * Copyright(C) 2015 Linaro Limited. All rights reserved.
3 * Author: Mathieu Poirier <mathieu.poirier@linaro.org> 4 * Author: Mathieu Poirier <mathieu.poirier@linaro.org>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 as published by
7 * the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program. If not, see <http://www.gnu.org/licenses/>.
16 */ 5 */
17 6
18#include <stdbool.h> 7#include <stdbool.h>
diff --git a/tools/perf/arch/arm/util/cs-etm.c b/tools/perf/arch/arm/util/cs-etm.c
index 5c655ad4621e..2f595cd73da6 100644
--- a/tools/perf/arch/arm/util/cs-etm.c
+++ b/tools/perf/arch/arm/util/cs-etm.c
@@ -1,18 +1,7 @@
1// SPDX-License-Identifier: GPL-2.0
1/* 2/*
2 * Copyright(C) 2015 Linaro Limited. All rights reserved. 3 * Copyright(C) 2015 Linaro Limited. All rights reserved.
3 * Author: Mathieu Poirier <mathieu.poirier@linaro.org> 4 * Author: Mathieu Poirier <mathieu.poirier@linaro.org>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 as published by
7 * the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program. If not, see <http://www.gnu.org/licenses/>.
16 */ 5 */
17 6
18#include <api/fs/fs.h> 7#include <api/fs/fs.h>
diff --git a/tools/perf/arch/arm/util/cs-etm.h b/tools/perf/arch/arm/util/cs-etm.h
index 5256741be549..1a12e64f5127 100644
--- a/tools/perf/arch/arm/util/cs-etm.h
+++ b/tools/perf/arch/arm/util/cs-etm.h
@@ -1,18 +1,7 @@
1/* SPDX-License-Identifier: GPL-2.0 */
1/* 2/*
2 * Copyright(C) 2015 Linaro Limited. All rights reserved. 3 * Copyright(C) 2015 Linaro Limited. All rights reserved.
3 * Author: Mathieu Poirier <mathieu.poirier@linaro.org> 4 * Author: Mathieu Poirier <mathieu.poirier@linaro.org>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 as published by
7 * the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program. If not, see <http://www.gnu.org/licenses/>.
16 */ 5 */
17 6
18#ifndef INCLUDE__PERF_CS_ETM_H__ 7#ifndef INCLUDE__PERF_CS_ETM_H__
diff --git a/tools/perf/arch/arm/util/pmu.c b/tools/perf/arch/arm/util/pmu.c
index ac4dffc807b8..e047571e6080 100644
--- a/tools/perf/arch/arm/util/pmu.c
+++ b/tools/perf/arch/arm/util/pmu.c
@@ -1,18 +1,7 @@
1// SPDX-License-Identifier: GPL-2.0
1/* 2/*
2 * Copyright(C) 2015 Linaro Limited. All rights reserved. 3 * Copyright(C) 2015 Linaro Limited. All rights reserved.
3 * Author: Mathieu Poirier <mathieu.poirier@linaro.org> 4 * Author: Mathieu Poirier <mathieu.poirier@linaro.org>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 as published by
7 * the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program. If not, see <http://www.gnu.org/licenses/>.
16 */ 5 */
17 6
18#include <string.h> 7#include <string.h>
diff --git a/tools/perf/arch/s390/util/auxtrace.c b/tools/perf/arch/s390/util/auxtrace.c
index 6cb48e4cffd9..3afe8256eff2 100644
--- a/tools/perf/arch/s390/util/auxtrace.c
+++ b/tools/perf/arch/s390/util/auxtrace.c
@@ -87,6 +87,7 @@ struct auxtrace_record *auxtrace_record__init(struct perf_evlist *evlist,
87 struct perf_evsel *pos; 87 struct perf_evsel *pos;
88 int diagnose = 0; 88 int diagnose = 0;
89 89
90 *err = 0;
90 if (evlist->nr_entries == 0) 91 if (evlist->nr_entries == 0)
91 return NULL; 92 return NULL;
92 93
diff --git a/tools/perf/arch/s390/util/header.c b/tools/perf/arch/s390/util/header.c
index a4c30f1c70be..163b92f33998 100644
--- a/tools/perf/arch/s390/util/header.c
+++ b/tools/perf/arch/s390/util/header.c
@@ -146,21 +146,3 @@ char *get_cpuid_str(struct perf_pmu *pmu __maybe_unused)
146 zfree(&buf); 146 zfree(&buf);
147 return buf; 147 return buf;
148} 148}
149
150/*
151 * Compare the cpuid string returned by get_cpuid() function
152 * with the name generated by the jevents file read from
153 * pmu-events/arch/s390/mapfile.csv.
154 *
155 * Parameter mapcpuid is the cpuid as stored in the
156 * pmu-events/arch/s390/mapfile.csv. This is just the type number.
157 * Parameter cpuid is the cpuid returned by function get_cpuid().
158 */
159int strcmp_cpuid_str(const char *mapcpuid, const char *cpuid)
160{
161 char *cp = strchr(cpuid, ',');
162
163 if (cp == NULL)
164 return -1;
165 return strncmp(cp + 1, mapcpuid, strlen(mapcpuid));
166}
diff --git a/tools/perf/arch/x86/Makefile b/tools/perf/arch/x86/Makefile
index d74eaa7aa927..1a38e78117ce 100644
--- a/tools/perf/arch/x86/Makefile
+++ b/tools/perf/arch/x86/Makefile
@@ -21,7 +21,7 @@ _dummy := $(shell [ -d '$(out)' ] || mkdir -p '$(out)')
21$(header): $(sys)/syscall_64.tbl $(systbl) 21$(header): $(sys)/syscall_64.tbl $(systbl)
22 @(test -d ../../kernel -a -d ../../tools -a -d ../perf && ( \ 22 @(test -d ../../kernel -a -d ../../tools -a -d ../perf && ( \
23 (diff -B arch/x86/entry/syscalls/syscall_64.tbl ../../arch/x86/entry/syscalls/syscall_64.tbl >/dev/null) \ 23 (diff -B arch/x86/entry/syscalls/syscall_64.tbl ../../arch/x86/entry/syscalls/syscall_64.tbl >/dev/null) \
24 || echo "Warning: Kernel ABI header at 'tools/arch/x86/entry/syscalls/syscall_64.tbl' differs from latest version at 'arch/x86/entry/syscalls/syscall_64.tbl'" >&2 )) || true 24 || echo "Warning: Kernel ABI header at 'tools/perf/arch/x86/entry/syscalls/syscall_64.tbl' differs from latest version at 'arch/x86/entry/syscalls/syscall_64.tbl'" >&2 )) || true
25 $(Q)$(SHELL) '$(systbl)' $(sys)/syscall_64.tbl 'x86_64' > $@ 25 $(Q)$(SHELL) '$(systbl)' $(sys)/syscall_64.tbl 'x86_64' > $@
26 26
27clean:: 27clean::
diff --git a/tools/perf/arch/x86/annotate/instructions.c b/tools/perf/arch/x86/annotate/instructions.c
index 5bd1ba8c0282..44f5aba78210 100644
--- a/tools/perf/arch/x86/annotate/instructions.c
+++ b/tools/perf/arch/x86/annotate/instructions.c
@@ -1,21 +1,43 @@
1// SPDX-License-Identifier: GPL-2.0 1// SPDX-License-Identifier: GPL-2.0
2static struct ins x86__instructions[] = { 2static struct ins x86__instructions[] = {
3 { .name = "adc", .ops = &mov_ops, },
4 { .name = "adcb", .ops = &mov_ops, },
5 { .name = "adcl", .ops = &mov_ops, },
3 { .name = "add", .ops = &mov_ops, }, 6 { .name = "add", .ops = &mov_ops, },
4 { .name = "addl", .ops = &mov_ops, }, 7 { .name = "addl", .ops = &mov_ops, },
5 { .name = "addq", .ops = &mov_ops, }, 8 { .name = "addq", .ops = &mov_ops, },
9 { .name = "addsd", .ops = &mov_ops, },
6 { .name = "addw", .ops = &mov_ops, }, 10 { .name = "addw", .ops = &mov_ops, },
7 { .name = "and", .ops = &mov_ops, }, 11 { .name = "and", .ops = &mov_ops, },
12 { .name = "andb", .ops = &mov_ops, },
13 { .name = "andl", .ops = &mov_ops, },
14 { .name = "andpd", .ops = &mov_ops, },
15 { .name = "andps", .ops = &mov_ops, },
16 { .name = "andq", .ops = &mov_ops, },
17 { .name = "andw", .ops = &mov_ops, },
18 { .name = "bsr", .ops = &mov_ops, },
19 { .name = "bt", .ops = &mov_ops, },
20 { .name = "btr", .ops = &mov_ops, },
8 { .name = "bts", .ops = &mov_ops, }, 21 { .name = "bts", .ops = &mov_ops, },
22 { .name = "btsq", .ops = &mov_ops, },
9 { .name = "call", .ops = &call_ops, }, 23 { .name = "call", .ops = &call_ops, },
10 { .name = "callq", .ops = &call_ops, }, 24 { .name = "callq", .ops = &call_ops, },
25 { .name = "cmovbe", .ops = &mov_ops, },
26 { .name = "cmove", .ops = &mov_ops, },
27 { .name = "cmovae", .ops = &mov_ops, },
11 { .name = "cmp", .ops = &mov_ops, }, 28 { .name = "cmp", .ops = &mov_ops, },
12 { .name = "cmpb", .ops = &mov_ops, }, 29 { .name = "cmpb", .ops = &mov_ops, },
13 { .name = "cmpl", .ops = &mov_ops, }, 30 { .name = "cmpl", .ops = &mov_ops, },
14 { .name = "cmpq", .ops = &mov_ops, }, 31 { .name = "cmpq", .ops = &mov_ops, },
15 { .name = "cmpw", .ops = &mov_ops, }, 32 { .name = "cmpw", .ops = &mov_ops, },
16 { .name = "cmpxch", .ops = &mov_ops, }, 33 { .name = "cmpxch", .ops = &mov_ops, },
34 { .name = "cmpxchg", .ops = &mov_ops, },
35 { .name = "cs", .ops = &mov_ops, },
17 { .name = "dec", .ops = &dec_ops, }, 36 { .name = "dec", .ops = &dec_ops, },
18 { .name = "decl", .ops = &dec_ops, }, 37 { .name = "decl", .ops = &dec_ops, },
38 { .name = "divsd", .ops = &mov_ops, },
39 { .name = "divss", .ops = &mov_ops, },
40 { .name = "gs", .ops = &mov_ops, },
19 { .name = "imul", .ops = &mov_ops, }, 41 { .name = "imul", .ops = &mov_ops, },
20 { .name = "inc", .ops = &dec_ops, }, 42 { .name = "inc", .ops = &dec_ops, },
21 { .name = "incl", .ops = &dec_ops, }, 43 { .name = "incl", .ops = &dec_ops, },
@@ -57,25 +79,68 @@ static struct ins x86__instructions[] = {
57 { .name = "lea", .ops = &mov_ops, }, 79 { .name = "lea", .ops = &mov_ops, },
58 { .name = "lock", .ops = &lock_ops, }, 80 { .name = "lock", .ops = &lock_ops, },
59 { .name = "mov", .ops = &mov_ops, }, 81 { .name = "mov", .ops = &mov_ops, },
82 { .name = "movapd", .ops = &mov_ops, },
83 { .name = "movaps", .ops = &mov_ops, },
60 { .name = "movb", .ops = &mov_ops, }, 84 { .name = "movb", .ops = &mov_ops, },
61 { .name = "movdqa", .ops = &mov_ops, }, 85 { .name = "movdqa", .ops = &mov_ops, },
86 { .name = "movdqu", .ops = &mov_ops, },
62 { .name = "movl", .ops = &mov_ops, }, 87 { .name = "movl", .ops = &mov_ops, },
63 { .name = "movq", .ops = &mov_ops, }, 88 { .name = "movq", .ops = &mov_ops, },
89 { .name = "movsd", .ops = &mov_ops, },
64 { .name = "movslq", .ops = &mov_ops, }, 90 { .name = "movslq", .ops = &mov_ops, },
91 { .name = "movss", .ops = &mov_ops, },
92 { .name = "movupd", .ops = &mov_ops, },
93 { .name = "movups", .ops = &mov_ops, },
94 { .name = "movw", .ops = &mov_ops, },
65 { .name = "movzbl", .ops = &mov_ops, }, 95 { .name = "movzbl", .ops = &mov_ops, },
66 { .name = "movzwl", .ops = &mov_ops, }, 96 { .name = "movzwl", .ops = &mov_ops, },
97 { .name = "mulsd", .ops = &mov_ops, },
98 { .name = "mulss", .ops = &mov_ops, },
67 { .name = "nop", .ops = &nop_ops, }, 99 { .name = "nop", .ops = &nop_ops, },
68 { .name = "nopl", .ops = &nop_ops, }, 100 { .name = "nopl", .ops = &nop_ops, },
69 { .name = "nopw", .ops = &nop_ops, }, 101 { .name = "nopw", .ops = &nop_ops, },
70 { .name = "or", .ops = &mov_ops, }, 102 { .name = "or", .ops = &mov_ops, },
103 { .name = "orb", .ops = &mov_ops, },
71 { .name = "orl", .ops = &mov_ops, }, 104 { .name = "orl", .ops = &mov_ops, },
105 { .name = "orps", .ops = &mov_ops, },
106 { .name = "orq", .ops = &mov_ops, },
107 { .name = "pand", .ops = &mov_ops, },
108 { .name = "paddq", .ops = &mov_ops, },
109 { .name = "pcmpeqb", .ops = &mov_ops, },
110 { .name = "por", .ops = &mov_ops, },
111 { .name = "rclb", .ops = &mov_ops, },
112 { .name = "rcll", .ops = &mov_ops, },
113 { .name = "retq", .ops = &ret_ops, },
114 { .name = "sbb", .ops = &mov_ops, },
115 { .name = "sbbl", .ops = &mov_ops, },
116 { .name = "sete", .ops = &mov_ops, },
117 { .name = "sub", .ops = &mov_ops, },
118 { .name = "subl", .ops = &mov_ops, },
119 { .name = "subq", .ops = &mov_ops, },
120 { .name = "subsd", .ops = &mov_ops, },
121 { .name = "subw", .ops = &mov_ops, },
72 { .name = "test", .ops = &mov_ops, }, 122 { .name = "test", .ops = &mov_ops, },
73 { .name = "testb", .ops = &mov_ops, }, 123 { .name = "testb", .ops = &mov_ops, },
74 { .name = "testl", .ops = &mov_ops, }, 124 { .name = "testl", .ops = &mov_ops, },
125 { .name = "ucomisd", .ops = &mov_ops, },
126 { .name = "ucomiss", .ops = &mov_ops, },
127 { .name = "vaddsd", .ops = &mov_ops, },
128 { .name = "vandpd", .ops = &mov_ops, },
129 { .name = "vmovdqa", .ops = &mov_ops, },
130 { .name = "vmovq", .ops = &mov_ops, },
131 { .name = "vmovsd", .ops = &mov_ops, },
132 { .name = "vmulsd", .ops = &mov_ops, },
133 { .name = "vorpd", .ops = &mov_ops, },
134 { .name = "vsubsd", .ops = &mov_ops, },
135 { .name = "vucomisd", .ops = &mov_ops, },
75 { .name = "xadd", .ops = &mov_ops, }, 136 { .name = "xadd", .ops = &mov_ops, },
76 { .name = "xbeginl", .ops = &jump_ops, }, 137 { .name = "xbeginl", .ops = &jump_ops, },
77 { .name = "xbeginq", .ops = &jump_ops, }, 138 { .name = "xbeginq", .ops = &jump_ops, },
78 { .name = "retq", .ops = &ret_ops, }, 139 { .name = "xchg", .ops = &mov_ops, },
140 { .name = "xor", .ops = &mov_ops, },
141 { .name = "xorb", .ops = &mov_ops, },
142 { .name = "xorpd", .ops = &mov_ops, },
143 { .name = "xorps", .ops = &mov_ops, },
79}; 144};
80 145
81static bool x86__ins_is_fused(struct arch *arch, const char *ins1, 146static bool x86__ins_is_fused(struct arch *arch, const char *ins1,
diff --git a/tools/perf/arch/x86/entry/syscalls/syscall_64.tbl b/tools/perf/arch/x86/entry/syscalls/syscall_64.tbl
index 5aef183e2f85..4dfe42666d0c 100644
--- a/tools/perf/arch/x86/entry/syscalls/syscall_64.tbl
+++ b/tools/perf/arch/x86/entry/syscalls/syscall_64.tbl
@@ -4,379 +4,383 @@
4# The format is: 4# The format is:
5# <number> <abi> <name> <entry point> 5# <number> <abi> <name> <entry point>
6# 6#
7# The __x64_sys_*() stubs are created on-the-fly for sys_*() system calls
8#
7# The abi is "common", "64" or "x32" for this file. 9# The abi is "common", "64" or "x32" for this file.
8# 10#
90 common read sys_read 110 common read __x64_sys_read
101 common write sys_write 121 common write __x64_sys_write
112 common open sys_open 132 common open __x64_sys_open
123 common close sys_close 143 common close __x64_sys_close
134 common stat sys_newstat 154 common stat __x64_sys_newstat
145 common fstat sys_newfstat 165 common fstat __x64_sys_newfstat
156 common lstat sys_newlstat 176 common lstat __x64_sys_newlstat
167 common poll sys_poll 187 common poll __x64_sys_poll
178 common lseek sys_lseek 198 common lseek __x64_sys_lseek
189 common mmap sys_mmap 209 common mmap __x64_sys_mmap
1910 common mprotect sys_mprotect 2110 common mprotect __x64_sys_mprotect
2011 common munmap sys_munmap 2211 common munmap __x64_sys_munmap
2112 common brk sys_brk 2312 common brk __x64_sys_brk
2213 64 rt_sigaction sys_rt_sigaction 2413 64 rt_sigaction __x64_sys_rt_sigaction
2314 common rt_sigprocmask sys_rt_sigprocmask 2514 common rt_sigprocmask __x64_sys_rt_sigprocmask
2415 64 rt_sigreturn sys_rt_sigreturn/ptregs 2615 64 rt_sigreturn __x64_sys_rt_sigreturn/ptregs
2516 64 ioctl sys_ioctl 2716 64 ioctl __x64_sys_ioctl
2617 common pread64 sys_pread64 2817 common pread64 __x64_sys_pread64
2718 common pwrite64 sys_pwrite64 2918 common pwrite64 __x64_sys_pwrite64
2819 64 readv sys_readv 3019 64 readv __x64_sys_readv
2920 64 writev sys_writev 3120 64 writev __x64_sys_writev
3021 common access sys_access 3221 common access __x64_sys_access
3122 common pipe sys_pipe 3322 common pipe __x64_sys_pipe
3223 common select sys_select 3423 common select __x64_sys_select
3324 common sched_yield sys_sched_yield 3524 common sched_yield __x64_sys_sched_yield
3425 common mremap sys_mremap 3625 common mremap __x64_sys_mremap
3526 common msync sys_msync 3726 common msync __x64_sys_msync
3627 common mincore sys_mincore 3827 common mincore __x64_sys_mincore
3728 common madvise sys_madvise 3928 common madvise __x64_sys_madvise
3829 common shmget sys_shmget 4029 common shmget __x64_sys_shmget
3930 common shmat sys_shmat 4130 common shmat __x64_sys_shmat
4031 common shmctl sys_shmctl 4231 common shmctl __x64_sys_shmctl
4132 common dup sys_dup 4332 common dup __x64_sys_dup
4233 common dup2 sys_dup2 4433 common dup2 __x64_sys_dup2
4334 common pause sys_pause 4534 common pause __x64_sys_pause
4435 common nanosleep sys_nanosleep 4635 common nanosleep __x64_sys_nanosleep
4536 common getitimer sys_getitimer 4736 common getitimer __x64_sys_getitimer
4637 common alarm sys_alarm 4837 common alarm __x64_sys_alarm
4738 common setitimer sys_setitimer 4938 common setitimer __x64_sys_setitimer
4839 common getpid sys_getpid 5039 common getpid __x64_sys_getpid
4940 common sendfile sys_sendfile64 5140 common sendfile __x64_sys_sendfile64
5041 common socket sys_socket 5241 common socket __x64_sys_socket
5142 common connect sys_connect 5342 common connect __x64_sys_connect
5243 common accept sys_accept 5443 common accept __x64_sys_accept
5344 common sendto sys_sendto 5544 common sendto __x64_sys_sendto
5445 64 recvfrom sys_recvfrom 5645 64 recvfrom __x64_sys_recvfrom
5546 64 sendmsg sys_sendmsg 5746 64 sendmsg __x64_sys_sendmsg
5647 64 recvmsg sys_recvmsg 5847 64 recvmsg __x64_sys_recvmsg
5748 common shutdown sys_shutdown 5948 common shutdown __x64_sys_shutdown
5849 common bind sys_bind 6049 common bind __x64_sys_bind
5950 common listen sys_listen 6150 common listen __x64_sys_listen
6051 common getsockname sys_getsockname 6251 common getsockname __x64_sys_getsockname
6152 common getpeername sys_getpeername 6352 common getpeername __x64_sys_getpeername
6253 common socketpair sys_socketpair 6453 common socketpair __x64_sys_socketpair
6354 64 setsockopt sys_setsockopt 6554 64 setsockopt __x64_sys_setsockopt
6455 64 getsockopt sys_getsockopt 6655 64 getsockopt __x64_sys_getsockopt
6556 common clone sys_clone/ptregs 6756 common clone __x64_sys_clone/ptregs
6657 common fork sys_fork/ptregs 6857 common fork __x64_sys_fork/ptregs
6758 common vfork sys_vfork/ptregs 6958 common vfork __x64_sys_vfork/ptregs
6859 64 execve sys_execve/ptregs 7059 64 execve __x64_sys_execve/ptregs
6960 common exit sys_exit 7160 common exit __x64_sys_exit
7061 common wait4 sys_wait4 7261 common wait4 __x64_sys_wait4
7162 common kill sys_kill 7362 common kill __x64_sys_kill
7263 common uname sys_newuname 7463 common uname __x64_sys_newuname
7364 common semget sys_semget 7564 common semget __x64_sys_semget
7465 common semop sys_semop 7665 common semop __x64_sys_semop
7566 common semctl sys_semctl 7766 common semctl __x64_sys_semctl
7667 common shmdt sys_shmdt 7867 common shmdt __x64_sys_shmdt
7768 common msgget sys_msgget 7968 common msgget __x64_sys_msgget
7869 common msgsnd sys_msgsnd 8069 common msgsnd __x64_sys_msgsnd
7970 common msgrcv sys_msgrcv 8170 common msgrcv __x64_sys_msgrcv
8071 common msgctl sys_msgctl 8271 common msgctl __x64_sys_msgctl
8172 common fcntl sys_fcntl 8372 common fcntl __x64_sys_fcntl
8273 common flock sys_flock 8473 common flock __x64_sys_flock
8374 common fsync sys_fsync 8574 common fsync __x64_sys_fsync
8475 common fdatasync sys_fdatasync 8675 common fdatasync __x64_sys_fdatasync
8576 common truncate sys_truncate 8776 common truncate __x64_sys_truncate
8677 common ftruncate sys_ftruncate 8877 common ftruncate __x64_sys_ftruncate
8778 common getdents sys_getdents 8978 common getdents __x64_sys_getdents
8879 common getcwd sys_getcwd 9079 common getcwd __x64_sys_getcwd
8980 common chdir sys_chdir 9180 common chdir __x64_sys_chdir
9081 common fchdir sys_fchdir 9281 common fchdir __x64_sys_fchdir
9182 common rename sys_rename 9382 common rename __x64_sys_rename
9283 common mkdir sys_mkdir 9483 common mkdir __x64_sys_mkdir
9384 common rmdir sys_rmdir 9584 common rmdir __x64_sys_rmdir
9485 common creat sys_creat 9685 common creat __x64_sys_creat
9586 common link sys_link 9786 common link __x64_sys_link
9687 common unlink sys_unlink 9887 common unlink __x64_sys_unlink
9788 common symlink sys_symlink 9988 common symlink __x64_sys_symlink
9889 common readlink sys_readlink 10089 common readlink __x64_sys_readlink
9990 common chmod sys_chmod 10190 common chmod __x64_sys_chmod
10091 common fchmod sys_fchmod 10291 common fchmod __x64_sys_fchmod
10192 common chown sys_chown 10392 common chown __x64_sys_chown
10293 common fchown sys_fchown 10493 common fchown __x64_sys_fchown
10394 common lchown sys_lchown 10594 common lchown __x64_sys_lchown
10495 common umask sys_umask 10695 common umask __x64_sys_umask
10596 common gettimeofday sys_gettimeofday 10796 common gettimeofday __x64_sys_gettimeofday
10697 common getrlimit sys_getrlimit 10897 common getrlimit __x64_sys_getrlimit
10798 common getrusage sys_getrusage 10998 common getrusage __x64_sys_getrusage
10899 common sysinfo sys_sysinfo 11099 common sysinfo __x64_sys_sysinfo
109100 common times sys_times 111100 common times __x64_sys_times
110101 64 ptrace sys_ptrace 112101 64 ptrace __x64_sys_ptrace
111102 common getuid sys_getuid 113102 common getuid __x64_sys_getuid
112103 common syslog sys_syslog 114103 common syslog __x64_sys_syslog
113104 common getgid sys_getgid 115104 common getgid __x64_sys_getgid
114105 common setuid sys_setuid 116105 common setuid __x64_sys_setuid
115106 common setgid sys_setgid 117106 common setgid __x64_sys_setgid
116107 common geteuid sys_geteuid 118107 common geteuid __x64_sys_geteuid
117108 common getegid sys_getegid 119108 common getegid __x64_sys_getegid
118109 common setpgid sys_setpgid 120109 common setpgid __x64_sys_setpgid
119110 common getppid sys_getppid 121110 common getppid __x64_sys_getppid
120111 common getpgrp sys_getpgrp 122111 common getpgrp __x64_sys_getpgrp
121112 common setsid sys_setsid 123112 common setsid __x64_sys_setsid
122113 common setreuid sys_setreuid 124113 common setreuid __x64_sys_setreuid
123114 common setregid sys_setregid 125114 common setregid __x64_sys_setregid
124115 common getgroups sys_getgroups 126115 common getgroups __x64_sys_getgroups
125116 common setgroups sys_setgroups 127116 common setgroups __x64_sys_setgroups
126117 common setresuid sys_setresuid 128117 common setresuid __x64_sys_setresuid
127118 common getresuid sys_getresuid 129118 common getresuid __x64_sys_getresuid
128119 common setresgid sys_setresgid 130119 common setresgid __x64_sys_setresgid
129120 common getresgid sys_getresgid 131120 common getresgid __x64_sys_getresgid
130121 common getpgid sys_getpgid 132121 common getpgid __x64_sys_getpgid
131122 common setfsuid sys_setfsuid 133122 common setfsuid __x64_sys_setfsuid
132123 common setfsgid sys_setfsgid 134123 common setfsgid __x64_sys_setfsgid
133124 common getsid sys_getsid 135124 common getsid __x64_sys_getsid
134125 common capget sys_capget 136125 common capget __x64_sys_capget
135126 common capset sys_capset 137126 common capset __x64_sys_capset
136127 64 rt_sigpending sys_rt_sigpending 138127 64 rt_sigpending __x64_sys_rt_sigpending
137128 64 rt_sigtimedwait sys_rt_sigtimedwait 139128 64 rt_sigtimedwait __x64_sys_rt_sigtimedwait
138129 64 rt_sigqueueinfo sys_rt_sigqueueinfo 140129 64 rt_sigqueueinfo __x64_sys_rt_sigqueueinfo
139130 common rt_sigsuspend sys_rt_sigsuspend 141130 common rt_sigsuspend __x64_sys_rt_sigsuspend
140131 64 sigaltstack sys_sigaltstack 142131 64 sigaltstack __x64_sys_sigaltstack
141132 common utime sys_utime 143132 common utime __x64_sys_utime
142133 common mknod sys_mknod 144133 common mknod __x64_sys_mknod
143134 64 uselib 145134 64 uselib
144135 common personality sys_personality 146135 common personality __x64_sys_personality
145136 common ustat sys_ustat 147136 common ustat __x64_sys_ustat
146137 common statfs sys_statfs 148137 common statfs __x64_sys_statfs
147138 common fstatfs sys_fstatfs 149138 common fstatfs __x64_sys_fstatfs
148139 common sysfs sys_sysfs 150139 common sysfs __x64_sys_sysfs
149140 common getpriority sys_getpriority 151140 common getpriority __x64_sys_getpriority
150141 common setpriority sys_setpriority 152141 common setpriority __x64_sys_setpriority
151142 common sched_setparam sys_sched_setparam 153142 common sched_setparam __x64_sys_sched_setparam
152143 common sched_getparam sys_sched_getparam 154143 common sched_getparam __x64_sys_sched_getparam
153144 common sched_setscheduler sys_sched_setscheduler 155144 common sched_setscheduler __x64_sys_sched_setscheduler
154145 common sched_getscheduler sys_sched_getscheduler 156145 common sched_getscheduler __x64_sys_sched_getscheduler
155146 common sched_get_priority_max sys_sched_get_priority_max 157146 common sched_get_priority_max __x64_sys_sched_get_priority_max
156147 common sched_get_priority_min sys_sched_get_priority_min 158147 common sched_get_priority_min __x64_sys_sched_get_priority_min
157148 common sched_rr_get_interval sys_sched_rr_get_interval 159148 common sched_rr_get_interval __x64_sys_sched_rr_get_interval
158149 common mlock sys_mlock 160149 common mlock __x64_sys_mlock
159150 common munlock sys_munlock 161150 common munlock __x64_sys_munlock
160151 common mlockall sys_mlockall 162151 common mlockall __x64_sys_mlockall
161152 common munlockall sys_munlockall 163152 common munlockall __x64_sys_munlockall
162153 common vhangup sys_vhangup 164153 common vhangup __x64_sys_vhangup
163154 common modify_ldt sys_modify_ldt 165154 common modify_ldt __x64_sys_modify_ldt
164155 common pivot_root sys_pivot_root 166155 common pivot_root __x64_sys_pivot_root
165156 64 _sysctl sys_sysctl 167156 64 _sysctl __x64_sys_sysctl
166157 common prctl sys_prctl 168157 common prctl __x64_sys_prctl
167158 common arch_prctl sys_arch_prctl 169158 common arch_prctl __x64_sys_arch_prctl
168159 common adjtimex sys_adjtimex 170159 common adjtimex __x64_sys_adjtimex
169160 common setrlimit sys_setrlimit 171160 common setrlimit __x64_sys_setrlimit
170161 common chroot sys_chroot 172161 common chroot __x64_sys_chroot
171162 common sync sys_sync 173162 common sync __x64_sys_sync
172163 common acct sys_acct 174163 common acct __x64_sys_acct
173164 common settimeofday sys_settimeofday 175164 common settimeofday __x64_sys_settimeofday
174165 common mount sys_mount 176165 common mount __x64_sys_mount
175166 common umount2 sys_umount 177166 common umount2 __x64_sys_umount
176167 common swapon sys_swapon 178167 common swapon __x64_sys_swapon
177168 common swapoff sys_swapoff 179168 common swapoff __x64_sys_swapoff
178169 common reboot sys_reboot 180169 common reboot __x64_sys_reboot
179170 common sethostname sys_sethostname 181170 common sethostname __x64_sys_sethostname
180171 common setdomainname sys_setdomainname 182171 common setdomainname __x64_sys_setdomainname
181172 common iopl sys_iopl/ptregs 183172 common iopl __x64_sys_iopl/ptregs
182173 common ioperm sys_ioperm 184173 common ioperm __x64_sys_ioperm
183174 64 create_module 185174 64 create_module
184175 common init_module sys_init_module 186175 common init_module __x64_sys_init_module
185176 common delete_module sys_delete_module 187176 common delete_module __x64_sys_delete_module
186177 64 get_kernel_syms 188177 64 get_kernel_syms
187178 64 query_module 189178 64 query_module
188179 common quotactl sys_quotactl 190179 common quotactl __x64_sys_quotactl
189180 64 nfsservctl 191180 64 nfsservctl
190181 common getpmsg 192181 common getpmsg
191182 common putpmsg 193182 common putpmsg
192183 common afs_syscall 194183 common afs_syscall
193184 common tuxcall 195184 common tuxcall
194185 common security 196185 common security
195186 common gettid sys_gettid 197186 common gettid __x64_sys_gettid
196187 common readahead sys_readahead 198187 common readahead __x64_sys_readahead
197188 common setxattr sys_setxattr 199188 common setxattr __x64_sys_setxattr
198189 common lsetxattr sys_lsetxattr 200189 common lsetxattr __x64_sys_lsetxattr
199190 common fsetxattr sys_fsetxattr 201190 common fsetxattr __x64_sys_fsetxattr
200191 common getxattr sys_getxattr 202191 common getxattr __x64_sys_getxattr
201192 common lgetxattr sys_lgetxattr 203192 common lgetxattr __x64_sys_lgetxattr
202193 common fgetxattr sys_fgetxattr 204193 common fgetxattr __x64_sys_fgetxattr
203194 common listxattr sys_listxattr 205194 common listxattr __x64_sys_listxattr
204195 common llistxattr sys_llistxattr 206195 common llistxattr __x64_sys_llistxattr
205196 common flistxattr sys_flistxattr 207196 common flistxattr __x64_sys_flistxattr
206197 common removexattr sys_removexattr 208197 common removexattr __x64_sys_removexattr
207198 common lremovexattr sys_lremovexattr 209198 common lremovexattr __x64_sys_lremovexattr
208199 common fremovexattr sys_fremovexattr 210199 common fremovexattr __x64_sys_fremovexattr
209200 common tkill sys_tkill 211200 common tkill __x64_sys_tkill
210201 common time sys_time 212201 common time __x64_sys_time
211202 common futex sys_futex 213202 common futex __x64_sys_futex
212203 common sched_setaffinity sys_sched_setaffinity 214203 common sched_setaffinity __x64_sys_sched_setaffinity
213204 common sched_getaffinity sys_sched_getaffinity 215204 common sched_getaffinity __x64_sys_sched_getaffinity
214205 64 set_thread_area 216205 64 set_thread_area
215206 64 io_setup sys_io_setup 217206 64 io_setup __x64_sys_io_setup
216207 common io_destroy sys_io_destroy 218207 common io_destroy __x64_sys_io_destroy
217208 common io_getevents sys_io_getevents 219208 common io_getevents __x64_sys_io_getevents
218209 64 io_submit sys_io_submit 220209 64 io_submit __x64_sys_io_submit
219210 common io_cancel sys_io_cancel 221210 common io_cancel __x64_sys_io_cancel
220211 64 get_thread_area 222211 64 get_thread_area
221212 common lookup_dcookie sys_lookup_dcookie 223212 common lookup_dcookie __x64_sys_lookup_dcookie
222213 common epoll_create sys_epoll_create 224213 common epoll_create __x64_sys_epoll_create
223214 64 epoll_ctl_old 225214 64 epoll_ctl_old
224215 64 epoll_wait_old 226215 64 epoll_wait_old
225216 common remap_file_pages sys_remap_file_pages 227216 common remap_file_pages __x64_sys_remap_file_pages
226217 common getdents64 sys_getdents64 228217 common getdents64 __x64_sys_getdents64
227218 common set_tid_address sys_set_tid_address 229218 common set_tid_address __x64_sys_set_tid_address
228219 common restart_syscall sys_restart_syscall 230219 common restart_syscall __x64_sys_restart_syscall
229220 common semtimedop sys_semtimedop 231220 common semtimedop __x64_sys_semtimedop
230221 common fadvise64 sys_fadvise64 232221 common fadvise64 __x64_sys_fadvise64
231222 64 timer_create sys_timer_create 233222 64 timer_create __x64_sys_timer_create
232223 common timer_settime sys_timer_settime 234223 common timer_settime __x64_sys_timer_settime
233224 common timer_gettime sys_timer_gettime 235224 common timer_gettime __x64_sys_timer_gettime
234225 common timer_getoverrun sys_timer_getoverrun 236225 common timer_getoverrun __x64_sys_timer_getoverrun
235226 common timer_delete sys_timer_delete 237226 common timer_delete __x64_sys_timer_delete
236227 common clock_settime sys_clock_settime 238227 common clock_settime __x64_sys_clock_settime
237228 common clock_gettime sys_clock_gettime 239228 common clock_gettime __x64_sys_clock_gettime
238229 common clock_getres sys_clock_getres 240229 common clock_getres __x64_sys_clock_getres
239230 common clock_nanosleep sys_clock_nanosleep 241230 common clock_nanosleep __x64_sys_clock_nanosleep
240231 common exit_group sys_exit_group 242231 common exit_group __x64_sys_exit_group
241232 common epoll_wait sys_epoll_wait 243232 common epoll_wait __x64_sys_epoll_wait
242233 common epoll_ctl sys_epoll_ctl 244233 common epoll_ctl __x64_sys_epoll_ctl
243234 common tgkill sys_tgkill 245234 common tgkill __x64_sys_tgkill
244235 common utimes sys_utimes 246235 common utimes __x64_sys_utimes
245236 64 vserver 247236 64 vserver
246237 common mbind sys_mbind 248237 common mbind __x64_sys_mbind
247238 common set_mempolicy sys_set_mempolicy 249238 common set_mempolicy __x64_sys_set_mempolicy
248239 common get_mempolicy sys_get_mempolicy 250239 common get_mempolicy __x64_sys_get_mempolicy
249240 common mq_open sys_mq_open 251240 common mq_open __x64_sys_mq_open
250241 common mq_unlink sys_mq_unlink 252241 common mq_unlink __x64_sys_mq_unlink
251242 common mq_timedsend sys_mq_timedsend 253242 common mq_timedsend __x64_sys_mq_timedsend
252243 common mq_timedreceive sys_mq_timedreceive 254243 common mq_timedreceive __x64_sys_mq_timedreceive
253244 64 mq_notify sys_mq_notify 255244 64 mq_notify __x64_sys_mq_notify
254245 common mq_getsetattr sys_mq_getsetattr 256245 common mq_getsetattr __x64_sys_mq_getsetattr
255246 64 kexec_load sys_kexec_load 257246 64 kexec_load __x64_sys_kexec_load
256247 64 waitid sys_waitid 258247 64 waitid __x64_sys_waitid
257248 common add_key sys_add_key 259248 common add_key __x64_sys_add_key
258249 common request_key sys_request_key 260249 common request_key __x64_sys_request_key
259250 common keyctl sys_keyctl 261250 common keyctl __x64_sys_keyctl
260251 common ioprio_set sys_ioprio_set 262251 common ioprio_set __x64_sys_ioprio_set
261252 common ioprio_get sys_ioprio_get 263252 common ioprio_get __x64_sys_ioprio_get
262253 common inotify_init sys_inotify_init 264253 common inotify_init __x64_sys_inotify_init
263254 common inotify_add_watch sys_inotify_add_watch 265254 common inotify_add_watch __x64_sys_inotify_add_watch
264255 common inotify_rm_watch sys_inotify_rm_watch 266255 common inotify_rm_watch __x64_sys_inotify_rm_watch
265256 common migrate_pages sys_migrate_pages 267256 common migrate_pages __x64_sys_migrate_pages
266257 common openat sys_openat 268257 common openat __x64_sys_openat
267258 common mkdirat sys_mkdirat 269258 common mkdirat __x64_sys_mkdirat
268259 common mknodat sys_mknodat 270259 common mknodat __x64_sys_mknodat
269260 common fchownat sys_fchownat 271260 common fchownat __x64_sys_fchownat
270261 common futimesat sys_futimesat 272261 common futimesat __x64_sys_futimesat
271262 common newfstatat sys_newfstatat 273262 common newfstatat __x64_sys_newfstatat
272263 common unlinkat sys_unlinkat 274263 common unlinkat __x64_sys_unlinkat
273264 common renameat sys_renameat 275264 common renameat __x64_sys_renameat
274265 common linkat sys_linkat 276265 common linkat __x64_sys_linkat
275266 common symlinkat sys_symlinkat 277266 common symlinkat __x64_sys_symlinkat
276267 common readlinkat sys_readlinkat 278267 common readlinkat __x64_sys_readlinkat
277268 common fchmodat sys_fchmodat 279268 common fchmodat __x64_sys_fchmodat
278269 common faccessat sys_faccessat 280269 common faccessat __x64_sys_faccessat
279270 common pselect6 sys_pselect6 281270 common pselect6 __x64_sys_pselect6
280271 common ppoll sys_ppoll 282271 common ppoll __x64_sys_ppoll
281272 common unshare sys_unshare 283272 common unshare __x64_sys_unshare
282273 64 set_robust_list sys_set_robust_list 284273 64 set_robust_list __x64_sys_set_robust_list
283274 64 get_robust_list sys_get_robust_list 285274 64 get_robust_list __x64_sys_get_robust_list
284275 common splice sys_splice 286275 common splice __x64_sys_splice
285276 common tee sys_tee 287276 common tee __x64_sys_tee
286277 common sync_file_range sys_sync_file_range 288277 common sync_file_range __x64_sys_sync_file_range
287278 64 vmsplice sys_vmsplice 289278 64 vmsplice __x64_sys_vmsplice
288279 64 move_pages sys_move_pages 290279 64 move_pages __x64_sys_move_pages
289280 common utimensat sys_utimensat 291280 common utimensat __x64_sys_utimensat
290281 common epoll_pwait sys_epoll_pwait 292281 common epoll_pwait __x64_sys_epoll_pwait
291282 common signalfd sys_signalfd 293282 common signalfd __x64_sys_signalfd
292283 common timerfd_create sys_timerfd_create 294283 common timerfd_create __x64_sys_timerfd_create
293284 common eventfd sys_eventfd 295284 common eventfd __x64_sys_eventfd
294285 common fallocate sys_fallocate 296285 common fallocate __x64_sys_fallocate
295286 common timerfd_settime sys_timerfd_settime 297286 common timerfd_settime __x64_sys_timerfd_settime
296287 common timerfd_gettime sys_timerfd_gettime 298287 common timerfd_gettime __x64_sys_timerfd_gettime
297288 common accept4 sys_accept4 299288 common accept4 __x64_sys_accept4
298289 common signalfd4 sys_signalfd4 300289 common signalfd4 __x64_sys_signalfd4
299290 common eventfd2 sys_eventfd2 301290 common eventfd2 __x64_sys_eventfd2
300291 common epoll_create1 sys_epoll_create1 302291 common epoll_create1 __x64_sys_epoll_create1
301292 common dup3 sys_dup3 303292 common dup3 __x64_sys_dup3
302293 common pipe2 sys_pipe2 304293 common pipe2 __x64_sys_pipe2
303294 common inotify_init1 sys_inotify_init1 305294 common inotify_init1 __x64_sys_inotify_init1
304295 64 preadv sys_preadv 306295 64 preadv __x64_sys_preadv
305296 64 pwritev sys_pwritev 307296 64 pwritev __x64_sys_pwritev
306297 64 rt_tgsigqueueinfo sys_rt_tgsigqueueinfo 308297 64 rt_tgsigqueueinfo __x64_sys_rt_tgsigqueueinfo
307298 common perf_event_open sys_perf_event_open 309298 common perf_event_open __x64_sys_perf_event_open
308299 64 recvmmsg sys_recvmmsg 310299 64 recvmmsg __x64_sys_recvmmsg
309300 common fanotify_init sys_fanotify_init 311300 common fanotify_init __x64_sys_fanotify_init
310301 common fanotify_mark sys_fanotify_mark 312301 common fanotify_mark __x64_sys_fanotify_mark
311302 common prlimit64 sys_prlimit64 313302 common prlimit64 __x64_sys_prlimit64
312303 common name_to_handle_at sys_name_to_handle_at 314303 common name_to_handle_at __x64_sys_name_to_handle_at
313304 common open_by_handle_at sys_open_by_handle_at 315304 common open_by_handle_at __x64_sys_open_by_handle_at
314305 common clock_adjtime sys_clock_adjtime 316305 common clock_adjtime __x64_sys_clock_adjtime
315306 common syncfs sys_syncfs 317306 common syncfs __x64_sys_syncfs
316307 64 sendmmsg sys_sendmmsg 318307 64 sendmmsg __x64_sys_sendmmsg
317308 common setns sys_setns 319308 common setns __x64_sys_setns
318309 common getcpu sys_getcpu 320309 common getcpu __x64_sys_getcpu
319310 64 process_vm_readv sys_process_vm_readv 321310 64 process_vm_readv __x64_sys_process_vm_readv
320311 64 process_vm_writev sys_process_vm_writev 322311 64 process_vm_writev __x64_sys_process_vm_writev
321312 common kcmp sys_kcmp 323312 common kcmp __x64_sys_kcmp
322313 common finit_module sys_finit_module 324313 common finit_module __x64_sys_finit_module
323314 common sched_setattr sys_sched_setattr 325314 common sched_setattr __x64_sys_sched_setattr
324315 common sched_getattr sys_sched_getattr 326315 common sched_getattr __x64_sys_sched_getattr
325316 common renameat2 sys_renameat2 327316 common renameat2 __x64_sys_renameat2
326317 common seccomp sys_seccomp 328317 common seccomp __x64_sys_seccomp
327318 common getrandom sys_getrandom 329318 common getrandom __x64_sys_getrandom
328319 common memfd_create sys_memfd_create 330319 common memfd_create __x64_sys_memfd_create
329320 common kexec_file_load sys_kexec_file_load 331320 common kexec_file_load __x64_sys_kexec_file_load
330321 common bpf sys_bpf 332321 common bpf __x64_sys_bpf
331322 64 execveat sys_execveat/ptregs 333322 64 execveat __x64_sys_execveat/ptregs
332323 common userfaultfd sys_userfaultfd 334323 common userfaultfd __x64_sys_userfaultfd
333324 common membarrier sys_membarrier 335324 common membarrier __x64_sys_membarrier
334325 common mlock2 sys_mlock2 336325 common mlock2 __x64_sys_mlock2
335326 common copy_file_range sys_copy_file_range 337326 common copy_file_range __x64_sys_copy_file_range
336327 64 preadv2 sys_preadv2 338327 64 preadv2 __x64_sys_preadv2
337328 64 pwritev2 sys_pwritev2 339328 64 pwritev2 __x64_sys_pwritev2
338329 common pkey_mprotect sys_pkey_mprotect 340329 common pkey_mprotect __x64_sys_pkey_mprotect
339330 common pkey_alloc sys_pkey_alloc 341330 common pkey_alloc __x64_sys_pkey_alloc
340331 common pkey_free sys_pkey_free 342331 common pkey_free __x64_sys_pkey_free
341332 common statx sys_statx 343332 common statx __x64_sys_statx
342 344
343# 345#
344# x32-specific system call numbers start at 512 to avoid cache impact 346# x32-specific system call numbers start at 512 to avoid cache impact
345# for native 64-bit operation. 347# for native 64-bit operation. The __x32_compat_sys stubs are created
348# on-the-fly for compat_sys_*() compatibility system calls if X86_X32
349# is defined.
346# 350#
347512 x32 rt_sigaction compat_sys_rt_sigaction 351512 x32 rt_sigaction __x32_compat_sys_rt_sigaction
348513 x32 rt_sigreturn sys32_x32_rt_sigreturn 352513 x32 rt_sigreturn sys32_x32_rt_sigreturn
349514 x32 ioctl compat_sys_ioctl 353514 x32 ioctl __x32_compat_sys_ioctl
350515 x32 readv compat_sys_readv 354515 x32 readv __x32_compat_sys_readv
351516 x32 writev compat_sys_writev 355516 x32 writev __x32_compat_sys_writev
352517 x32 recvfrom compat_sys_recvfrom 356517 x32 recvfrom __x32_compat_sys_recvfrom
353518 x32 sendmsg compat_sys_sendmsg 357518 x32 sendmsg __x32_compat_sys_sendmsg
354519 x32 recvmsg compat_sys_recvmsg 358519 x32 recvmsg __x32_compat_sys_recvmsg
355520 x32 execve compat_sys_execve/ptregs 359520 x32 execve __x32_compat_sys_execve/ptregs
356521 x32 ptrace compat_sys_ptrace 360521 x32 ptrace __x32_compat_sys_ptrace
357522 x32 rt_sigpending compat_sys_rt_sigpending 361522 x32 rt_sigpending __x32_compat_sys_rt_sigpending
358523 x32 rt_sigtimedwait compat_sys_rt_sigtimedwait 362523 x32 rt_sigtimedwait __x32_compat_sys_rt_sigtimedwait
359524 x32 rt_sigqueueinfo compat_sys_rt_sigqueueinfo 363524 x32 rt_sigqueueinfo __x32_compat_sys_rt_sigqueueinfo
360525 x32 sigaltstack compat_sys_sigaltstack 364525 x32 sigaltstack __x32_compat_sys_sigaltstack
361526 x32 timer_create compat_sys_timer_create 365526 x32 timer_create __x32_compat_sys_timer_create
362527 x32 mq_notify compat_sys_mq_notify 366527 x32 mq_notify __x32_compat_sys_mq_notify
363528 x32 kexec_load compat_sys_kexec_load 367528 x32 kexec_load __x32_compat_sys_kexec_load
364529 x32 waitid compat_sys_waitid 368529 x32 waitid __x32_compat_sys_waitid
365530 x32 set_robust_list compat_sys_set_robust_list 369530 x32 set_robust_list __x32_compat_sys_set_robust_list
366531 x32 get_robust_list compat_sys_get_robust_list 370531 x32 get_robust_list __x32_compat_sys_get_robust_list
367532 x32 vmsplice compat_sys_vmsplice 371532 x32 vmsplice __x32_compat_sys_vmsplice
368533 x32 move_pages compat_sys_move_pages 372533 x32 move_pages __x32_compat_sys_move_pages
369534 x32 preadv compat_sys_preadv64 373534 x32 preadv __x32_compat_sys_preadv64
370535 x32 pwritev compat_sys_pwritev64 374535 x32 pwritev __x32_compat_sys_pwritev64
371536 x32 rt_tgsigqueueinfo compat_sys_rt_tgsigqueueinfo 375536 x32 rt_tgsigqueueinfo __x32_compat_sys_rt_tgsigqueueinfo
372537 x32 recvmmsg compat_sys_recvmmsg 376537 x32 recvmmsg __x32_compat_sys_recvmmsg
373538 x32 sendmmsg compat_sys_sendmmsg 377538 x32 sendmmsg __x32_compat_sys_sendmmsg
374539 x32 process_vm_readv compat_sys_process_vm_readv 378539 x32 process_vm_readv __x32_compat_sys_process_vm_readv
375540 x32 process_vm_writev compat_sys_process_vm_writev 379540 x32 process_vm_writev __x32_compat_sys_process_vm_writev
376541 x32 setsockopt compat_sys_setsockopt 380541 x32 setsockopt __x32_compat_sys_setsockopt
377542 x32 getsockopt compat_sys_getsockopt 381542 x32 getsockopt __x32_compat_sys_getsockopt
378543 x32 io_setup compat_sys_io_setup 382543 x32 io_setup __x32_compat_sys_io_setup
379544 x32 io_submit compat_sys_io_submit 383544 x32 io_submit __x32_compat_sys_io_submit
380545 x32 execveat compat_sys_execveat/ptregs 384545 x32 execveat __x32_compat_sys_execveat/ptregs
381546 x32 preadv2 compat_sys_preadv64v2 385546 x32 preadv2 __x32_compat_sys_preadv64v2
382547 x32 pwritev2 compat_sys_pwritev64v2 386547 x32 pwritev2 __x32_compat_sys_pwritev64v2
diff --git a/tools/perf/builtin-help.c b/tools/perf/builtin-help.c
index 4aca13f23b9d..1c41b4eaf73c 100644
--- a/tools/perf/builtin-help.c
+++ b/tools/perf/builtin-help.c
@@ -439,7 +439,7 @@ int cmd_help(int argc, const char **argv)
439#ifdef HAVE_LIBELF_SUPPORT 439#ifdef HAVE_LIBELF_SUPPORT
440 "probe", 440 "probe",
441#endif 441#endif
442#if defined(HAVE_LIBAUDIT_SUPPORT) || defined(HAVE_SYSCALL_TABLE) 442#if defined(HAVE_LIBAUDIT_SUPPORT) || defined(HAVE_SYSCALL_TABLE_SUPPORT)
443 "trace", 443 "trace",
444#endif 444#endif
445 NULL }; 445 NULL };
diff --git a/tools/perf/builtin-mem.c b/tools/perf/builtin-mem.c
index 506564651cda..57393e94d156 100644
--- a/tools/perf/builtin-mem.c
+++ b/tools/perf/builtin-mem.c
@@ -83,7 +83,7 @@ static int __cmd_record(int argc, const char **argv, struct perf_mem *mem)
83 }; 83 };
84 84
85 argc = parse_options(argc, argv, options, record_mem_usage, 85 argc = parse_options(argc, argv, options, record_mem_usage,
86 PARSE_OPT_STOP_AT_NON_OPTION); 86 PARSE_OPT_KEEP_UNKNOWN);
87 87
88 rec_argc = argc + 9; /* max number of arguments */ 88 rec_argc = argc + 9; /* max number of arguments */
89 rec_argv = calloc(rec_argc + 1, sizeof(char *)); 89 rec_argv = calloc(rec_argc + 1, sizeof(char *));
@@ -436,7 +436,7 @@ int cmd_mem(int argc, const char **argv)
436 } 436 }
437 437
438 argc = parse_options_subcommand(argc, argv, mem_options, mem_subcommands, 438 argc = parse_options_subcommand(argc, argv, mem_options, mem_subcommands,
439 mem_usage, PARSE_OPT_STOP_AT_NON_OPTION); 439 mem_usage, PARSE_OPT_KEEP_UNKNOWN);
440 440
441 if (!argc || !(strncmp(argv[0], "rec", 3) || mem.operation)) 441 if (!argc || !(strncmp(argv[0], "rec", 3) || mem.operation))
442 usage_with_options(mem_usage, mem_options); 442 usage_with_options(mem_usage, mem_options);
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 313c42423393..e0a9845b6cbc 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -657,8 +657,11 @@ static int perf_sample__fprintf_start(struct perf_sample *sample,
657 break; 657 break;
658 case PERF_RECORD_SWITCH: 658 case PERF_RECORD_SWITCH:
659 case PERF_RECORD_SWITCH_CPU_WIDE: 659 case PERF_RECORD_SWITCH_CPU_WIDE:
660 if (has(SWITCH_OUT)) 660 if (has(SWITCH_OUT)) {
661 ret += fprintf(fp, "S"); 661 ret += fprintf(fp, "S");
662 if (sample->misc & PERF_RECORD_MISC_SWITCH_OUT_PREEMPT)
663 ret += fprintf(fp, "p");
664 }
662 default: 665 default:
663 break; 666 break;
664 } 667 }
@@ -2801,11 +2804,11 @@ int find_scripts(char **scripts_array, char **scripts_path_array)
2801 for_each_lang(scripts_path, scripts_dir, lang_dirent) { 2804 for_each_lang(scripts_path, scripts_dir, lang_dirent) {
2802 scnprintf(lang_path, MAXPATHLEN, "%s/%s", scripts_path, 2805 scnprintf(lang_path, MAXPATHLEN, "%s/%s", scripts_path,
2803 lang_dirent->d_name); 2806 lang_dirent->d_name);
2804#ifdef NO_LIBPERL 2807#ifndef HAVE_LIBPERL_SUPPORT
2805 if (strstr(lang_path, "perl")) 2808 if (strstr(lang_path, "perl"))
2806 continue; 2809 continue;
2807#endif 2810#endif
2808#ifdef NO_LIBPYTHON 2811#ifndef HAVE_LIBPYTHON_SUPPORT
2809 if (strstr(lang_path, "python")) 2812 if (strstr(lang_path, "python"))
2810 continue; 2813 continue;
2811#endif 2814#endif
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index f5c454855908..f17dc601b0f3 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -172,6 +172,7 @@ static bool interval_count;
172static const char *output_name; 172static const char *output_name;
173static int output_fd; 173static int output_fd;
174static int print_free_counters_hint; 174static int print_free_counters_hint;
175static int print_mixed_hw_group_error;
175 176
176struct perf_stat { 177struct perf_stat {
177 bool record; 178 bool record;
@@ -1126,6 +1127,30 @@ static void abs_printout(int id, int nr, struct perf_evsel *evsel, double avg)
1126 fprintf(output, "%s%s", csv_sep, evsel->cgrp->name); 1127 fprintf(output, "%s%s", csv_sep, evsel->cgrp->name);
1127} 1128}
1128 1129
1130static bool is_mixed_hw_group(struct perf_evsel *counter)
1131{
1132 struct perf_evlist *evlist = counter->evlist;
1133 u32 pmu_type = counter->attr.type;
1134 struct perf_evsel *pos;
1135
1136 if (counter->nr_members < 2)
1137 return false;
1138
1139 evlist__for_each_entry(evlist, pos) {
1140 /* software events can be part of any hardware group */
1141 if (pos->attr.type == PERF_TYPE_SOFTWARE)
1142 continue;
1143 if (pmu_type == PERF_TYPE_SOFTWARE) {
1144 pmu_type = pos->attr.type;
1145 continue;
1146 }
1147 if (pmu_type != pos->attr.type)
1148 return true;
1149 }
1150
1151 return false;
1152}
1153
1129static void printout(int id, int nr, struct perf_evsel *counter, double uval, 1154static void printout(int id, int nr, struct perf_evsel *counter, double uval,
1130 char *prefix, u64 run, u64 ena, double noise, 1155 char *prefix, u64 run, u64 ena, double noise,
1131 struct runtime_stat *st) 1156 struct runtime_stat *st)
@@ -1178,8 +1203,11 @@ static void printout(int id, int nr, struct perf_evsel *counter, double uval,
1178 counter->supported ? CNTR_NOT_COUNTED : CNTR_NOT_SUPPORTED, 1203 counter->supported ? CNTR_NOT_COUNTED : CNTR_NOT_SUPPORTED,
1179 csv_sep); 1204 csv_sep);
1180 1205
1181 if (counter->supported) 1206 if (counter->supported) {
1182 print_free_counters_hint = 1; 1207 print_free_counters_hint = 1;
1208 if (is_mixed_hw_group(counter))
1209 print_mixed_hw_group_error = 1;
1210 }
1183 1211
1184 fprintf(stat_config.output, "%-*s%s", 1212 fprintf(stat_config.output, "%-*s%s",
1185 csv_output ? 0 : unit_width, 1213 csv_output ? 0 : unit_width,
@@ -1256,7 +1284,8 @@ static void uniquify_event_name(struct perf_evsel *counter)
1256 char *new_name; 1284 char *new_name;
1257 char *config; 1285 char *config;
1258 1286
1259 if (!counter->pmu_name || !strncmp(counter->name, counter->pmu_name, 1287 if (counter->uniquified_name ||
1288 !counter->pmu_name || !strncmp(counter->name, counter->pmu_name,
1260 strlen(counter->pmu_name))) 1289 strlen(counter->pmu_name)))
1261 return; 1290 return;
1262 1291
@@ -1274,6 +1303,8 @@ static void uniquify_event_name(struct perf_evsel *counter)
1274 counter->name = new_name; 1303 counter->name = new_name;
1275 } 1304 }
1276 } 1305 }
1306
1307 counter->uniquified_name = true;
1277} 1308}
1278 1309
1279static void collect_all_aliases(struct perf_evsel *counter, 1310static void collect_all_aliases(struct perf_evsel *counter,
@@ -1757,6 +1788,11 @@ static void print_footer(void)
1757" echo 0 > /proc/sys/kernel/nmi_watchdog\n" 1788" echo 0 > /proc/sys/kernel/nmi_watchdog\n"
1758" perf stat ...\n" 1789" perf stat ...\n"
1759" echo 1 > /proc/sys/kernel/nmi_watchdog\n"); 1790" echo 1 > /proc/sys/kernel/nmi_watchdog\n");
1791
1792 if (print_mixed_hw_group_error)
1793 fprintf(output,
1794 "The events in group usually have to be from "
1795 "the same PMU. Try reorganizing the group.\n");
1760} 1796}
1761 1797
1762static void print_counters(struct timespec *ts, int argc, const char **argv) 1798static void print_counters(struct timespec *ts, int argc, const char **argv)
@@ -1943,7 +1979,8 @@ static const struct option stat_options[] = {
1943 OPT_STRING(0, "post", &post_cmd, "command", 1979 OPT_STRING(0, "post", &post_cmd, "command",
1944 "command to run after to the measured command"), 1980 "command to run after to the measured command"),
1945 OPT_UINTEGER('I', "interval-print", &stat_config.interval, 1981 OPT_UINTEGER('I', "interval-print", &stat_config.interval,
1946 "print counts at regular interval in ms (>= 10)"), 1982 "print counts at regular interval in ms "
1983 "(overhead is possible for values <= 100ms)"),
1947 OPT_INTEGER(0, "interval-count", &stat_config.times, 1984 OPT_INTEGER(0, "interval-count", &stat_config.times,
1948 "print counts for fixed number of times"), 1985 "print counts for fixed number of times"),
1949 OPT_UINTEGER(0, "timeout", &stat_config.timeout, 1986 OPT_UINTEGER(0, "timeout", &stat_config.timeout,
@@ -2923,17 +2960,6 @@ int cmd_stat(int argc, const char **argv)
2923 } 2960 }
2924 } 2961 }
2925 2962
2926 if (interval && interval < 100) {
2927 if (interval < 10) {
2928 pr_err("print interval must be >= 10ms\n");
2929 parse_options_usage(stat_usage, stat_options, "I", 1);
2930 goto out;
2931 } else
2932 pr_warning("print interval < 100ms. "
2933 "The overhead percentage could be high in some cases. "
2934 "Please proceed with caution.\n");
2935 }
2936
2937 if (stat_config.times && interval) 2963 if (stat_config.times && interval)
2938 interval_count = true; 2964 interval_count = true;
2939 else if (stat_config.times && !interval) { 2965 else if (stat_config.times && !interval) {
diff --git a/tools/perf/builtin-version.c b/tools/perf/builtin-version.c
index 2abe3910d6b6..50df168be326 100644
--- a/tools/perf/builtin-version.c
+++ b/tools/perf/builtin-version.c
@@ -60,7 +60,10 @@ static void library_status(void)
60 STATUS(HAVE_DWARF_GETLOCATIONS_SUPPORT, dwarf_getlocations); 60 STATUS(HAVE_DWARF_GETLOCATIONS_SUPPORT, dwarf_getlocations);
61 STATUS(HAVE_GLIBC_SUPPORT, glibc); 61 STATUS(HAVE_GLIBC_SUPPORT, glibc);
62 STATUS(HAVE_GTK2_SUPPORT, gtk2); 62 STATUS(HAVE_GTK2_SUPPORT, gtk2);
63#ifndef HAVE_SYSCALL_TABLE_SUPPORT
63 STATUS(HAVE_LIBAUDIT_SUPPORT, libaudit); 64 STATUS(HAVE_LIBAUDIT_SUPPORT, libaudit);
65#endif
66 STATUS(HAVE_SYSCALL_TABLE_SUPPORT, syscall_table);
64 STATUS(HAVE_LIBBFD_SUPPORT, libbfd); 67 STATUS(HAVE_LIBBFD_SUPPORT, libbfd);
65 STATUS(HAVE_LIBELF_SUPPORT, libelf); 68 STATUS(HAVE_LIBELF_SUPPORT, libelf);
66 STATUS(HAVE_LIBNUMA_SUPPORT, libnuma); 69 STATUS(HAVE_LIBNUMA_SUPPORT, libnuma);
diff --git a/tools/perf/perf.c b/tools/perf/perf.c
index 1659029d03fc..20a08cb32332 100644
--- a/tools/perf/perf.c
+++ b/tools/perf/perf.c
@@ -73,7 +73,7 @@ static struct cmd_struct commands[] = {
73 { "lock", cmd_lock, 0 }, 73 { "lock", cmd_lock, 0 },
74 { "kvm", cmd_kvm, 0 }, 74 { "kvm", cmd_kvm, 0 },
75 { "test", cmd_test, 0 }, 75 { "test", cmd_test, 0 },
76#if defined(HAVE_LIBAUDIT_SUPPORT) || defined(HAVE_SYSCALL_TABLE) 76#if defined(HAVE_LIBAUDIT_SUPPORT) || defined(HAVE_SYSCALL_TABLE_SUPPORT)
77 { "trace", cmd_trace, 0 }, 77 { "trace", cmd_trace, 0 },
78#endif 78#endif
79 { "inject", cmd_inject, 0 }, 79 { "inject", cmd_inject, 0 },
@@ -491,7 +491,7 @@ int main(int argc, const char **argv)
491 argv[0] = cmd; 491 argv[0] = cmd;
492 } 492 }
493 if (strstarts(cmd, "trace")) { 493 if (strstarts(cmd, "trace")) {
494#if defined(HAVE_LIBAUDIT_SUPPORT) || defined(HAVE_SYSCALL_TABLE) 494#if defined(HAVE_LIBAUDIT_SUPPORT) || defined(HAVE_SYSCALL_TABLE_SUPPORT)
495 setup_path(); 495 setup_path();
496 argv[0] = "trace"; 496 argv[0] = "trace";
497 return cmd_trace(argc, argv); 497 return cmd_trace(argc, argv);
diff --git a/tools/perf/pmu-events/arch/s390/mapfile.csv b/tools/perf/pmu-events/arch/s390/mapfile.csv
index ca7682748a4b..78bcf7f8e206 100644
--- a/tools/perf/pmu-events/arch/s390/mapfile.csv
+++ b/tools/perf/pmu-events/arch/s390/mapfile.csv
@@ -1,6 +1,6 @@
1Family-model,Version,Filename,EventType 1Family-model,Version,Filename,EventType
2209[78],1,cf_z10,core 2^IBM.209[78].*[13]\.[1-5].[[:xdigit:]]+$,1,cf_z10,core
3281[78],1,cf_z196,core 3^IBM.281[78].*[13]\.[1-5].[[:xdigit:]]+$,1,cf_z196,core
4282[78],1,cf_zec12,core 4^IBM.282[78].*[13]\.[1-5].[[:xdigit:]]+$,1,cf_zec12,core
5296[45],1,cf_z13,core 5^IBM.296[45].*[13]\.[1-5].[[:xdigit:]]+$,1,cf_z13,core
63906,3,cf_z14,core 6^IBM.390[67].*[13]\.[1-5].[[:xdigit:]]+$,3,cf_z14,core
diff --git a/tools/perf/tests/attr/test-record-group-sampling b/tools/perf/tests/attr/test-record-group-sampling
index f906b793196f..8a33ca4f9e1f 100644
--- a/tools/perf/tests/attr/test-record-group-sampling
+++ b/tools/perf/tests/attr/test-record-group-sampling
@@ -35,3 +35,6 @@ inherit=0
35# sampling disabled 35# sampling disabled
36sample_freq=0 36sample_freq=0
37sample_period=0 37sample_period=0
38freq=0
39write_backward=0
40sample_id_all=0
diff --git a/tools/perf/tests/bpf-script-example.c b/tools/perf/tests/bpf-script-example.c
index e4123c1b0e88..1ca5106df5f1 100644
--- a/tools/perf/tests/bpf-script-example.c
+++ b/tools/perf/tests/bpf-script-example.c
@@ -31,7 +31,7 @@ struct bpf_map_def SEC("maps") flip_table = {
31 .max_entries = 1, 31 .max_entries = 1,
32}; 32};
33 33
34SEC("func=SyS_epoll_pwait") 34SEC("func=do_epoll_wait")
35int bpf_func__SyS_epoll_pwait(void *ctx) 35int bpf_func__SyS_epoll_pwait(void *ctx)
36{ 36{
37 int ind =0; 37 int ind =0;
diff --git a/tools/perf/tests/bpf-script-test-kbuild.c b/tools/perf/tests/bpf-script-test-kbuild.c
index 3626924740d8..ff3ec8337f0a 100644
--- a/tools/perf/tests/bpf-script-test-kbuild.c
+++ b/tools/perf/tests/bpf-script-test-kbuild.c
@@ -9,7 +9,6 @@
9#define SEC(NAME) __attribute__((section(NAME), used)) 9#define SEC(NAME) __attribute__((section(NAME), used))
10 10
11#include <uapi/linux/fs.h> 11#include <uapi/linux/fs.h>
12#include <uapi/asm/ptrace.h>
13 12
14SEC("func=vfs_llseek") 13SEC("func=vfs_llseek")
15int bpf_func__vfs_llseek(void *ctx) 14int bpf_func__vfs_llseek(void *ctx)
diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c
index 625f5a6772af..cac8f8889bc3 100644
--- a/tools/perf/tests/builtin-test.c
+++ b/tools/perf/tests/builtin-test.c
@@ -118,6 +118,7 @@ static struct test generic_tests[] = {
118 { 118 {
119 .desc = "Breakpoint accounting", 119 .desc = "Breakpoint accounting",
120 .func = test__bp_accounting, 120 .func = test__bp_accounting,
121 .is_supported = test__bp_signal_is_supported,
121 }, 122 },
122 { 123 {
123 .desc = "Number of exit events of a simple workload", 124 .desc = "Number of exit events of a simple workload",
diff --git a/tools/perf/tests/mmap-basic.c b/tools/perf/tests/mmap-basic.c
index bb8e6bcb0d96..0919b0793e5b 100644
--- a/tools/perf/tests/mmap-basic.c
+++ b/tools/perf/tests/mmap-basic.c
@@ -75,7 +75,7 @@ int test__basic_mmap(struct test *test __maybe_unused, int subtest __maybe_unuse
75 snprintf(name, sizeof(name), "sys_enter_%s", syscall_names[i]); 75 snprintf(name, sizeof(name), "sys_enter_%s", syscall_names[i]);
76 evsels[i] = perf_evsel__newtp("syscalls", name); 76 evsels[i] = perf_evsel__newtp("syscalls", name);
77 if (IS_ERR(evsels[i])) { 77 if (IS_ERR(evsels[i])) {
78 pr_debug("perf_evsel__new\n"); 78 pr_debug("perf_evsel__new(%s)\n", name);
79 goto out_delete_evlist; 79 goto out_delete_evlist;
80 } 80 }
81 81
diff --git a/tools/perf/tests/shell/record+probe_libc_inet_pton.sh b/tools/perf/tests/shell/record+probe_libc_inet_pton.sh
index 1ecc1f0ff84a..016882dbbc16 100755
--- a/tools/perf/tests/shell/record+probe_libc_inet_pton.sh
+++ b/tools/perf/tests/shell/record+probe_libc_inet_pton.sh
@@ -19,12 +19,10 @@ trace_libc_inet_pton_backtrace() {
19 expected[1]=".*inet_pton[[:space:]]\($libc\)$" 19 expected[1]=".*inet_pton[[:space:]]\($libc\)$"
20 case "$(uname -m)" in 20 case "$(uname -m)" in
21 s390x) 21 s390x)
22 eventattr='call-graph=dwarf' 22 eventattr='call-graph=dwarf,max-stack=4'
23 expected[2]="gaih_inet.*[[:space:]]\($libc|inlined\)$" 23 expected[2]="gaih_inet.*[[:space:]]\($libc|inlined\)$"
24 expected[3]="__GI_getaddrinfo[[:space:]]\($libc|inlined\)$" 24 expected[3]="(__GI_)?getaddrinfo[[:space:]]\($libc|inlined\)$"
25 expected[4]="main[[:space:]]\(.*/bin/ping.*\)$" 25 expected[4]="main[[:space:]]\(.*/bin/ping.*\)$"
26 expected[5]="__libc_start_main[[:space:]]\($libc\)$"
27 expected[6]="_start[[:space:]]\(.*/bin/ping.*\)$"
28 ;; 26 ;;
29 *) 27 *)
30 eventattr='max-stack=3' 28 eventattr='max-stack=3'
diff --git a/tools/perf/trace/beauty/mmap.c b/tools/perf/trace/beauty/mmap.c
index 417e3ecfe9d7..9f68077b241b 100644
--- a/tools/perf/trace/beauty/mmap.c
+++ b/tools/perf/trace/beauty/mmap.c
@@ -54,6 +54,9 @@ static size_t syscall_arg__scnprintf_mmap_flags(char *bf, size_t size,
54 P_MMAP_FLAG(EXECUTABLE); 54 P_MMAP_FLAG(EXECUTABLE);
55 P_MMAP_FLAG(FILE); 55 P_MMAP_FLAG(FILE);
56 P_MMAP_FLAG(FIXED); 56 P_MMAP_FLAG(FIXED);
57#ifdef MAP_FIXED_NOREPLACE
58 P_MMAP_FLAG(FIXED_NOREPLACE);
59#endif
57 P_MMAP_FLAG(GROWSDOWN); 60 P_MMAP_FLAG(GROWSDOWN);
58 P_MMAP_FLAG(HUGETLB); 61 P_MMAP_FLAG(HUGETLB);
59 P_MMAP_FLAG(LOCKED); 62 P_MMAP_FLAG(LOCKED);
diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c
index 12c099a87f8b..3781d74088a7 100644
--- a/tools/perf/ui/browsers/annotate.c
+++ b/tools/perf/ui/browsers/annotate.c
@@ -692,6 +692,7 @@ static int annotate_browser__run(struct annotate_browser *browser,
692 "J Toggle showing number of jump sources on targets\n" 692 "J Toggle showing number of jump sources on targets\n"
693 "n Search next string\n" 693 "n Search next string\n"
694 "o Toggle disassembler output/simplified view\n" 694 "o Toggle disassembler output/simplified view\n"
695 "O Bump offset level (jump targets -> +call -> all -> cycle thru)\n"
695 "s Toggle source code view\n" 696 "s Toggle source code view\n"
696 "t Circulate percent, total period, samples view\n" 697 "t Circulate percent, total period, samples view\n"
697 "/ Search string\n" 698 "/ Search string\n"
@@ -719,6 +720,10 @@ static int annotate_browser__run(struct annotate_browser *browser,
719 notes->options->use_offset = !notes->options->use_offset; 720 notes->options->use_offset = !notes->options->use_offset;
720 annotation__update_column_widths(notes); 721 annotation__update_column_widths(notes);
721 continue; 722 continue;
723 case 'O':
724 if (++notes->options->offset_level > ANNOTATION__MAX_OFFSET_LEVEL)
725 notes->options->offset_level = ANNOTATION__MIN_OFFSET_LEVEL;
726 continue;
722 case 'j': 727 case 'j':
723 notes->options->jump_arrows = !notes->options->jump_arrows; 728 notes->options->jump_arrows = !notes->options->jump_arrows;
724 continue; 729 continue;
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index 0eec06c105c6..e5f247247daa 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -2714,7 +2714,7 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
2714 "h/?/F1 Show this window\n" \ 2714 "h/?/F1 Show this window\n" \
2715 "UP/DOWN/PGUP\n" \ 2715 "UP/DOWN/PGUP\n" \
2716 "PGDN/SPACE Navigate\n" \ 2716 "PGDN/SPACE Navigate\n" \
2717 "q/ESC/CTRL+C Exit browser\n\n" \ 2717 "q/ESC/CTRL+C Exit browser or go back to previous screen\n\n" \
2718 "For multiple event sessions:\n\n" \ 2718 "For multiple event sessions:\n\n" \
2719 "TAB/UNTAB Switch events\n\n" \ 2719 "TAB/UNTAB Switch events\n\n" \
2720 "For symbolic views (--sort has sym):\n\n" \ 2720 "For symbolic views (--sort has sym):\n\n" \
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index fbad8dfbb186..536ee148bff8 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -46,6 +46,7 @@
46struct annotation_options annotation__default_options = { 46struct annotation_options annotation__default_options = {
47 .use_offset = true, 47 .use_offset = true,
48 .jump_arrows = true, 48 .jump_arrows = true,
49 .offset_level = ANNOTATION__OFFSET_JUMP_TARGETS,
49}; 50};
50 51
51const char *disassembler_style; 52const char *disassembler_style;
@@ -2512,7 +2513,8 @@ static void __annotation_line__write(struct annotation_line *al, struct annotati
2512 if (!notes->options->use_offset) { 2513 if (!notes->options->use_offset) {
2513 printed = scnprintf(bf, sizeof(bf), "%" PRIx64 ": ", addr); 2514 printed = scnprintf(bf, sizeof(bf), "%" PRIx64 ": ", addr);
2514 } else { 2515 } else {
2515 if (al->jump_sources) { 2516 if (al->jump_sources &&
2517 notes->options->offset_level >= ANNOTATION__OFFSET_JUMP_TARGETS) {
2516 if (notes->options->show_nr_jumps) { 2518 if (notes->options->show_nr_jumps) {
2517 int prev; 2519 int prev;
2518 printed = scnprintf(bf, sizeof(bf), "%*d ", 2520 printed = scnprintf(bf, sizeof(bf), "%*d ",
@@ -2523,9 +2525,14 @@ static void __annotation_line__write(struct annotation_line *al, struct annotati
2523 obj__printf(obj, bf); 2525 obj__printf(obj, bf);
2524 obj__set_color(obj, prev); 2526 obj__set_color(obj, prev);
2525 } 2527 }
2526 2528print_addr:
2527 printed = scnprintf(bf, sizeof(bf), "%*" PRIx64 ": ", 2529 printed = scnprintf(bf, sizeof(bf), "%*" PRIx64 ": ",
2528 notes->widths.target, addr); 2530 notes->widths.target, addr);
2531 } else if (ins__is_call(&disasm_line(al)->ins) &&
2532 notes->options->offset_level >= ANNOTATION__OFFSET_CALL) {
2533 goto print_addr;
2534 } else if (notes->options->offset_level == ANNOTATION__MAX_OFFSET_LEVEL) {
2535 goto print_addr;
2529 } else { 2536 } else {
2530 printed = scnprintf(bf, sizeof(bf), "%-*s ", 2537 printed = scnprintf(bf, sizeof(bf), "%-*s ",
2531 notes->widths.addr, " "); 2538 notes->widths.addr, " ");
@@ -2642,10 +2649,11 @@ int __annotation__scnprintf_samples_period(struct annotation *notes,
2642 */ 2649 */
2643static struct annotation_config { 2650static struct annotation_config {
2644 const char *name; 2651 const char *name;
2645 bool *value; 2652 void *value;
2646} annotation__configs[] = { 2653} annotation__configs[] = {
2647 ANNOTATION__CFG(hide_src_code), 2654 ANNOTATION__CFG(hide_src_code),
2648 ANNOTATION__CFG(jump_arrows), 2655 ANNOTATION__CFG(jump_arrows),
2656 ANNOTATION__CFG(offset_level),
2649 ANNOTATION__CFG(show_linenr), 2657 ANNOTATION__CFG(show_linenr),
2650 ANNOTATION__CFG(show_nr_jumps), 2658 ANNOTATION__CFG(show_nr_jumps),
2651 ANNOTATION__CFG(show_nr_samples), 2659 ANNOTATION__CFG(show_nr_samples),
@@ -2677,8 +2685,16 @@ static int annotation__config(const char *var, const char *value,
2677 2685
2678 if (cfg == NULL) 2686 if (cfg == NULL)
2679 pr_debug("%s variable unknown, ignoring...", var); 2687 pr_debug("%s variable unknown, ignoring...", var);
2680 else 2688 else if (strcmp(var, "annotate.offset_level") == 0) {
2681 *cfg->value = perf_config_bool(name, value); 2689 perf_config_int(cfg->value, name, value);
2690
2691 if (*(int *)cfg->value > ANNOTATION__MAX_OFFSET_LEVEL)
2692 *(int *)cfg->value = ANNOTATION__MAX_OFFSET_LEVEL;
2693 else if (*(int *)cfg->value < ANNOTATION__MIN_OFFSET_LEVEL)
2694 *(int *)cfg->value = ANNOTATION__MIN_OFFSET_LEVEL;
2695 } else {
2696 *(bool *)cfg->value = perf_config_bool(name, value);
2697 }
2682 return 0; 2698 return 0;
2683} 2699}
2684 2700
diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h
index db8d09bea07e..f28a9e43421d 100644
--- a/tools/perf/util/annotate.h
+++ b/tools/perf/util/annotate.h
@@ -70,8 +70,17 @@ struct annotation_options {
70 show_nr_jumps, 70 show_nr_jumps,
71 show_nr_samples, 71 show_nr_samples,
72 show_total_period; 72 show_total_period;
73 u8 offset_level;
73}; 74};
74 75
76enum {
77 ANNOTATION__OFFSET_JUMP_TARGETS = 1,
78 ANNOTATION__OFFSET_CALL,
79 ANNOTATION__MAX_OFFSET_LEVEL,
80};
81
82#define ANNOTATION__MIN_OFFSET_LEVEL ANNOTATION__OFFSET_JUMP_TARGETS
83
75extern struct annotation_options annotation__default_options; 84extern struct annotation_options annotation__default_options;
76 85
77struct annotation; 86struct annotation;
diff --git a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
index 640af88331b4..c8b98fa22997 100644
--- a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
+++ b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
@@ -1,6 +1,5 @@
1// SPDX-License-Identifier: GPL-2.0
1/* 2/*
2 * SPDX-License-Identifier: GPL-2.0
3 *
4 * Copyright(C) 2015-2018 Linaro Limited. 3 * Copyright(C) 2015-2018 Linaro Limited.
5 * 4 *
6 * Author: Tor Jeremiassen <tor@ti.com> 5 * Author: Tor Jeremiassen <tor@ti.com>
diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c
index 1b0d422373be..40020b1ca54f 100644
--- a/tools/perf/util/cs-etm.c
+++ b/tools/perf/util/cs-etm.c
@@ -1,6 +1,5 @@
1// SPDX-License-Identifier: GPL-2.0
1/* 2/*
2 * SPDX-License-Identifier: GPL-2.0
3 *
4 * Copyright(C) 2015-2018 Linaro Limited. 3 * Copyright(C) 2015-2018 Linaro Limited.
5 * 4 *
6 * Author: Tor Jeremiassen <tor@ti.com> 5 * Author: Tor Jeremiassen <tor@ti.com>
diff --git a/tools/perf/util/cs-etm.h b/tools/perf/util/cs-etm.h
index 5864d5dca616..37f8d48179ca 100644
--- a/tools/perf/util/cs-etm.h
+++ b/tools/perf/util/cs-etm.h
@@ -1,18 +1,7 @@
1/* SPDX-License-Identifier: GPL-2.0 */
1/* 2/*
2 * Copyright(C) 2015 Linaro Limited. All rights reserved. 3 * Copyright(C) 2015 Linaro Limited. All rights reserved.
3 * Author: Mathieu Poirier <mathieu.poirier@linaro.org> 4 * Author: Mathieu Poirier <mathieu.poirier@linaro.org>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 as published by
7 * the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program. If not, see <http://www.gnu.org/licenses/>.
16 */ 5 */
17 6
18#ifndef INCLUDE__UTIL_PERF_CS_ETM_H__ 7#ifndef INCLUDE__UTIL_PERF_CS_ETM_H__
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index f0a6cbd033cc..98ff3a6a3d50 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -1421,7 +1421,9 @@ size_t perf_event__fprintf_itrace_start(union perf_event *event, FILE *fp)
1421size_t perf_event__fprintf_switch(union perf_event *event, FILE *fp) 1421size_t perf_event__fprintf_switch(union perf_event *event, FILE *fp)
1422{ 1422{
1423 bool out = event->header.misc & PERF_RECORD_MISC_SWITCH_OUT; 1423 bool out = event->header.misc & PERF_RECORD_MISC_SWITCH_OUT;
1424 const char *in_out = out ? "OUT" : "IN "; 1424 const char *in_out = !out ? "IN " :
1425 !(event->header.misc & PERF_RECORD_MISC_SWITCH_OUT_PREEMPT) ?
1426 "OUT " : "OUT preempt";
1425 1427
1426 if (event->header.type == PERF_RECORD_SWITCH) 1428 if (event->header.type == PERF_RECORD_SWITCH)
1427 return fprintf(fp, " %s\n", in_out); 1429 return fprintf(fp, " %s\n", in_out);
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 1ac8d9236efd..4cd2cf93f726 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -930,8 +930,11 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts,
930 * than leader in case leader 'leads' the sampling. 930 * than leader in case leader 'leads' the sampling.
931 */ 931 */
932 if ((leader != evsel) && leader->sample_read) { 932 if ((leader != evsel) && leader->sample_read) {
933 attr->sample_freq = 0; 933 attr->freq = 0;
934 attr->sample_period = 0; 934 attr->sample_freq = 0;
935 attr->sample_period = 0;
936 attr->write_backward = 0;
937 attr->sample_id_all = 0;
935 } 938 }
936 939
937 if (opts->no_samples) 940 if (opts->no_samples)
@@ -1922,7 +1925,8 @@ try_fallback:
1922 goto fallback_missing_features; 1925 goto fallback_missing_features;
1923 } else if (!perf_missing_features.group_read && 1926 } else if (!perf_missing_features.group_read &&
1924 evsel->attr.inherit && 1927 evsel->attr.inherit &&
1925 (evsel->attr.read_format & PERF_FORMAT_GROUP)) { 1928 (evsel->attr.read_format & PERF_FORMAT_GROUP) &&
1929 perf_evsel__is_group_leader(evsel)) {
1926 perf_missing_features.group_read = true; 1930 perf_missing_features.group_read = true;
1927 pr_debug2("switching off group read\n"); 1931 pr_debug2("switching off group read\n");
1928 goto fallback_missing_features; 1932 goto fallback_missing_features;
@@ -2754,8 +2758,14 @@ bool perf_evsel__fallback(struct perf_evsel *evsel, int err,
2754 (paranoid = perf_event_paranoid()) > 1) { 2758 (paranoid = perf_event_paranoid()) > 1) {
2755 const char *name = perf_evsel__name(evsel); 2759 const char *name = perf_evsel__name(evsel);
2756 char *new_name; 2760 char *new_name;
2761 const char *sep = ":";
2757 2762
2758 if (asprintf(&new_name, "%s%su", name, strchr(name, ':') ? "" : ":") < 0) 2763 /* Is there already the separator in the name. */
2764 if (strchr(name, '/') ||
2765 strchr(name, ':'))
2766 sep = "";
2767
2768 if (asprintf(&new_name, "%s%su", name, sep) < 0)
2759 return false; 2769 return false;
2760 2770
2761 if (evsel->name) 2771 if (evsel->name)
@@ -2870,8 +2880,7 @@ int perf_evsel__open_strerror(struct perf_evsel *evsel, struct target *target,
2870#if defined(__i386__) || defined(__x86_64__) 2880#if defined(__i386__) || defined(__x86_64__)
2871 if (evsel->attr.type == PERF_TYPE_HARDWARE) 2881 if (evsel->attr.type == PERF_TYPE_HARDWARE)
2872 return scnprintf(msg, size, "%s", 2882 return scnprintf(msg, size, "%s",
2873 "No hardware sampling interrupt available.\n" 2883 "No hardware sampling interrupt available.\n");
2874 "No APIC? If so then you can boot the kernel with the \"lapic\" boot parameter to force-enable it.");
2875#endif 2884#endif
2876 break; 2885 break;
2877 case EBUSY: 2886 case EBUSY:
@@ -2894,8 +2903,7 @@ int perf_evsel__open_strerror(struct perf_evsel *evsel, struct target *target,
2894 2903
2895 return scnprintf(msg, size, 2904 return scnprintf(msg, size,
2896 "The sys_perf_event_open() syscall returned with %d (%s) for event (%s).\n" 2905 "The sys_perf_event_open() syscall returned with %d (%s) for event (%s).\n"
2897 "/bin/dmesg may provide additional information.\n" 2906 "/bin/dmesg | grep -i perf may provide additional information.\n",
2898 "No CONFIG_PERF_EVENTS=y kernel support configured?",
2899 err, str_error_r(err, sbuf, sizeof(sbuf)), 2907 err, str_error_r(err, sbuf, sizeof(sbuf)),
2900 perf_evsel__name(evsel)); 2908 perf_evsel__name(evsel));
2901} 2909}
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index d3ee3af618ef..92ec009a292d 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -115,6 +115,7 @@ struct perf_evsel {
115 unsigned int sample_size; 115 unsigned int sample_size;
116 int id_pos; 116 int id_pos;
117 int is_pos; 117 int is_pos;
118 bool uniquified_name;
118 bool snapshot; 119 bool snapshot;
119 bool supported; 120 bool supported;
120 bool needs_swap; 121 bool needs_swap;
diff --git a/tools/perf/util/generate-cmdlist.sh b/tools/perf/util/generate-cmdlist.sh
index ff17920a5ebc..c3cef36d4176 100755
--- a/tools/perf/util/generate-cmdlist.sh
+++ b/tools/perf/util/generate-cmdlist.sh
@@ -38,7 +38,7 @@ do
38done 38done
39echo "#endif /* HAVE_LIBELF_SUPPORT */" 39echo "#endif /* HAVE_LIBELF_SUPPORT */"
40 40
41echo "#if defined(HAVE_LIBAUDIT_SUPPORT) || defined(HAVE_SYSCALL_TABLE)" 41echo "#if defined(HAVE_LIBAUDIT_SUPPORT) || defined(HAVE_SYSCALL_TABLE_SUPPORT)"
42sed -n -e 's/^perf-\([^ ]*\)[ ].* audit*/\1/p' command-list.txt | 42sed -n -e 's/^perf-\([^ ]*\)[ ].* audit*/\1/p' command-list.txt |
43sort | 43sort |
44while read cmd 44while read cmd
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index 121df1683c36..a8bff2178fbc 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -1320,7 +1320,8 @@ static int build_mem_topology(struct memory_node *nodes, u64 size, u64 *cntp)
1320 1320
1321 dir = opendir(path); 1321 dir = opendir(path);
1322 if (!dir) { 1322 if (!dir) {
1323 pr_warning("failed: can't open node sysfs data\n"); 1323 pr_debug2("%s: could't read %s, does this arch have topology information?\n",
1324 __func__, path);
1324 return -1; 1325 return -1;
1325 } 1326 }
1326 1327
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 2eca8478e24f..32d50492505d 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -1019,13 +1019,6 @@ int machine__load_vmlinux_path(struct machine *machine, enum map_type type)
1019 return ret; 1019 return ret;
1020} 1020}
1021 1021
1022static void map_groups__fixup_end(struct map_groups *mg)
1023{
1024 int i;
1025 for (i = 0; i < MAP__NR_TYPES; ++i)
1026 __map_groups__fixup_end(mg, i);
1027}
1028
1029static char *get_kernel_version(const char *root_dir) 1022static char *get_kernel_version(const char *root_dir)
1030{ 1023{
1031 char version[PATH_MAX]; 1024 char version[PATH_MAX];
@@ -1233,6 +1226,7 @@ int machine__create_kernel_maps(struct machine *machine)
1233{ 1226{
1234 struct dso *kernel = machine__get_kernel(machine); 1227 struct dso *kernel = machine__get_kernel(machine);
1235 const char *name = NULL; 1228 const char *name = NULL;
1229 struct map *map;
1236 u64 addr = 0; 1230 u64 addr = 0;
1237 int ret; 1231 int ret;
1238 1232
@@ -1259,13 +1253,25 @@ int machine__create_kernel_maps(struct machine *machine)
1259 machine__destroy_kernel_maps(machine); 1253 machine__destroy_kernel_maps(machine);
1260 return -1; 1254 return -1;
1261 } 1255 }
1262 machine__set_kernel_mmap(machine, addr, 0); 1256
1257 /* we have a real start address now, so re-order the kmaps */
1258 map = machine__kernel_map(machine);
1259
1260 map__get(map);
1261 map_groups__remove(&machine->kmaps, map);
1262
1263 /* assume it's the last in the kmaps */
1264 machine__set_kernel_mmap(machine, addr, ~0ULL);
1265
1266 map_groups__insert(&machine->kmaps, map);
1267 map__put(map);
1263 } 1268 }
1264 1269
1265 /* 1270 /* update end address of the kernel map using adjacent module address */
1266 * Now that we have all the maps created, just set the ->end of them: 1271 map = map__next(machine__kernel_map(machine));
1267 */ 1272 if (map)
1268 map_groups__fixup_end(&machine->kmaps); 1273 machine__set_kernel_mmap(machine, addr, map->start);
1274
1269 return 0; 1275 return 0;
1270} 1276}
1271 1277
diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y
index 7afeb80cc39e..d14464c42714 100644
--- a/tools/perf/util/parse-events.y
+++ b/tools/perf/util/parse-events.y
@@ -224,15 +224,15 @@ event_def: event_pmu |
224 event_bpf_file 224 event_bpf_file
225 225
226event_pmu: 226event_pmu:
227PE_NAME opt_event_config 227PE_NAME '/' event_config '/'
228{ 228{
229 struct list_head *list, *orig_terms, *terms; 229 struct list_head *list, *orig_terms, *terms;
230 230
231 if (parse_events_copy_term_list($2, &orig_terms)) 231 if (parse_events_copy_term_list($3, &orig_terms))
232 YYABORT; 232 YYABORT;
233 233
234 ALLOC_LIST(list); 234 ALLOC_LIST(list);
235 if (parse_events_add_pmu(_parse_state, list, $1, $2, false)) { 235 if (parse_events_add_pmu(_parse_state, list, $1, $3, false)) {
236 struct perf_pmu *pmu = NULL; 236 struct perf_pmu *pmu = NULL;
237 int ok = 0; 237 int ok = 0;
238 char *pattern; 238 char *pattern;
@@ -262,7 +262,7 @@ PE_NAME opt_event_config
262 if (!ok) 262 if (!ok)
263 YYABORT; 263 YYABORT;
264 } 264 }
265 parse_events_terms__delete($2); 265 parse_events_terms__delete($3);
266 parse_events_terms__delete(orig_terms); 266 parse_events_terms__delete(orig_terms);
267 $$ = list; 267 $$ = list;
268} 268}
diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
index 064bdcb7bd78..d2fb597c9a8c 100644
--- a/tools/perf/util/pmu.c
+++ b/tools/perf/util/pmu.c
@@ -539,9 +539,10 @@ static bool pmu_is_uncore(const char *name)
539 539
540/* 540/*
541 * PMU CORE devices have different name other than cpu in sysfs on some 541 * PMU CORE devices have different name other than cpu in sysfs on some
542 * platforms. looking for possible sysfs files to identify as core device. 542 * platforms.
543 * Looking for possible sysfs files to identify the arm core device.
543 */ 544 */
544static int is_pmu_core(const char *name) 545static int is_arm_pmu_core(const char *name)
545{ 546{
546 struct stat st; 547 struct stat st;
547 char path[PATH_MAX]; 548 char path[PATH_MAX];
@@ -550,18 +551,18 @@ static int is_pmu_core(const char *name)
550 if (!sysfs) 551 if (!sysfs)
551 return 0; 552 return 0;
552 553
553 /* Look for cpu sysfs (x86 and others) */
554 scnprintf(path, PATH_MAX, "%s/bus/event_source/devices/cpu", sysfs);
555 if ((stat(path, &st) == 0) &&
556 (strncmp(name, "cpu", strlen("cpu")) == 0))
557 return 1;
558
559 /* Look for cpu sysfs (specific to arm) */ 554 /* Look for cpu sysfs (specific to arm) */
560 scnprintf(path, PATH_MAX, "%s/bus/event_source/devices/%s/cpus", 555 scnprintf(path, PATH_MAX, "%s/bus/event_source/devices/%s/cpus",
561 sysfs, name); 556 sysfs, name);
562 if (stat(path, &st) == 0) 557 if (stat(path, &st) == 0)
563 return 1; 558 return 1;
564 559
560 /* Look for cpu sysfs (specific to s390) */
561 scnprintf(path, PATH_MAX, "%s/bus/event_source/devices/%s",
562 sysfs, name);
563 if (stat(path, &st) == 0 && !strncmp(name, "cpum_", 5))
564 return 1;
565
565 return 0; 566 return 0;
566} 567}
567 568
@@ -580,7 +581,7 @@ char * __weak get_cpuid_str(struct perf_pmu *pmu __maybe_unused)
580 * cpuid string generated on this platform. 581 * cpuid string generated on this platform.
581 * Otherwise return non-zero. 582 * Otherwise return non-zero.
582 */ 583 */
583int __weak strcmp_cpuid_str(const char *mapcpuid, const char *cpuid) 584int strcmp_cpuid_str(const char *mapcpuid, const char *cpuid)
584{ 585{
585 regex_t re; 586 regex_t re;
586 regmatch_t pmatch[1]; 587 regmatch_t pmatch[1];
@@ -662,6 +663,7 @@ static void pmu_add_cpu_aliases(struct list_head *head, struct perf_pmu *pmu)
662 struct pmu_events_map *map; 663 struct pmu_events_map *map;
663 struct pmu_event *pe; 664 struct pmu_event *pe;
664 const char *name = pmu->name; 665 const char *name = pmu->name;
666 const char *pname;
665 667
666 map = perf_pmu__find_map(pmu); 668 map = perf_pmu__find_map(pmu);
667 if (!map) 669 if (!map)
@@ -680,11 +682,9 @@ static void pmu_add_cpu_aliases(struct list_head *head, struct perf_pmu *pmu)
680 break; 682 break;
681 } 683 }
682 684
683 if (!is_pmu_core(name)) { 685 if (!is_arm_pmu_core(name)) {
684 /* check for uncore devices */ 686 pname = pe->pmu ? pe->pmu : "cpu";
685 if (pe->pmu == NULL) 687 if (strncmp(pname, name, strlen(pname)))
686 continue;
687 if (strncmp(pe->pmu, name, strlen(pe->pmu)))
688 continue; 688 continue;
689 } 689 }
690 690
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 62b2dd2253eb..1466814ebada 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -2091,16 +2091,14 @@ static bool symbol__read_kptr_restrict(void)
2091 2091
2092int symbol__annotation_init(void) 2092int symbol__annotation_init(void)
2093{ 2093{
2094 if (symbol_conf.init_annotation)
2095 return 0;
2096
2094 if (symbol_conf.initialized) { 2097 if (symbol_conf.initialized) {
2095 pr_err("Annotation needs to be init before symbol__init()\n"); 2098 pr_err("Annotation needs to be init before symbol__init()\n");
2096 return -1; 2099 return -1;
2097 } 2100 }
2098 2101
2099 if (symbol_conf.init_annotation) {
2100 pr_warning("Annotation being initialized multiple times\n");
2101 return 0;
2102 }
2103
2104 symbol_conf.priv_size += sizeof(struct annotation); 2102 symbol_conf.priv_size += sizeof(struct annotation);
2105 symbol_conf.init_annotation = true; 2103 symbol_conf.init_annotation = true;
2106 return 0; 2104 return 0;
diff --git a/tools/perf/util/syscalltbl.c b/tools/perf/util/syscalltbl.c
index 895122d638dd..0ee7f568d60c 100644
--- a/tools/perf/util/syscalltbl.c
+++ b/tools/perf/util/syscalltbl.c
@@ -17,7 +17,7 @@
17#include <stdlib.h> 17#include <stdlib.h>
18#include <linux/compiler.h> 18#include <linux/compiler.h>
19 19
20#ifdef HAVE_SYSCALL_TABLE 20#ifdef HAVE_SYSCALL_TABLE_SUPPORT
21#include <string.h> 21#include <string.h>
22#include "string2.h" 22#include "string2.h"
23#include "util.h" 23#include "util.h"
@@ -139,7 +139,7 @@ int syscalltbl__strglobmatch_first(struct syscalltbl *tbl, const char *syscall_g
139 return syscalltbl__strglobmatch_next(tbl, syscall_glob, idx); 139 return syscalltbl__strglobmatch_next(tbl, syscall_glob, idx);
140} 140}
141 141
142#else /* HAVE_SYSCALL_TABLE */ 142#else /* HAVE_SYSCALL_TABLE_SUPPORT */
143 143
144#include <libaudit.h> 144#include <libaudit.h>
145 145
@@ -176,4 +176,4 @@ int syscalltbl__strglobmatch_first(struct syscalltbl *tbl, const char *syscall_g
176{ 176{
177 return syscalltbl__strglobmatch_next(tbl, syscall_glob, idx); 177 return syscalltbl__strglobmatch_next(tbl, syscall_glob, idx);
178} 178}
179#endif /* HAVE_SYSCALL_TABLE */ 179#endif /* HAVE_SYSCALL_TABLE_SUPPORT */
diff --git a/tools/perf/util/trace-event-scripting.c b/tools/perf/util/trace-event-scripting.c
index 0ac9077f62a2..b1e5c3a2b8e3 100644
--- a/tools/perf/util/trace-event-scripting.c
+++ b/tools/perf/util/trace-event-scripting.c
@@ -98,7 +98,7 @@ static void register_python_scripting(struct scripting_ops *scripting_ops)
98 } 98 }
99} 99}
100 100
101#ifdef NO_LIBPYTHON 101#ifndef HAVE_LIBPYTHON_SUPPORT
102void setup_python_scripting(void) 102void setup_python_scripting(void)
103{ 103{
104 register_python_scripting(&python_scripting_unsupported_ops); 104 register_python_scripting(&python_scripting_unsupported_ops);
@@ -161,7 +161,7 @@ static void register_perl_scripting(struct scripting_ops *scripting_ops)
161 } 161 }
162} 162}
163 163
164#ifdef NO_LIBPERL 164#ifndef HAVE_LIBPERL_SUPPORT
165void setup_perl_scripting(void) 165void setup_perl_scripting(void)
166{ 166{
167 register_perl_scripting(&perl_scripting_unsupported_ops); 167 register_perl_scripting(&perl_scripting_unsupported_ops);