Skip to content

Commit

Permalink
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/…
Browse files Browse the repository at this point in the history
…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
  ...
  • Loading branch information
torvalds committed Sep 26, 2019
2 parents 7897c04 + 26acf40 commit a7b7b77
Show file tree
Hide file tree
Showing 268 changed files with 4,801 additions and 3,617 deletions.
6 changes: 3 additions & 3 deletions kernel/events/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2239,7 +2239,7 @@ static void __perf_event_disable(struct perf_event *event,
*
* If event->ctx is a cloned context, callers must make sure that
* every task struct that event->ctx->task could possibly point to
* remains valid. This condition is satisifed when called through
* remains valid. This condition is satisfied when called through
* perf_event_for_each_child or perf_event_for_each because they
* hold the top-level event's child_mutex, so any descendant that
* goes to exit will block in perf_event_exit_event().
Expand Down Expand Up @@ -6054,7 +6054,7 @@ static void perf_sample_regs_intr(struct perf_regs *regs_intr,
* Get remaining task size from user stack pointer.
*
* It'd be better to take stack vma map and limit this more
* precisly, but there's no way to get it safely under interrupt,
* precisely, but there's no way to get it safely under interrupt,
* so using TASK_SIZE as limit.
*/
static u64 perf_ustack_task_size(struct pt_regs *regs)
Expand Down Expand Up @@ -6616,7 +6616,7 @@ void perf_prepare_sample(struct perf_event_header *header,

if (sample_type & PERF_SAMPLE_STACK_USER) {
/*
* Either we need PERF_SAMPLE_STACK_USER bit to be allways
* Either we need PERF_SAMPLE_STACK_USER bit to be always
* processed as the last one or have additional check added
* in case new sample type is added, because we could eat
* up the rest of the sample size.
Expand Down
3 changes: 3 additions & 0 deletions tools/arch/x86/include/asm/cpufeatures.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@
#define X86_FEATURE_VMMCALL ( 8*32+15) /* Prefer VMMCALL to VMCALL */
#define X86_FEATURE_XENPV ( 8*32+16) /* "" Xen paravirtual guest */
#define X86_FEATURE_EPT_AD ( 8*32+17) /* Intel Extended Page Table access-dirty bit */
#define X86_FEATURE_VMCALL ( 8*32+18) /* "" Hypervisor supports the VMCALL instruction */
#define X86_FEATURE_VMW_VMMCALL ( 8*32+19) /* "" VMware prefers VMMCALL hypercall instruction */

/* Intel-defined CPU features, CPUID level 0x00000007:0 (EBX), word 9 */
#define X86_FEATURE_FSGSBASE ( 9*32+ 0) /* RDFSBASE, WRFSBASE, RDGSBASE, WRGSBASE instructions*/
Expand Down Expand Up @@ -354,6 +356,7 @@
/* Intel-defined CPU features, CPUID level 0x00000007:0 (EDX), word 18 */
#define X86_FEATURE_AVX512_4VNNIW (18*32+ 2) /* AVX-512 Neural Network Instructions */
#define X86_FEATURE_AVX512_4FMAPS (18*32+ 3) /* AVX-512 Multiply Accumulation Single precision */
#define X86_FEATURE_AVX512_VP2INTERSECT (18*32+ 8) /* AVX-512 Intersect for D/Q */
#define X86_FEATURE_MD_CLEAR (18*32+10) /* VERW clears CPU buffers */
#define X86_FEATURE_TSX_FORCE_ABORT (18*32+13) /* "" TSX_FORCE_ABORT */
#define X86_FEATURE_PCONFIG (18*32+18) /* Intel PCONFIG */
Expand Down
2 changes: 1 addition & 1 deletion tools/arch/x86/include/uapi/asm/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#define _UAPI_ASM_X86_UNISTD_H

/* x32 syscall flag bit */
#define __X32_SYSCALL_BIT 0x40000000
#define __X32_SYSCALL_BIT 0x40000000UL

#ifndef __KERNEL__
# ifdef __i386__
Expand Down
1 change: 1 addition & 0 deletions tools/include/asm/bug.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#define _TOOLS_ASM_BUG_H

#include <linux/compiler.h>
#include <stdio.h>

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

Expand Down
2 changes: 1 addition & 1 deletion tools/include/uapi/asm-generic/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ __SYSCALL(__NR_semget, sys_semget)
__SC_COMP(__NR_semctl, sys_semctl, compat_sys_semctl)
#if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32
#define __NR_semtimedop 192
__SC_COMP(__NR_semtimedop, sys_semtimedop, sys_semtimedop_time32)
__SC_3264(__NR_semtimedop, sys_semtimedop_time32, sys_semtimedop)
#endif
#define __NR_semop 193
__SYSCALL(__NR_semop, sys_semop)
Expand Down
7 changes: 6 additions & 1 deletion tools/include/uapi/linux/prctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ struct prctl_mm_map {
#define PR_GET_THP_DISABLE 42

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

/* Tagged user address controls for arm64 */
#define PR_SET_TAGGED_ADDR_CTRL 55
#define PR_GET_TAGGED_ADDR_CTRL 56
# define PR_TAGGED_ADDR_ENABLE (1UL << 0)

#endif /* _LINUX_PRCTL_H */
11 changes: 0 additions & 11 deletions tools/lib/traceevent/Build
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,3 @@ libtraceevent-y += parse-utils.o
libtraceevent-y += kbuffer-parse.o
libtraceevent-y += tep_strerror.o
libtraceevent-y += event-parse-api.o

plugin_jbd2-y += plugin_jbd2.o
plugin_hrtimer-y += plugin_hrtimer.o
plugin_kmem-y += plugin_kmem.o
plugin_kvm-y += plugin_kvm.o
plugin_mac80211-y += plugin_mac80211.o
plugin_sched_switch-y += plugin_sched_switch.o
plugin_function-y += plugin_function.o
plugin_xen-y += plugin_xen.o
plugin_scsi-y += plugin_scsi.o
plugin_cfg80211-y += plugin_cfg80211.o
130 changes: 130 additions & 0 deletions tools/lib/traceevent/Documentation/libtraceevent-event_print.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
libtraceevent(3)
================

NAME
----
tep_print_event - Writes event information into a trace sequence.

SYNOPSIS
--------
[verse]
--
*#include <event-parse.h>*
*#include <trace-seq.h>*

void *tep_print_event*(struct tep_handle pass:[*]_tep_, struct trace_seqpass:[*]_s_, struct tep_record pass:[*]_record_, const char pass:[*]_fmt_, _..._)
--

DESCRIPTION
-----------

The _tep_print_event()_ function parses the event information of the given
_record_ and writes it into the trace sequence _s_, according to the format
string _fmt_. The desired information is specified after the format string.
The _fmt_ is printf-like format string, following arguments are supported:
[verse]
--
TEP_PRINT_PID, "%d" - PID of the event.
TEP_PRINT_CPU, "%d" - Event CPU.
TEP_PRINT_COMM, "%s" - Event command string.
TEP_PRINT_NAME, "%s" - Event name.
TEP_PRINT_LATENCY, "%s" - Latency of the event. It prints 4 or more
fields - interrupt state, scheduling state,
current context, and preemption count.
Field 1 is the interrupt enabled state:
d : Interrupts are disabled
. : Interrupts are enabled
X : The architecture does not support this
information
Field 2 is the "need resched" state.
N : The task is set to call the scheduler when
possible, as another higher priority task
may need to be scheduled in.
. : The task is not set to call the scheduler.
Field 3 is the context state.
. : Normal context
s : Soft interrupt context
h : Hard interrupt context
H : Hard interrupt context which triggered
during soft interrupt context.
z : NMI context
Z : NMI context which triggered during hard
interrupt context
Field 4 is the preemption count.
. : The preempt count is zero.
On preemptible kernels (where the task can be scheduled
out in arbitrary locations while in kernel context), the
preempt count, when non zero, will prevent the kernel
from scheduling out the current task. The preempt count
number is displayed when it is not zero.
Depending on the kernel, it may show other fields
(lock depth, or migration disabled, which are unique to
specialized kernels).
TEP_PRINT_TIME, %d - event time stamp. A divisor and precision can be
specified as part of this format string:
"%precision.divisord". Example:
"%3.1000d" - divide the time by 1000 and print the first
3 digits before the dot. Thus, the time stamp
"123456000" will be printed as "123.456"
TEP_PRINT_INFO, "%s" - event information.
TEP_PRINT_INFO_RAW, "%s" - event information, in raw format.

--
EXAMPLE
-------
[source,c]
--
#include <event-parse.h>
#include <trace-seq.h>
...
struct trace_seq seq;
trace_seq_init(&seq);
struct tep_handle *tep = tep_alloc();
...
void print_my_event(struct tep_record *record)
{
trace_seq_reset(&seq);
tep_print_event(tep, s, record, "%16s-%-5d [%03d] %s %6.1000d %s %s",
TEP_PRINT_COMM, TEP_PRINT_PID, TEP_PRINT_CPU,
TEP_PRINT_LATENCY, TEP_PRINT_TIME, TEP_PRINT_NAME,
TEP_PRINT_INFO);
}
...
--

FILES
-----
[verse]
--
*event-parse.h*
Header file to include in order to have access to the library APIs.
*trace-seq.h*
Header file to include in order to have access to trace sequences related APIs.
Trace sequences are used to allow a function to call several other functions
to create a string of data to use.
*-ltraceevent*
Linker switch to add when building a program that uses the library.
--

SEE ALSO
--------
_libtraceevent(3)_, _trace-cmd(1)_

AUTHOR
------
[verse]
--
*Steven Rostedt* <[email protected]>, author of *libtraceevent*.
*Tzvetomir Stoyanov* <[email protected]>, author of this man page.
--
REPORTING BUGS
--------------
Report bugs to <[email protected]>

LICENSE
-------
libtraceevent is Free Software licensed under the GNU LGPL 2.1

RESOURCES
---------
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
10 changes: 5 additions & 5 deletions tools/lib/traceevent/Documentation/libtraceevent-func_apis.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ parser context.

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

The _tep_register_print_string()_ function registers a string by the address
it was stored in the kernel. Some strings internal to the kernel with static
Expand Down
8 changes: 4 additions & 4 deletions tools/lib/traceevent/Documentation/libtraceevent-handle.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ libtraceevent(3)

NAME
----
tep_alloc, tep_free,tep_ref, tep_unref,tep_ref_get - Create, destroy, manage
tep_alloc, tep_free,tep_ref, tep_unref,tep_get_ref - Create, destroy, manage
references of trace event parser context.

SYNOPSIS
Expand All @@ -16,7 +16,7 @@ struct tep_handle pass:[*]*tep_alloc*(void);
void *tep_free*(struct tep_handle pass:[*]_tep_);
void *tep_ref*(struct tep_handle pass:[*]_tep_);
void *tep_unref*(struct tep_handle pass:[*]_tep_);
int *tep_ref_get*(struct tep_handle pass:[*]_tep_);
int *tep_get_ref*(struct tep_handle pass:[*]_tep_);
--

DESCRIPTION
Expand Down Expand Up @@ -57,9 +57,9 @@ EXAMPLE
...
struct tep_handle *tep = tep_alloc();
...
int ref = tep_ref_get(tep);
int ref = tep_get_ref(tep);
tep_ref(tep);
if ( (ref+1) != tep_ref_get(tep)) {
if ( (ref+1) != tep_get_ref(tep)) {
/* Something wrong happened, the counter is not incremented by 1 */
}
tep_unref(tep);
Expand Down
99 changes: 99 additions & 0 deletions tools/lib/traceevent/Documentation/libtraceevent-plugins.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
libtraceevent(3)
================

NAME
----
tep_load_plugins, tep_unload_plugins - Load / unload traceevent plugins.

SYNOPSIS
--------
[verse]
--
*#include <event-parse.h>*

struct tep_plugin_list pass:[*]*tep_load_plugins*(struct tep_handle pass:[*]_tep_);
void *tep_unload_plugins*(struct tep_plugin_list pass:[*]_plugin_list_, struct tep_handle pass:[*]_tep_);
--

DESCRIPTION
-----------
The _tep_load_plugins()_ function loads all plugins, located in the plugin
directories. The _tep_ argument is trace event parser context.
The plugin directories are :
[verse]
--
- System's plugin directory, defined at the library compile time. It
depends on the library installation prefix and usually is
_(install_preffix)/lib/traceevent/plugins_
- Directory, defined by the environment variable _TRACEEVENT_PLUGIN_DIR_
- User's plugin directory, located at _~/.local/lib/traceevent/plugins_
--
Loading of plugins can be controlled by the _tep_flags_, using the
_tep_set_flag()_ API:
[verse]
--
_TEP_DISABLE_SYS_PLUGINS_ - do not load plugins, located in
the system's plugin directory.
_TEP_DISABLE_PLUGINS_ - do not load any plugins.
--
The _tep_set_flag()_ API needs to be called before _tep_load_plugins()_, if
loading of all plugins is not the desired case.

The _tep_unload_plugins()_ function unloads the plugins, previously loaded by
_tep_load_plugins()_. The _tep_ argument is trace event parser context. The
_plugin_list_ is the list of loaded plugins, returned by
the _tep_load_plugins()_ function.

RETURN VALUE
------------
The _tep_load_plugins()_ function returns a list of successfully loaded plugins,
or NULL in case no plugins are loaded.

EXAMPLE
-------
[source,c]
--
#include <event-parse.h>
...
struct tep_handle *tep = tep_alloc();
...
struct tep_plugin_list *plugins = tep_load_plugins(tep);
if (plugins == NULL) {
/* no plugins are loaded */
}
...
tep_unload_plugins(plugins, tep);
--

FILES
-----
[verse]
--
*event-parse.h*
Header file to include in order to have access to the library APIs.
*-ltraceevent*
Linker switch to add when building a program that uses the library.
--

SEE ALSO
--------
_libtraceevent(3)_, _trace-cmd(1)_, _tep_set_flag(3)_

AUTHOR
------
[verse]
--
*Steven Rostedt* <[email protected]>, author of *libtraceevent*.
*Tzvetomir Stoyanov* <[email protected]>, author of this man page.
--
REPORTING BUGS
--------------
Report bugs to <[email protected]>

LICENSE
-------
libtraceevent is Free Software licensed under the GNU LGPL 2.1

RESOURCES
---------
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Loading

0 comments on commit a7b7b77

Please sign in to comment.