Skip to content

Commit a7b7b77

Browse files
committed
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull more perf updates from Ingo Molnar: "The only kernel change is comment typo fixes. The rest is mostly tooling fixes, but also new vendor event additions and updates, a bigger libperf/libtraceevent library and a header files reorganization that came in a bit late" * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (108 commits) perf unwind: Fix libunwind build failure on i386 systems perf parser: Remove needless include directives perf build: Add detection of java-11-openjdk-devel package perf jvmti: Include JVMTI support for s390 perf vendor events: Remove P8 HW events which are not supported perf evlist: Fix access of freed id arrays perf stat: Fix free memory access / memory leaks in metrics perf tools: Replace needless mmap.h with what is needed, event.h perf evsel: Move config terms to a separate header perf evlist: Remove unused perf_evlist__fprintf() method perf evsel: Introduce evsel_fprintf.h perf evsel: Remove need for symbol_conf in evsel_fprintf.c perf copyfile: Move copyfile routines to separate files libperf: Add perf_evlist__poll() function libperf: Add perf_evlist__add_pollfd() function libperf: Add perf_evlist__alloc_pollfd() function libperf: Add libperf_init() call to the tests libperf: Merge libperf_set_print() into libperf_init() libperf: Add libperf dependency for tests targets libperf: Use sys/types.h to get ssize_t, not unistd.h ...
2 parents 7897c04 + 26acf40 commit a7b7b77

File tree

268 files changed

+4801
-3617
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

268 files changed

+4801
-3617
lines changed

kernel/events/core.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2239,7 +2239,7 @@ static void __perf_event_disable(struct perf_event *event,
22392239
*
22402240
* If event->ctx is a cloned context, callers must make sure that
22412241
* every task struct that event->ctx->task could possibly point to
2242-
* remains valid. This condition is satisifed when called through
2242+
* remains valid. This condition is satisfied when called through
22432243
* perf_event_for_each_child or perf_event_for_each because they
22442244
* hold the top-level event's child_mutex, so any descendant that
22452245
* goes to exit will block in perf_event_exit_event().
@@ -6054,7 +6054,7 @@ static void perf_sample_regs_intr(struct perf_regs *regs_intr,
60546054
* Get remaining task size from user stack pointer.
60556055
*
60566056
* It'd be better to take stack vma map and limit this more
6057-
* precisly, but there's no way to get it safely under interrupt,
6057+
* precisely, but there's no way to get it safely under interrupt,
60586058
* so using TASK_SIZE as limit.
60596059
*/
60606060
static u64 perf_ustack_task_size(struct pt_regs *regs)
@@ -6616,7 +6616,7 @@ void perf_prepare_sample(struct perf_event_header *header,
66166616

66176617
if (sample_type & PERF_SAMPLE_STACK_USER) {
66186618
/*
6619-
* Either we need PERF_SAMPLE_STACK_USER bit to be allways
6619+
* Either we need PERF_SAMPLE_STACK_USER bit to be always
66206620
* processed as the last one or have additional check added
66216621
* in case new sample type is added, because we could eat
66226622
* up the rest of the sample size.

tools/arch/x86/include/asm/cpufeatures.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,8 @@
231231
#define X86_FEATURE_VMMCALL ( 8*32+15) /* Prefer VMMCALL to VMCALL */
232232
#define X86_FEATURE_XENPV ( 8*32+16) /* "" Xen paravirtual guest */
233233
#define X86_FEATURE_EPT_AD ( 8*32+17) /* Intel Extended Page Table access-dirty bit */
234+
#define X86_FEATURE_VMCALL ( 8*32+18) /* "" Hypervisor supports the VMCALL instruction */
235+
#define X86_FEATURE_VMW_VMMCALL ( 8*32+19) /* "" VMware prefers VMMCALL hypercall instruction */
234236

235237
/* Intel-defined CPU features, CPUID level 0x00000007:0 (EBX), word 9 */
236238
#define X86_FEATURE_FSGSBASE ( 9*32+ 0) /* RDFSBASE, WRFSBASE, RDGSBASE, WRGSBASE instructions*/
@@ -354,6 +356,7 @@
354356
/* Intel-defined CPU features, CPUID level 0x00000007:0 (EDX), word 18 */
355357
#define X86_FEATURE_AVX512_4VNNIW (18*32+ 2) /* AVX-512 Neural Network Instructions */
356358
#define X86_FEATURE_AVX512_4FMAPS (18*32+ 3) /* AVX-512 Multiply Accumulation Single precision */
359+
#define X86_FEATURE_AVX512_VP2INTERSECT (18*32+ 8) /* AVX-512 Intersect for D/Q */
357360
#define X86_FEATURE_MD_CLEAR (18*32+10) /* VERW clears CPU buffers */
358361
#define X86_FEATURE_TSX_FORCE_ABORT (18*32+13) /* "" TSX_FORCE_ABORT */
359362
#define X86_FEATURE_PCONFIG (18*32+18) /* Intel PCONFIG */

tools/arch/x86/include/uapi/asm/unistd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#define _UAPI_ASM_X86_UNISTD_H
44

55
/* x32 syscall flag bit */
6-
#define __X32_SYSCALL_BIT 0x40000000
6+
#define __X32_SYSCALL_BIT 0x40000000UL
77

88
#ifndef __KERNEL__
99
# ifdef __i386__

tools/include/asm/bug.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#define _TOOLS_ASM_BUG_H
44

55
#include <linux/compiler.h>
6+
#include <stdio.h>
67

78
#define __WARN_printf(arg...) do { fprintf(stderr, arg); } while (0)
89

tools/include/uapi/asm-generic/unistd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ __SYSCALL(__NR_semget, sys_semget)
569569
__SC_COMP(__NR_semctl, sys_semctl, compat_sys_semctl)
570570
#if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32
571571
#define __NR_semtimedop 192
572-
__SC_COMP(__NR_semtimedop, sys_semtimedop, sys_semtimedop_time32)
572+
__SC_3264(__NR_semtimedop, sys_semtimedop_time32, sys_semtimedop)
573573
#endif
574574
#define __NR_semop 193
575575
__SYSCALL(__NR_semop, sys_semop)

tools/include/uapi/linux/prctl.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ struct prctl_mm_map {
181181
#define PR_GET_THP_DISABLE 42
182182

183183
/*
184-
* Tell the kernel to start/stop helping userspace manage bounds tables.
184+
* No longer implemented, but left here to ensure the numbers stay reserved:
185185
*/
186186
#define PR_MPX_ENABLE_MANAGEMENT 43
187187
#define PR_MPX_DISABLE_MANAGEMENT 44
@@ -229,4 +229,9 @@ struct prctl_mm_map {
229229
# define PR_PAC_APDBKEY (1UL << 3)
230230
# define PR_PAC_APGAKEY (1UL << 4)
231231

232+
/* Tagged user address controls for arm64 */
233+
#define PR_SET_TAGGED_ADDR_CTRL 55
234+
#define PR_GET_TAGGED_ADDR_CTRL 56
235+
# define PR_TAGGED_ADDR_ENABLE (1UL << 0)
236+
232237
#endif /* _LINUX_PRCTL_H */

tools/lib/traceevent/Build

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,3 @@ libtraceevent-y += parse-utils.o
66
libtraceevent-y += kbuffer-parse.o
77
libtraceevent-y += tep_strerror.o
88
libtraceevent-y += event-parse-api.o
9-
10-
plugin_jbd2-y += plugin_jbd2.o
11-
plugin_hrtimer-y += plugin_hrtimer.o
12-
plugin_kmem-y += plugin_kmem.o
13-
plugin_kvm-y += plugin_kvm.o
14-
plugin_mac80211-y += plugin_mac80211.o
15-
plugin_sched_switch-y += plugin_sched_switch.o
16-
plugin_function-y += plugin_function.o
17-
plugin_xen-y += plugin_xen.o
18-
plugin_scsi-y += plugin_scsi.o
19-
plugin_cfg80211-y += plugin_cfg80211.o
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
libtraceevent(3)
2+
================
3+
4+
NAME
5+
----
6+
tep_print_event - Writes event information into a trace sequence.
7+
8+
SYNOPSIS
9+
--------
10+
[verse]
11+
--
12+
*#include <event-parse.h>*
13+
*#include <trace-seq.h>*
14+
15+
void *tep_print_event*(struct tep_handle pass:[*]_tep_, struct trace_seqpass:[*]_s_, struct tep_record pass:[*]_record_, const char pass:[*]_fmt_, _..._)
16+
--
17+
18+
DESCRIPTION
19+
-----------
20+
21+
The _tep_print_event()_ function parses the event information of the given
22+
_record_ and writes it into the trace sequence _s_, according to the format
23+
string _fmt_. The desired information is specified after the format string.
24+
The _fmt_ is printf-like format string, following arguments are supported:
25+
[verse]
26+
--
27+
TEP_PRINT_PID, "%d" - PID of the event.
28+
TEP_PRINT_CPU, "%d" - Event CPU.
29+
TEP_PRINT_COMM, "%s" - Event command string.
30+
TEP_PRINT_NAME, "%s" - Event name.
31+
TEP_PRINT_LATENCY, "%s" - Latency of the event. It prints 4 or more
32+
fields - interrupt state, scheduling state,
33+
current context, and preemption count.
34+
Field 1 is the interrupt enabled state:
35+
d : Interrupts are disabled
36+
. : Interrupts are enabled
37+
X : The architecture does not support this
38+
information
39+
Field 2 is the "need resched" state.
40+
N : The task is set to call the scheduler when
41+
possible, as another higher priority task
42+
may need to be scheduled in.
43+
. : The task is not set to call the scheduler.
44+
Field 3 is the context state.
45+
. : Normal context
46+
s : Soft interrupt context
47+
h : Hard interrupt context
48+
H : Hard interrupt context which triggered
49+
during soft interrupt context.
50+
z : NMI context
51+
Z : NMI context which triggered during hard
52+
interrupt context
53+
Field 4 is the preemption count.
54+
. : The preempt count is zero.
55+
On preemptible kernels (where the task can be scheduled
56+
out in arbitrary locations while in kernel context), the
57+
preempt count, when non zero, will prevent the kernel
58+
from scheduling out the current task. The preempt count
59+
number is displayed when it is not zero.
60+
Depending on the kernel, it may show other fields
61+
(lock depth, or migration disabled, which are unique to
62+
specialized kernels).
63+
TEP_PRINT_TIME, %d - event time stamp. A divisor and precision can be
64+
specified as part of this format string:
65+
"%precision.divisord". Example:
66+
"%3.1000d" - divide the time by 1000 and print the first
67+
3 digits before the dot. Thus, the time stamp
68+
"123456000" will be printed as "123.456"
69+
TEP_PRINT_INFO, "%s" - event information.
70+
TEP_PRINT_INFO_RAW, "%s" - event information, in raw format.
71+
72+
--
73+
EXAMPLE
74+
-------
75+
[source,c]
76+
--
77+
#include <event-parse.h>
78+
#include <trace-seq.h>
79+
...
80+
struct trace_seq seq;
81+
trace_seq_init(&seq);
82+
struct tep_handle *tep = tep_alloc();
83+
...
84+
void print_my_event(struct tep_record *record)
85+
{
86+
trace_seq_reset(&seq);
87+
tep_print_event(tep, s, record, "%16s-%-5d [%03d] %s %6.1000d %s %s",
88+
TEP_PRINT_COMM, TEP_PRINT_PID, TEP_PRINT_CPU,
89+
TEP_PRINT_LATENCY, TEP_PRINT_TIME, TEP_PRINT_NAME,
90+
TEP_PRINT_INFO);
91+
}
92+
...
93+
--
94+
95+
FILES
96+
-----
97+
[verse]
98+
--
99+
*event-parse.h*
100+
Header file to include in order to have access to the library APIs.
101+
*trace-seq.h*
102+
Header file to include in order to have access to trace sequences related APIs.
103+
Trace sequences are used to allow a function to call several other functions
104+
to create a string of data to use.
105+
*-ltraceevent*
106+
Linker switch to add when building a program that uses the library.
107+
--
108+
109+
SEE ALSO
110+
--------
111+
_libtraceevent(3)_, _trace-cmd(1)_
112+
113+
AUTHOR
114+
------
115+
[verse]
116+
--
117+
*Steven Rostedt* <[email protected]>, author of *libtraceevent*.
118+
*Tzvetomir Stoyanov* <[email protected]>, author of this man page.
119+
--
120+
REPORTING BUGS
121+
--------------
122+
Report bugs to <[email protected]>
123+
124+
LICENSE
125+
-------
126+
libtraceevent is Free Software licensed under the GNU LGPL 2.1
127+
128+
RESOURCES
129+
---------
130+
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git

tools/lib/traceevent/Documentation/libtraceevent-func_apis.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ parser context.
5959

6060
The _tep_register_function()_ function registers a function name mapped to an
6161
address and (optional) module. This mapping is used in case the function tracer
62-
or events have "%pF" or "%pS" parameter in its format string. It is common to
63-
pass in the kallsyms function names with their corresponding addresses with this
62+
or events have "%pS" parameter in its format string. It is common to pass in
63+
the kallsyms function names with their corresponding addresses with this
6464
function. The _tep_ argument is the trace event parser context. The _name_ is
65-
the name of the function, the string is copied internally. The _addr_ is
66-
the start address of the function. The _mod_ is the kernel module
67-
the function may be in (NULL for none).
65+
the name of the function, the string is copied internally. The _addr_ is the
66+
start address of the function. The _mod_ is the kernel module the function may
67+
be in (NULL for none).
6868

6969
The _tep_register_print_string()_ function registers a string by the address
7070
it was stored in the kernel. Some strings internal to the kernel with static

tools/lib/traceevent/Documentation/libtraceevent-handle.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ libtraceevent(3)
33

44
NAME
55
----
6-
tep_alloc, tep_free,tep_ref, tep_unref,tep_ref_get - Create, destroy, manage
6+
tep_alloc, tep_free,tep_ref, tep_unref,tep_get_ref - Create, destroy, manage
77
references of trace event parser context.
88

99
SYNOPSIS
@@ -16,7 +16,7 @@ struct tep_handle pass:[*]*tep_alloc*(void);
1616
void *tep_free*(struct tep_handle pass:[*]_tep_);
1717
void *tep_ref*(struct tep_handle pass:[*]_tep_);
1818
void *tep_unref*(struct tep_handle pass:[*]_tep_);
19-
int *tep_ref_get*(struct tep_handle pass:[*]_tep_);
19+
int *tep_get_ref*(struct tep_handle pass:[*]_tep_);
2020
--
2121

2222
DESCRIPTION
@@ -57,9 +57,9 @@ EXAMPLE
5757
...
5858
struct tep_handle *tep = tep_alloc();
5959
...
60-
int ref = tep_ref_get(tep);
60+
int ref = tep_get_ref(tep);
6161
tep_ref(tep);
62-
if ( (ref+1) != tep_ref_get(tep)) {
62+
if ( (ref+1) != tep_get_ref(tep)) {
6363
/* Something wrong happened, the counter is not incremented by 1 */
6464
}
6565
tep_unref(tep);
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
libtraceevent(3)
2+
================
3+
4+
NAME
5+
----
6+
tep_load_plugins, tep_unload_plugins - Load / unload traceevent plugins.
7+
8+
SYNOPSIS
9+
--------
10+
[verse]
11+
--
12+
*#include <event-parse.h>*
13+
14+
struct tep_plugin_list pass:[*]*tep_load_plugins*(struct tep_handle pass:[*]_tep_);
15+
void *tep_unload_plugins*(struct tep_plugin_list pass:[*]_plugin_list_, struct tep_handle pass:[*]_tep_);
16+
--
17+
18+
DESCRIPTION
19+
-----------
20+
The _tep_load_plugins()_ function loads all plugins, located in the plugin
21+
directories. The _tep_ argument is trace event parser context.
22+
The plugin directories are :
23+
[verse]
24+
--
25+
- System's plugin directory, defined at the library compile time. It
26+
depends on the library installation prefix and usually is
27+
_(install_preffix)/lib/traceevent/plugins_
28+
- Directory, defined by the environment variable _TRACEEVENT_PLUGIN_DIR_
29+
- User's plugin directory, located at _~/.local/lib/traceevent/plugins_
30+
--
31+
Loading of plugins can be controlled by the _tep_flags_, using the
32+
_tep_set_flag()_ API:
33+
[verse]
34+
--
35+
_TEP_DISABLE_SYS_PLUGINS_ - do not load plugins, located in
36+
the system's plugin directory.
37+
_TEP_DISABLE_PLUGINS_ - do not load any plugins.
38+
--
39+
The _tep_set_flag()_ API needs to be called before _tep_load_plugins()_, if
40+
loading of all plugins is not the desired case.
41+
42+
The _tep_unload_plugins()_ function unloads the plugins, previously loaded by
43+
_tep_load_plugins()_. The _tep_ argument is trace event parser context. The
44+
_plugin_list_ is the list of loaded plugins, returned by
45+
the _tep_load_plugins()_ function.
46+
47+
RETURN VALUE
48+
------------
49+
The _tep_load_plugins()_ function returns a list of successfully loaded plugins,
50+
or NULL in case no plugins are loaded.
51+
52+
EXAMPLE
53+
-------
54+
[source,c]
55+
--
56+
#include <event-parse.h>
57+
...
58+
struct tep_handle *tep = tep_alloc();
59+
...
60+
struct tep_plugin_list *plugins = tep_load_plugins(tep);
61+
if (plugins == NULL) {
62+
/* no plugins are loaded */
63+
}
64+
...
65+
tep_unload_plugins(plugins, tep);
66+
--
67+
68+
FILES
69+
-----
70+
[verse]
71+
--
72+
*event-parse.h*
73+
Header file to include in order to have access to the library APIs.
74+
*-ltraceevent*
75+
Linker switch to add when building a program that uses the library.
76+
--
77+
78+
SEE ALSO
79+
--------
80+
_libtraceevent(3)_, _trace-cmd(1)_, _tep_set_flag(3)_
81+
82+
AUTHOR
83+
------
84+
[verse]
85+
--
86+
*Steven Rostedt* <[email protected]>, author of *libtraceevent*.
87+
*Tzvetomir Stoyanov* <[email protected]>, author of this man page.
88+
--
89+
REPORTING BUGS
90+
--------------
91+
Report bugs to <[email protected]>
92+
93+
LICENSE
94+
-------
95+
libtraceevent is Free Software licensed under the GNU LGPL 2.1
96+
97+
RESOURCES
98+
---------
99+
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git

0 commit comments

Comments
 (0)