Skip to content

Commit b11f724

Browse files
author
Ingo Molnar
committed
Merge tag 'perf-core-for-mingo-5.5-20190925' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo: perf record: Stephane Eranian: - Fix priv level with branch sampling for paranoid=2, i.e. the kernel checks if perf_event_attr_attr.exclude_hv is set in addition to .exclude_kernel, so reset both to zero. Arnaldo Carvalho de Melo: - Don't warn about not being able to read kernel maps (kallsyms, etc) when kernel samples aren't being collected. perf list: Kim Phillips: - Allow plurals for metric, metricgroup., i.e.: $ perf list metrics was showing nothing, which is very confusing, make it work like: $ perf stat metric perf stat: Andi Kleen: - Free memory access/leaks detected via valgrind, related to metrics. Libraries: libperf: Jiri Olsa: - Move more stuff from tools/perf, this time a first stab at moving perf_mmap methods. libtracevent: Steven Rostedt (VMware): - Round up in tep_print_event() time precision. Tzvetomir Stoyanov (VMware): - Man pages for event print and related and plugins APIs. - Move traceevent plugins in its own subdirectory. Feature detection: Thomas Richter: - Add detection of java-11-openjdk-devel package, in addition to the older versions supported. Architecture specific: S/390: Thomas Richter (2): - Include JVMTI support for s390 Vendor events: AMD: Kim Phillips: - Add L3 cache events for Family 17h. - Remove redundant '['. PowerPC: Mamatha Inamdar: - Remove P8 HW events which are not supported. Cleanups: Arnaldo Carvalho de Melo: - Remove needless headers, add needed ones, move things around to reduce the headers dependency tree, speeding up builds by not doing needless compiles when unrelated stuff gets changed. - Ditch unused code that was dragging headers. Signed-off-by: Arnaldo Carvalho de Melo <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
2 parents 2b32769 + d6840d8 commit b11f724

File tree

128 files changed

+1941
-1321
lines changed

Some content is hidden

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

128 files changed

+1941
-1321
lines changed

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/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-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

tools/lib/traceevent/Documentation/libtraceevent.txt

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Management of tep handler data structure and access of its members:
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
void *tep_set_flag*(struct tep_handle pass:[*]_tep_, enum tep_flag _flag_);
2121
void *tep_clear_flag*(struct tep_handle pass:[*]_tep_, enum tep_flag _flag_);
2222
bool *tep_test_flag*(struct tep_handle pass:[*]_tep_, enum tep_flag _flags_);
@@ -26,15 +26,12 @@ Management of tep handler data structure and access of its members:
2626
void *tep_set_long_size*(struct tep_handle pass:[*]_tep_, int _long_size_);
2727
int *tep_get_page_size*(struct tep_handle pass:[*]_tep_);
2828
void *tep_set_page_size*(struct tep_handle pass:[*]_tep_, int _page_size_);
29-
bool *tep_is_latency_format*(struct tep_handle pass:[*]_tep_);
30-
void *tep_set_latency_format*(struct tep_handle pass:[*]_tep_, int _lat_);
3129
int *tep_get_header_page_size*(struct tep_handle pass:[*]_tep_);
3230
int *tep_get_header_timestamp_size*(struct tep_handle pass:[*]_tep_);
3331
bool *tep_is_old_format*(struct tep_handle pass:[*]_tep_);
3432
int *tep_strerror*(struct tep_handle pass:[*]_tep_, enum tep_errno _errnum_, char pass:[*]_buf_, size_t _buflen_);
3533

3634
Register / unregister APIs:
37-
int *tep_register_trace_clock*(struct tep_handle pass:[*]_tep_, const char pass:[*]_trace_clock_);
3835
int *tep_register_function*(struct tep_handle pass:[*]_tep_, char pass:[*]_name_, unsigned long long _addr_, char pass:[*]_mod_);
3936
int *tep_register_event_handler*(struct tep_handle pass:[*]_tep_, int _id_, const char pass:[*]_sys_name_, const char pass:[*]_event_name_, tep_event_handler_func _func_, void pass:[*]_context_);
4037
int *tep_unregister_event_handler*(struct tep_handle pass:[*]tep, int id, const char pass:[*]sys_name, const char pass:[*]event_name, tep_event_handler_func func, void pass:[*]_context_);
@@ -57,14 +54,7 @@ Event related APIs:
5754
int *tep_get_events_count*(struct tep_handle pass:[*]_tep_);
5855
struct tep_event pass:[*]pass:[*]*tep_list_events*(struct tep_handle pass:[*]_tep_, enum tep_event_sort_type _sort_type_);
5956
struct tep_event pass:[*]pass:[*]*tep_list_events_copy*(struct tep_handle pass:[*]_tep_, enum tep_event_sort_type _sort_type_);
60-
61-
Event printing:
62-
void *tep_print_event*(struct tep_handle pass:[*]_tep_, struct trace_seq pass:[*]_s_, struct tep_record pass:[*]_record_, bool _use_trace_clock_);
63-
void *tep_print_event_data*(struct tep_handle pass:[*]_tep_, struct trace_seq pass:[*]_s_, struct tep_event pass:[*]_event_, struct tep_record pass:[*]_record_);
64-
void *tep_event_info*(struct trace_seq pass:[*]_s_, struct tep_event pass:[*]_event_, struct tep_record pass:[*]_record_);
65-
void *tep_print_event_task*(struct tep_handle pass:[*]_tep_, struct trace_seq pass:[*]_s_, struct tep_event pass:[*]_event_, struct tep_record pass:[*]_record_);
66-
void *tep_print_event_time*(struct tep_handle pass:[*]_tep_, struct trace_seq pass:[*]_s_, struct tep_event pass:[*]_event_, struct tep_record pass:[*]record, bool _use_trace_clock_);
67-
void *tep_set_print_raw*(struct tep_handle pass:[*]_tep_, int _print_raw_);
57+
void *tep_print_event*(struct tep_handle pass:[*]_tep_, struct trace_seq pass:[*]_s_, struct tep_record pass:[*]_record_, const char pass:[*]_fmt_, _..._);
6858

6959
Event finding:
7060
struct tep_event pass:[*]*tep_find_event*(struct tep_handle pass:[*]_tep_, int _id_);
@@ -116,7 +106,6 @@ Filter management:
116106
int *tep_filter_compare*(struct tep_event_filter pass:[*]_filter1_, struct tep_event_filter pass:[*]_filter2_);
117107

118108
Parsing various data from the records:
119-
void *tep_data_latency_format*(struct tep_handle pass:[*]_tep_, struct trace_seq pass:[*]_s_, struct tep_record pass:[*]_record_);
120109
int *tep_data_type*(struct tep_handle pass:[*]_tep_, struct tep_record pass:[*]_rec_);
121110
int *tep_data_pid*(struct tep_handle pass:[*]_tep_, struct tep_record pass:[*]_rec_);
122111
int *tep_data_preempt_count*(struct tep_handle pass:[*]_tep_, struct tep_record pass:[*]_rec_);

0 commit comments

Comments
 (0)