Skip to content

Commit ca46afd

Browse files
author
Ingo Molnar
committed
Merge tag 'perf-core-for-mingo-4.21-20181217' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo: - Introduce 'perf record --aio' to use asynchronous IO trace writing, disabled by default (Alexey Budankov) - Add fallback routines to be used in places where we don't have the CPU mode (kernel/userspace/hypervisor) and thus must first fallback lookups looking at all map trees when trying to resolve symbols (Adrian Hunter) - Fix error with config term "pt=0", where we should just force "pt=1" and warn the user about the former being nonsensical (Adrian Hunter) - Fix 'perf test' entry where we expect 'sleep' to come in a PERF_RECORD_COMM but instead we get 'coreutils' when sleep is provided by some versions of the 'coreutils' package (Adrian Hunter) - Introduce 'perf top --kallsyms file' to match 'perf report --kallsyms', useful when dealing with BPF, where symbol resolution happens via kallsyms, not via the default vmlinux ELF symtabs (Arnaldo Carvalho de Melo) - Support 'srccode' output field in 'perf script' (Andi Kleen) - Introduce basic 'perf annotation' support for the ARC architecture (Eugeniy Paltsev) - Compute and display average IPC and IPC coverage per symbol in 'perf annotate' and 'perf report' (Jin Yao) - Make 'perf top' use ordered_events and process histograms in a separate thread (Jiri Olsa) - Make 'perf trace' use ordered_events (Jiri Olsa) - Add support for ETMv3 and PTMv1.1 decoding in cs-etm (Mathieu Poirier) - Support for ARM A32/T32 instruction sets in CoreSight trace (cs-etm) (Robert Walker) - Fix 'perf stat' shadow stats for clock events. (Ravi Bangoria) - Remove needless rb_tree extra indirection from map__find() (Eric Saint-Etienne) - Fix CSV mode column output for non-cgroup events in 'perf stat' (Stephane Eranian) - Add sanity check to libtraceevent's is_timestamp_in_us() (Tzvetomir Stoyanov) - Use ERR_CAST instead of ERR_PTR(PTR_ERR()) (Wen Yang) - Fix Load_Miss_Real_Latency on SKL/SKX intel vendor event files (Andi Kleen) - strncpy() fixes triggered by new warnings on gcc 8.2.0 (Arnaldo Carvalho de Melo) - Handle tracefs syscall tracepoint older 'nr' field in 'perf trace', that got renamed to '__syscall_nr' to work in older kernels (Arnaldo Carvalho de Melo) - Give better hint about devel package for libssl (Arnaldo Carvalho de Melo) - Fix the 'perf trace' build in architectures lacking explicit mmap.h file (Arnaldo Carvalho de Melo) - Remove extra rb_tree traversal indirection from map__find() (Eric Saint-Etienne) - Disable breakpoint tests for 32-bit ARM (Florian Fainelli) - Fix typos all over the place, mostly in comments, but also in some debug messages and JSON files (Ingo Molnar) - Allow specifying proc-map-timeout in config file (Mark Drayton) - Fix mmap_flags table generation script (Sihyeon Jang) - Fix 'size' parameter to snprintf in the 'perf config' code (Sihyeon Jang) - More libtraceevent renames to make it a proper library (Tzvetomir Stoyanov) - Implement new API tep_get_ref() in libtraceevent (Tzvetomir Stoyanov) - Added support for pkg-config in libtraceevent (Tzvetomir Stoyanov) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
2 parents 8162b3d + 028713a commit ca46afd

File tree

119 files changed

+2051
-572
lines changed

Some content is hidden

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

119 files changed

+2051
-572
lines changed

tools/build/Makefile.feature

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ FEATURE_TESTS_BASIC := \
7070
sched_getcpu \
7171
sdt \
7272
setns \
73-
libopencsd
73+
libopencsd \
74+
libaio
7475

7576
# FEATURE_TESTS_BASIC + FEATURE_TESTS_EXTRA is the complete list
7677
# of all feature tests
@@ -116,7 +117,8 @@ FEATURE_DISPLAY ?= \
116117
zlib \
117118
lzma \
118119
get_cpuid \
119-
bpf
120+
bpf \
121+
libaio
120122

121123
# Set FEATURE_CHECK_(C|LD)FLAGS-all for all FEATURE_TESTS features.
122124
# If in the future we need per-feature checks/flags for features not

tools/build/feature/Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ FILES= \
6161
test-libopencsd.bin \
6262
test-clang.bin \
6363
test-llvm.bin \
64-
test-llvm-version.bin
64+
test-llvm-version.bin \
65+
test-libaio.bin
6566

6667
FILES := $(addprefix $(OUTPUT),$(FILES))
6768

@@ -297,6 +298,9 @@ $(OUTPUT)test-clang.bin:
297298

298299
-include $(OUTPUT)*.d
299300

301+
$(OUTPUT)test-libaio.bin:
302+
$(BUILD) -lrt
303+
300304
###############################
301305

302306
clean:

tools/build/feature/test-all.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,10 @@
174174
# include "test-libopencsd.c"
175175
#undef main
176176

177+
#define main main_test_libaio
178+
# include "test-libaio.c"
179+
#undef main
180+
177181
int main(int argc, char *argv[])
178182
{
179183
main_test_libpython();
@@ -214,6 +218,7 @@ int main(int argc, char *argv[])
214218
main_test_sdt();
215219
main_test_setns();
216220
main_test_libopencsd();
221+
main_test_libaio();
217222

218223
return 0;
219224
}

tools/build/feature/test-libaio.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
#include <aio.h>
3+
4+
int main(void)
5+
{
6+
struct aiocb aiocb;
7+
8+
aiocb.aio_fildes = 0;
9+
aiocb.aio_offset = 0;
10+
aiocb.aio_buf = 0;
11+
aiocb.aio_nbytes = 0;
12+
aiocb.aio_reqprio = 0;
13+
aiocb.aio_sigevent.sigev_notify = 1 /*SIGEV_NONE*/;
14+
15+
return (int)aio_return(&aiocb);
16+
}

tools/build/feature/test-libopencsd.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
// SPDX-License-Identifier: GPL-2.0
22
#include <opencsd/c_api/opencsd_c_api.h>
33

4+
/*
5+
* Check OpenCSD library version is sufficient to provide required features
6+
*/
7+
#define OCSD_MIN_VER ((0 << 16) | (10 << 8) | (0))
8+
#if !defined(OCSD_VER_NUM) || (OCSD_VER_NUM < OCSD_MIN_VER)
9+
#error "OpenCSD >= 0.10.0 is required"
10+
#endif
11+
412
int main(void)
513
{
614
(void)ocsd_get_version();

tools/include/linux/err.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,17 @@ static inline int __must_check PTR_ERR_OR_ZERO(__force const void *ptr)
5959
else
6060
return 0;
6161
}
62+
63+
/**
64+
* ERR_CAST - Explicitly cast an error-valued pointer to another pointer type
65+
* @ptr: The pointer to cast.
66+
*
67+
* Explicitly cast an error-valued pointer to another pointer type in such a
68+
* way as to make it clear that's what's going on.
69+
*/
70+
static inline void * __must_check ERR_CAST(__force const void *ptr)
71+
{
72+
/* cast away the const */
73+
return (void *) ptr;
74+
}
6275
#endif /* _LINUX_ERR_H */

tools/lib/subcmd/parse-options.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ typedef int parse_opt_cb(const struct option *, const char *arg, int unset);
7171
*
7272
* `argh`::
7373
* token to explain the kind of argument this option wants. Keep it
74-
* homogenous across the repository.
74+
* homogeneous across the repository.
7575
*
7676
* `help`::
7777
* the short help associated to what the option does.
@@ -80,7 +80,7 @@ typedef int parse_opt_cb(const struct option *, const char *arg, int unset);
8080
*
8181
* `flags`::
8282
* mask of parse_opt_option_flags.
83-
* PARSE_OPT_OPTARG: says that the argument is optionnal (not for BOOLEANs)
83+
* PARSE_OPT_OPTARG: says that the argument is optional (not for BOOLEANs)
8484
* PARSE_OPT_NOARG: says that this option takes no argument, for CALLBACKs
8585
* PARSE_OPT_NONEG: says that this option cannot be negated
8686
* PARSE_OPT_HIDDEN this option is skipped in the default usage, showed in

tools/lib/traceevent/Makefile

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ endef
2525
$(call allow-override,CC,$(CROSS_COMPILE)gcc)
2626
$(call allow-override,AR,$(CROSS_COMPILE)ar)
2727
$(call allow-override,NM,$(CROSS_COMPILE)nm)
28+
$(call allow-override,PKG_CONFIG,pkg-config)
2829

2930
EXT = -std=gnu99
3031
INSTALL = install
@@ -47,6 +48,8 @@ prefix ?= /usr/local
4748
libdir = $(prefix)/$(libdir_relative)
4849
man_dir = $(prefix)/share/man
4950
man_dir_SQ = '$(subst ','\'',$(man_dir))'
51+
pkgconfig_dir ?= $(word 1,$(shell $(PKG_CONFIG) \
52+
--variable pc_path pkg-config | tr ":" " "))
5053

5154
export man_dir man_dir_SQ INSTALL
5255
export DESTDIR DESTDIR_SQ
@@ -270,7 +273,19 @@ define do_generate_dynamic_list_file
270273
fi
271274
endef
272275

273-
install_lib: all_cmd install_plugins
276+
PKG_CONFIG_FILE = libtraceevent.pc
277+
define do_install_pkgconfig_file
278+
if [ -n "${pkgconfig_dir}" ]; then \
279+
cp -f ${PKG_CONFIG_FILE}.template ${PKG_CONFIG_FILE}; \
280+
sed -i "s|INSTALL_PREFIX|${1}|g" ${PKG_CONFIG_FILE}; \
281+
sed -i "s|LIB_VERSION|${EVENT_PARSE_VERSION}|g" ${PKG_CONFIG_FILE}; \
282+
$(call do_install,$(PKG_CONFIG_FILE),$(pkgconfig_dir),644); \
283+
else \
284+
(echo Failed to locate pkg-config directory) 1>&2; \
285+
fi
286+
endef
287+
288+
install_lib: all_cmd install_plugins install_headers install_pkgconfig
274289
$(call QUIET_INSTALL, $(LIB_TARGET)) \
275290
$(call do_install_mkdir,$(libdir_SQ)); \
276291
cp -fpR $(LIB_INSTALL) $(DESTDIR)$(libdir_SQ)
@@ -279,18 +294,24 @@ install_plugins: $(PLUGINS)
279294
$(call QUIET_INSTALL, trace_plugins) \
280295
$(call do_install_plugins, $(PLUGINS))
281296

297+
install_pkgconfig:
298+
$(call QUIET_INSTALL, $(PKG_CONFIG_FILE)) \
299+
$(call do_install_pkgconfig_file,$(prefix))
300+
282301
install_headers:
283302
$(call QUIET_INSTALL, headers) \
284303
$(call do_install,event-parse.h,$(prefix)/include/traceevent,644); \
285304
$(call do_install,event-utils.h,$(prefix)/include/traceevent,644); \
305+
$(call do_install,trace-seq.h,$(prefix)/include/traceevent,644); \
286306
$(call do_install,kbuffer.h,$(prefix)/include/traceevent,644)
287307

288308
install: install_lib
289309

290310
clean:
291311
$(call QUIET_CLEAN, libtraceevent) \
292-
$(RM) *.o *~ $(TARGETS) *.a *.so $(VERSION_FILES) .*.d .*.cmd \
293-
$(RM) TRACEEVENT-CFLAGS tags TAGS
312+
$(RM) *.o *~ $(TARGETS) *.a *.so $(VERSION_FILES) .*.d .*.cmd; \
313+
$(RM) TRACEEVENT-CFLAGS tags TAGS; \
314+
$(RM) $(PKG_CONFIG_FILE)
294315

295316
PHONY += force plugins
296317
force:

tools/lib/traceevent/event-parse-api.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* This returns pointer to the first element of the events array
1616
* If @tep is NULL, NULL is returned.
1717
*/
18-
struct tep_event_format *tep_get_first_event(struct tep_handle *tep)
18+
struct tep_event *tep_get_first_event(struct tep_handle *tep)
1919
{
2020
if (tep && tep->events)
2121
return tep->events[0];
@@ -51,7 +51,7 @@ void tep_set_flag(struct tep_handle *tep, int flag)
5151
tep->flags |= flag;
5252
}
5353

54-
unsigned short __tep_data2host2(struct tep_handle *pevent, unsigned short data)
54+
unsigned short tep_data2host2(struct tep_handle *pevent, unsigned short data)
5555
{
5656
unsigned short swap;
5757

@@ -64,7 +64,7 @@ unsigned short __tep_data2host2(struct tep_handle *pevent, unsigned short data)
6464
return swap;
6565
}
6666

67-
unsigned int __tep_data2host4(struct tep_handle *pevent, unsigned int data)
67+
unsigned int tep_data2host4(struct tep_handle *pevent, unsigned int data)
6868
{
6969
unsigned int swap;
7070

@@ -80,7 +80,7 @@ unsigned int __tep_data2host4(struct tep_handle *pevent, unsigned int data)
8080
}
8181

8282
unsigned long long
83-
__tep_data2host8(struct tep_handle *pevent, unsigned long long data)
83+
tep_data2host8(struct tep_handle *pevent, unsigned long long data)
8484
{
8585
unsigned long long swap;
8686

tools/lib/traceevent/event-parse-local.h

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ struct tep_handle {
5050
unsigned int printk_count;
5151

5252

53-
struct tep_event_format **events;
53+
struct tep_event **events;
5454
int nr_events;
55-
struct tep_event_format **sort_events;
55+
struct tep_event **sort_events;
5656
enum tep_event_sort_type last_type;
5757

5858
int type_offset;
@@ -84,9 +84,16 @@ struct tep_handle {
8484
struct tep_function_handler *func_handlers;
8585

8686
/* cache */
87-
struct tep_event_format *last_event;
87+
struct tep_event *last_event;
8888

8989
char *trace_clock;
9090
};
9191

92+
void tep_free_event(struct tep_event *event);
93+
void tep_free_format_field(struct tep_format_field *field);
94+
95+
unsigned short tep_data2host2(struct tep_handle *pevent, unsigned short data);
96+
unsigned int tep_data2host4(struct tep_handle *pevent, unsigned int data);
97+
unsigned long long tep_data2host8(struct tep_handle *pevent, unsigned long long data);
98+
9299
#endif /* _PARSE_EVENTS_INT_H */

0 commit comments

Comments
 (0)