.. | .. |
---|
| 1 | +# SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | include ../scripts/Makefile.include |
---|
| 3 | +include ../scripts/Makefile.arch |
---|
2 | 4 | |
---|
3 | 5 | # The default target of this Makefile is... |
---|
4 | 6 | all: |
---|
.. | .. |
---|
46 | 48 | # |
---|
47 | 49 | # Define NO_SLANG if you do not want TUI support. |
---|
48 | 50 | # |
---|
49 | | -# Define NO_GTK2 if you do not want GTK+ GUI support. |
---|
| 51 | +# Define GTK2 if you want GTK+ GUI support. |
---|
50 | 52 | # |
---|
51 | 53 | # Define NO_DEMANGLE if you do not want C++ symbol demangling. |
---|
52 | 54 | # |
---|
.. | .. |
---|
86 | 88 | # |
---|
87 | 89 | # Define NO_LIBBPF if you do not want BPF support |
---|
88 | 90 | # |
---|
| 91 | +# Define NO_LIBCAP if you do not want process capabilities considered by perf |
---|
| 92 | +# |
---|
89 | 93 | # Define NO_SDT if you do not want to define SDT event in perf tools, |
---|
90 | 94 | # note that it doesn't disable SDT scanning support. |
---|
91 | 95 | # |
---|
.. | .. |
---|
94 | 98 | # |
---|
95 | 99 | # Define NO_JVMTI if you do not want jvmti agent built |
---|
96 | 100 | # |
---|
| 101 | +# Define NO_JVMTI_CMLR (debug only) if you do not want to process CMLR |
---|
| 102 | +# data for java source lines. |
---|
| 103 | +# |
---|
97 | 104 | # Define LIBCLANGLLVM if you DO want builtin clang and llvm support. |
---|
98 | 105 | # When selected, pass LLVM_CONFIG=/path/to/llvm-config to `make' if |
---|
99 | 106 | # llvm-config is not in $PATH. |
---|
100 | | - |
---|
101 | | -# Define NO_CORESIGHT if you do not want support for CoreSight trace decoding. |
---|
| 107 | +# |
---|
| 108 | +# Define CORESIGHT if you DO WANT support for CoreSight trace decoding. |
---|
| 109 | +# |
---|
| 110 | +# Define NO_AIO if you do not want support of Posix AIO based trace |
---|
| 111 | +# streaming for record mode. Currently Posix AIO trace streaming is |
---|
| 112 | +# supported only when linking with glibc. |
---|
| 113 | +# |
---|
| 114 | +# Define NO_LIBZSTD if you do not want support of Zstandard based runtime |
---|
| 115 | +# trace compression in record mode. |
---|
| 116 | +# |
---|
| 117 | +# Define TCMALLOC to enable tcmalloc heap profiling. |
---|
| 118 | +# |
---|
| 119 | +# Define LIBBPF_DYNAMIC to enable libbpf dynamic linking. |
---|
| 120 | +# |
---|
| 121 | +# Define NO_SYSCALL_TABLE=1 to disable the use of syscall id to/from name tables |
---|
| 122 | +# generated from the kernel .tbl or unistd.h files and use, if available, libaudit |
---|
| 123 | +# for doing the conversions to/from strings/id. |
---|
| 124 | +# |
---|
| 125 | +# Define LIBPFM4 to enable libpfm4 events extension. |
---|
| 126 | +# |
---|
| 127 | +# Define NO_LIBDEBUGINFOD if you do not want support debuginfod |
---|
| 128 | +# |
---|
102 | 129 | |
---|
103 | 130 | # As per kernel Makefile, avoid funny character set dependencies |
---|
104 | 131 | unexport LC_ALL |
---|
.. | .. |
---|
165 | 192 | # non-config cases |
---|
166 | 193 | config := 1 |
---|
167 | 194 | |
---|
168 | | -NON_CONFIG_TARGETS := clean python-clean TAGS tags cscope help install-doc install-man install-html install-info install-pdf doc man html info pdf |
---|
| 195 | +NON_CONFIG_TARGETS := clean python-clean TAGS tags cscope help |
---|
169 | 196 | |
---|
170 | 197 | ifdef MAKECMDGOALS |
---|
171 | 198 | ifeq ($(filter-out $(NON_CONFIG_TARGETS),$(MAKECMDGOALS)),) |
---|
.. | .. |
---|
207 | 234 | TRACE_EVENT_DIR = $(srctree)/tools/lib/traceevent/ |
---|
208 | 235 | BPF_DIR = $(srctree)/tools/lib/bpf/ |
---|
209 | 236 | SUBCMD_DIR = $(srctree)/tools/lib/subcmd/ |
---|
| 237 | +LIBPERF_DIR = $(srctree)/tools/lib/perf/ |
---|
| 238 | +DOC_DIR = $(srctree)/tools/perf/Documentation/ |
---|
210 | 239 | |
---|
211 | 240 | # Set FEATURE_TESTS to 'all' so all possible feature checkers are executed. |
---|
212 | 241 | # Without this setting the output feature dump file misses some features, for |
---|
.. | .. |
---|
253 | 282 | |
---|
254 | 283 | ifneq ($(OUTPUT),) |
---|
255 | 284 | TE_PATH=$(OUTPUT) |
---|
| 285 | + PLUGINS_PATH=$(OUTPUT) |
---|
256 | 286 | BPF_PATH=$(OUTPUT) |
---|
257 | 287 | SUBCMD_PATH=$(OUTPUT) |
---|
| 288 | + LIBPERF_PATH=$(OUTPUT) |
---|
258 | 289 | ifneq ($(subdir),) |
---|
259 | 290 | API_PATH=$(OUTPUT)/../lib/api/ |
---|
260 | 291 | else |
---|
.. | .. |
---|
262 | 293 | endif |
---|
263 | 294 | else |
---|
264 | 295 | TE_PATH=$(TRACE_EVENT_DIR) |
---|
| 296 | + PLUGINS_PATH=$(TRACE_EVENT_DIR)plugins/ |
---|
265 | 297 | API_PATH=$(LIB_DIR) |
---|
266 | 298 | BPF_PATH=$(BPF_DIR) |
---|
267 | 299 | SUBCMD_PATH=$(SUBCMD_DIR) |
---|
| 300 | + LIBPERF_PATH=$(LIBPERF_DIR) |
---|
268 | 301 | endif |
---|
269 | 302 | |
---|
270 | 303 | LIBTRACEEVENT = $(TE_PATH)libtraceevent.a |
---|
271 | 304 | export LIBTRACEEVENT |
---|
272 | 305 | |
---|
273 | | -LIBTRACEEVENT_DYNAMIC_LIST = $(TE_PATH)libtraceevent-dynamic-list |
---|
| 306 | +LIBTRACEEVENT_DYNAMIC_LIST = $(PLUGINS_PATH)libtraceevent-dynamic-list |
---|
274 | 307 | |
---|
275 | 308 | # |
---|
276 | 309 | # The static build has no dynsym table, so this does not work for |
---|
.. | .. |
---|
285 | 318 | LIBBPF = $(BPF_PATH)libbpf.a |
---|
286 | 319 | |
---|
287 | 320 | LIBSUBCMD = $(SUBCMD_PATH)libsubcmd.a |
---|
| 321 | + |
---|
| 322 | +LIBPERF = $(LIBPERF_PATH)libperf.a |
---|
| 323 | +export LIBPERF |
---|
288 | 324 | |
---|
289 | 325 | # python extension build directories |
---|
290 | 326 | PYTHON_EXTBUILD := $(OUTPUT)python_ext_build/ |
---|
.. | .. |
---|
331 | 367 | |
---|
332 | 368 | export PERL_PATH |
---|
333 | 369 | |
---|
334 | | -LIB_FILE=$(OUTPUT)libperf.a |
---|
335 | | - |
---|
336 | | -PERFLIBS = $(LIB_FILE) $(LIBAPI) $(LIBTRACEEVENT) $(LIBSUBCMD) |
---|
| 370 | +PERFLIBS = $(LIBAPI) $(LIBTRACEEVENT) $(LIBSUBCMD) $(LIBPERF) |
---|
337 | 371 | ifndef NO_LIBBPF |
---|
338 | | - PERFLIBS += $(LIBBPF) |
---|
| 372 | + ifndef LIBBPF_DYNAMIC |
---|
| 373 | + PERFLIBS += $(LIBBPF) |
---|
| 374 | + endif |
---|
339 | 375 | endif |
---|
340 | 376 | |
---|
341 | 377 | # We choose to avoid "if .. else if .. else .. endif endif" |
---|
.. | .. |
---|
346 | 382 | CFLAGS += -I$(OUTPUT) |
---|
347 | 383 | endif |
---|
348 | 384 | |
---|
349 | | -ifndef NO_GTK2 |
---|
| 385 | +ifdef GTK2 |
---|
350 | 386 | ALL_PROGRAMS += $(OUTPUT)libperf-gtk.so |
---|
351 | 387 | GTK_IN := $(OUTPUT)gtk-in.o |
---|
352 | 388 | endif |
---|
.. | .. |
---|
380 | 416 | |
---|
381 | 417 | SHELL = $(SHELL_PATH) |
---|
382 | 418 | |
---|
| 419 | +beauty_linux_dir := $(srctree)/tools/perf/trace/beauty/include/linux/ |
---|
383 | 420 | linux_uapi_dir := $(srctree)/tools/include/uapi/linux |
---|
| 421 | +asm_generic_uapi_dir := $(srctree)/tools/include/uapi/asm-generic |
---|
| 422 | +arch_asm_uapi_dir := $(srctree)/tools/arch/$(SRCARCH)/include/uapi/asm/ |
---|
| 423 | +x86_arch_asm_uapi_dir := $(srctree)/tools/arch/x86/include/uapi/asm/ |
---|
| 424 | +x86_arch_asm_dir := $(srctree)/tools/arch/x86/include/asm/ |
---|
384 | 425 | |
---|
385 | 426 | beauty_outdir := $(OUTPUT)trace/beauty/generated |
---|
386 | 427 | beauty_ioctl_outdir := $(beauty_outdir)/ioctl |
---|
.. | .. |
---|
393 | 434 | |
---|
394 | 435 | $(drm_ioctl_array): $(drm_hdr_dir)/drm.h $(drm_hdr_dir)/i915_drm.h $(drm_ioctl_tbl) |
---|
395 | 436 | $(Q)$(SHELL) '$(drm_ioctl_tbl)' $(drm_hdr_dir) > $@ |
---|
| 437 | + |
---|
| 438 | +fadvise_advice_array := $(beauty_outdir)/fadvise_advice_array.c |
---|
| 439 | +fadvise_advice_tbl := $(srctree)/tools/perf/trace/beauty/fadvise.sh |
---|
| 440 | + |
---|
| 441 | +$(fadvise_advice_array): $(linux_uapi_dir)/in.h $(fadvise_advice_tbl) |
---|
| 442 | + $(Q)$(SHELL) '$(fadvise_advice_tbl)' $(linux_uapi_dir) > $@ |
---|
| 443 | + |
---|
| 444 | +fsmount_arrays := $(beauty_outdir)/fsmount_arrays.c |
---|
| 445 | +fsmount_tbls := $(srctree)/tools/perf/trace/beauty/fsmount.sh |
---|
| 446 | + |
---|
| 447 | +$(fsmount_arrays): $(linux_uapi_dir)/fs.h $(fsmount_tbls) |
---|
| 448 | + $(Q)$(SHELL) '$(fsmount_tbls)' $(linux_uapi_dir) > $@ |
---|
| 449 | + |
---|
| 450 | +fspick_arrays := $(beauty_outdir)/fspick_arrays.c |
---|
| 451 | +fspick_tbls := $(srctree)/tools/perf/trace/beauty/fspick.sh |
---|
| 452 | + |
---|
| 453 | +$(fspick_arrays): $(linux_uapi_dir)/fs.h $(fspick_tbls) |
---|
| 454 | + $(Q)$(SHELL) '$(fspick_tbls)' $(linux_uapi_dir) > $@ |
---|
| 455 | + |
---|
| 456 | +fsconfig_arrays := $(beauty_outdir)/fsconfig_arrays.c |
---|
| 457 | +fsconfig_tbls := $(srctree)/tools/perf/trace/beauty/fsconfig.sh |
---|
| 458 | + |
---|
| 459 | +$(fsconfig_arrays): $(linux_uapi_dir)/fs.h $(fsconfig_tbls) |
---|
| 460 | + $(Q)$(SHELL) '$(fsconfig_tbls)' $(linux_uapi_dir) > $@ |
---|
396 | 461 | |
---|
397 | 462 | pkey_alloc_access_rights_array := $(beauty_outdir)/pkey_alloc_access_rights_array.c |
---|
398 | 463 | asm_generic_hdr_dir := $(srctree)/tools/include/uapi/asm-generic/ |
---|
.. | .. |
---|
435 | 500 | $(socket_ipproto_array): $(linux_uapi_dir)/in.h $(socket_ipproto_tbl) |
---|
436 | 501 | $(Q)$(SHELL) '$(socket_ipproto_tbl)' $(linux_uapi_dir) > $@ |
---|
437 | 502 | |
---|
| 503 | +socket_arrays := $(beauty_outdir)/socket_arrays.c |
---|
| 504 | +socket_tbl := $(srctree)/tools/perf/trace/beauty/socket.sh |
---|
| 505 | + |
---|
| 506 | +$(socket_arrays): $(beauty_linux_dir)/socket.h $(socket_tbl) |
---|
| 507 | + $(Q)$(SHELL) '$(socket_tbl)' $(beauty_linux_dir) > $@ |
---|
| 508 | + |
---|
438 | 509 | vhost_virtio_ioctl_array := $(beauty_ioctl_outdir)/vhost_virtio_ioctl_array.c |
---|
439 | 510 | vhost_virtio_hdr_dir := $(srctree)/tools/include/uapi/linux |
---|
440 | 511 | vhost_virtio_ioctl_tbl := $(srctree)/tools/perf/trace/beauty/vhost_virtio_ioctl.sh |
---|
.. | .. |
---|
456 | 527 | $(madvise_behavior_array): $(madvise_hdr_dir)/mman-common.h $(madvise_behavior_tbl) |
---|
457 | 528 | $(Q)$(SHELL) '$(madvise_behavior_tbl)' $(madvise_hdr_dir) > $@ |
---|
458 | 529 | |
---|
| 530 | +mmap_flags_array := $(beauty_outdir)/mmap_flags_array.c |
---|
| 531 | +mmap_flags_tbl := $(srctree)/tools/perf/trace/beauty/mmap_flags.sh |
---|
| 532 | + |
---|
| 533 | +$(mmap_flags_array): $(linux_uapi_dir)/mman.h $(asm_generic_uapi_dir)/mman.h $(asm_generic_uapi_dir)/mman-common.h $(mmap_flags_tbl) |
---|
| 534 | + $(Q)$(SHELL) '$(mmap_flags_tbl)' $(linux_uapi_dir) $(asm_generic_uapi_dir) $(arch_asm_uapi_dir) > $@ |
---|
| 535 | + |
---|
| 536 | +mremap_flags_array := $(beauty_outdir)/mremap_flags_array.c |
---|
| 537 | +mremap_flags_tbl := $(srctree)/tools/perf/trace/beauty/mremap_flags.sh |
---|
| 538 | + |
---|
| 539 | +$(mremap_flags_array): $(linux_uapi_dir)/mman.h $(mremap_flags_tbl) |
---|
| 540 | + $(Q)$(SHELL) '$(mremap_flags_tbl)' $(linux_uapi_dir) > $@ |
---|
| 541 | + |
---|
| 542 | +mount_flags_array := $(beauty_outdir)/mount_flags_array.c |
---|
| 543 | +mount_flags_tbl := $(srctree)/tools/perf/trace/beauty/mount_flags.sh |
---|
| 544 | + |
---|
| 545 | +$(mount_flags_array): $(linux_uapi_dir)/fs.h $(mount_flags_tbl) |
---|
| 546 | + $(Q)$(SHELL) '$(mount_flags_tbl)' $(linux_uapi_dir) > $@ |
---|
| 547 | + |
---|
| 548 | +move_mount_flags_array := $(beauty_outdir)/move_mount_flags_array.c |
---|
| 549 | +move_mount_flags_tbl := $(srctree)/tools/perf/trace/beauty/move_mount_flags.sh |
---|
| 550 | + |
---|
| 551 | +$(move_mount_flags_array): $(linux_uapi_dir)/fs.h $(move_mount_flags_tbl) |
---|
| 552 | + $(Q)$(SHELL) '$(move_mount_flags_tbl)' $(linux_uapi_dir) > $@ |
---|
| 553 | + |
---|
| 554 | + |
---|
| 555 | +mmap_prot_array := $(beauty_outdir)/mmap_prot_array.c |
---|
| 556 | +mmap_prot_tbl := $(srctree)/tools/perf/trace/beauty/mmap_prot.sh |
---|
| 557 | + |
---|
| 558 | +$(mmap_prot_array): $(asm_generic_uapi_dir)/mman.h $(asm_generic_uapi_dir)/mman-common.h $(mmap_prot_tbl) |
---|
| 559 | + $(Q)$(SHELL) '$(mmap_prot_tbl)' $(asm_generic_uapi_dir) $(arch_asm_uapi_dir) > $@ |
---|
| 560 | + |
---|
459 | 561 | prctl_option_array := $(beauty_outdir)/prctl_option_array.c |
---|
460 | 562 | prctl_hdr_dir := $(srctree)/tools/include/uapi/linux/ |
---|
461 | 563 | prctl_option_tbl := $(srctree)/tools/perf/trace/beauty/prctl_option.sh |
---|
.. | .. |
---|
463 | 565 | $(prctl_option_array): $(prctl_hdr_dir)/prctl.h $(prctl_option_tbl) |
---|
464 | 566 | $(Q)$(SHELL) '$(prctl_option_tbl)' $(prctl_hdr_dir) > $@ |
---|
465 | 567 | |
---|
| 568 | +usbdevfs_ioctl_array := $(beauty_ioctl_outdir)/usbdevfs_ioctl_array.c |
---|
| 569 | +usbdevfs_ioctl_tbl := $(srctree)/tools/perf/trace/beauty/usbdevfs_ioctl.sh |
---|
| 570 | + |
---|
| 571 | +$(usbdevfs_ioctl_array): $(linux_uapi_dir)/usbdevice_fs.h $(usbdevfs_ioctl_tbl) |
---|
| 572 | + $(Q)$(SHELL) '$(usbdevfs_ioctl_tbl)' $(linux_uapi_dir) > $@ |
---|
| 573 | + |
---|
| 574 | +x86_arch_prctl_code_array := $(beauty_outdir)/x86_arch_prctl_code_array.c |
---|
| 575 | +x86_arch_prctl_code_tbl := $(srctree)/tools/perf/trace/beauty/x86_arch_prctl.sh |
---|
| 576 | + |
---|
| 577 | +$(x86_arch_prctl_code_array): $(x86_arch_asm_uapi_dir)/prctl.h $(x86_arch_prctl_code_tbl) |
---|
| 578 | + $(Q)$(SHELL) '$(x86_arch_prctl_code_tbl)' $(x86_arch_asm_uapi_dir) > $@ |
---|
| 579 | + |
---|
| 580 | +x86_arch_irq_vectors_array := $(beauty_outdir)/x86_arch_irq_vectors_array.c |
---|
| 581 | +x86_arch_irq_vectors_tbl := $(srctree)/tools/perf/trace/beauty/tracepoints/x86_irq_vectors.sh |
---|
| 582 | + |
---|
| 583 | +$(x86_arch_irq_vectors_array): $(x86_arch_asm_dir)/irq_vectors.h $(x86_arch_irq_vectors_tbl) |
---|
| 584 | + $(Q)$(SHELL) '$(x86_arch_irq_vectors_tbl)' $(x86_arch_asm_dir) > $@ |
---|
| 585 | + |
---|
| 586 | +x86_arch_MSRs_array := $(beauty_outdir)/x86_arch_MSRs_array.c |
---|
| 587 | +x86_arch_MSRs_tbl := $(srctree)/tools/perf/trace/beauty/tracepoints/x86_msr.sh |
---|
| 588 | + |
---|
| 589 | +$(x86_arch_MSRs_array): $(x86_arch_asm_dir)/msr-index.h $(x86_arch_MSRs_tbl) |
---|
| 590 | + $(Q)$(SHELL) '$(x86_arch_MSRs_tbl)' $(x86_arch_asm_dir) > $@ |
---|
| 591 | + |
---|
| 592 | +rename_flags_array := $(beauty_outdir)/rename_flags_array.c |
---|
| 593 | +rename_flags_tbl := $(srctree)/tools/perf/trace/beauty/rename_flags.sh |
---|
| 594 | + |
---|
| 595 | +$(rename_flags_array): $(linux_uapi_dir)/fs.h $(rename_flags_tbl) |
---|
| 596 | + $(Q)$(SHELL) '$(rename_flags_tbl)' $(linux_uapi_dir) > $@ |
---|
| 597 | + |
---|
466 | 598 | arch_errno_name_array := $(beauty_outdir)/arch_errno_name_array.c |
---|
467 | 599 | arch_errno_hdr_dir := $(srctree)/tools |
---|
468 | 600 | arch_errno_tbl := $(srctree)/tools/perf/trace/beauty/arch_errno_names.sh |
---|
469 | 601 | |
---|
470 | 602 | $(arch_errno_name_array): $(arch_errno_tbl) |
---|
471 | | - $(Q)$(SHELL) '$(arch_errno_tbl)' $(CC) $(arch_errno_hdr_dir) > $@ |
---|
| 603 | + $(Q)$(SHELL) '$(arch_errno_tbl)' '$(patsubst -%,,$(CC))' $(arch_errno_hdr_dir) > $@ |
---|
| 604 | + |
---|
| 605 | +sync_file_range_arrays := $(beauty_outdir)/sync_file_range_arrays.c |
---|
| 606 | +sync_file_range_tbls := $(srctree)/tools/perf/trace/beauty/sync_file_range.sh |
---|
| 607 | + |
---|
| 608 | +$(sync_file_range_arrays): $(linux_uapi_dir)/fs.h $(sync_file_range_tbls) |
---|
| 609 | + $(Q)$(SHELL) '$(sync_file_range_tbls)' $(linux_uapi_dir) > $@ |
---|
472 | 610 | |
---|
473 | 611 | all: shell_compatibility_test $(ALL_PROGRAMS) $(LANG_BINDINGS) $(OTHER_PROGRAMS) |
---|
474 | 612 | |
---|
475 | | -$(OUTPUT)python/perf.so: $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS) $(LIBTRACEEVENT_DYNAMIC_LIST) |
---|
| 613 | +# Create python binding output directory if not already present |
---|
| 614 | +_dummy := $(shell [ -d '$(OUTPUT)python' ] || mkdir -p '$(OUTPUT)python') |
---|
| 615 | + |
---|
| 616 | +$(OUTPUT)python/perf.so: $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS) $(LIBTRACEEVENT_DYNAMIC_LIST) $(LIBPERF) |
---|
476 | 617 | $(QUIET_GEN)LDSHARED="$(CC) -pthread -shared" \ |
---|
477 | 618 | CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS) $(LIBTRACEEVENT_DYNAMIC_LIST_LDFLAGS)' \ |
---|
478 | 619 | $(PYTHON_WORD) util/setup.py \ |
---|
479 | 620 | --quiet build_ext; \ |
---|
480 | | - mkdir -p $(OUTPUT)python && \ |
---|
481 | 621 | cp $(PYTHON_EXTBUILD_LIB)perf*.so $(OUTPUT)python/ |
---|
482 | 622 | |
---|
483 | 623 | please_set_SHELL_PATH_to_a_more_modern_shell: |
---|
.. | .. |
---|
565 | 705 | build-dir = $(if $(__build-dir),$(__build-dir),.) |
---|
566 | 706 | |
---|
567 | 707 | prepare: $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h archheaders $(drm_ioctl_array) \ |
---|
| 708 | + $(fadvise_advice_array) \ |
---|
| 709 | + $(fsconfig_arrays) \ |
---|
| 710 | + $(fsmount_arrays) \ |
---|
| 711 | + $(fspick_arrays) \ |
---|
568 | 712 | $(pkey_alloc_access_rights_array) \ |
---|
569 | 713 | $(sndrv_pcm_ioctl_array) \ |
---|
570 | 714 | $(sndrv_ctl_ioctl_array) \ |
---|
571 | 715 | $(kcmp_type_array) \ |
---|
572 | 716 | $(kvm_ioctl_array) \ |
---|
573 | 717 | $(socket_ipproto_array) \ |
---|
| 718 | + $(socket_arrays) \ |
---|
574 | 719 | $(vhost_virtio_ioctl_array) \ |
---|
575 | 720 | $(madvise_behavior_array) \ |
---|
| 721 | + $(mmap_flags_array) \ |
---|
| 722 | + $(mmap_prot_array) \ |
---|
| 723 | + $(mremap_flags_array) \ |
---|
| 724 | + $(mount_flags_array) \ |
---|
| 725 | + $(move_mount_flags_array) \ |
---|
576 | 726 | $(perf_ioctl_array) \ |
---|
577 | 727 | $(prctl_option_array) \ |
---|
578 | | - $(arch_errno_name_array) |
---|
| 728 | + $(usbdevfs_ioctl_array) \ |
---|
| 729 | + $(x86_arch_irq_vectors_array) \ |
---|
| 730 | + $(x86_arch_MSRs_array) \ |
---|
| 731 | + $(x86_arch_prctl_code_array) \ |
---|
| 732 | + $(rename_flags_array) \ |
---|
| 733 | + $(arch_errno_name_array) \ |
---|
| 734 | + $(sync_file_range_arrays) |
---|
579 | 735 | |
---|
580 | 736 | $(OUTPUT)%.o: %.c prepare FORCE |
---|
581 | 737 | $(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@ |
---|
.. | .. |
---|
602 | 758 | $(QUIET_LINK)$(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(filter %.o,$^) $(LIBS) |
---|
603 | 759 | |
---|
604 | 760 | ifndef NO_PERF_READ_VDSO32 |
---|
605 | | -$(OUTPUT)perf-read-vdso32: perf-read-vdso.c util/find-vdso-map.c |
---|
| 761 | +$(OUTPUT)perf-read-vdso32: perf-read-vdso.c util/find-map.c |
---|
606 | 762 | $(QUIET_CC)$(CC) -m32 $(filter -static,$(LDFLAGS)) -Wall -Werror -o $@ perf-read-vdso.c |
---|
607 | 763 | endif |
---|
608 | 764 | |
---|
609 | 765 | ifndef NO_PERF_READ_VDSOX32 |
---|
610 | | -$(OUTPUT)perf-read-vdsox32: perf-read-vdso.c util/find-vdso-map.c |
---|
| 766 | +$(OUTPUT)perf-read-vdsox32: perf-read-vdso.c util/find-map.c |
---|
611 | 767 | $(QUIET_CC)$(CC) -mx32 $(filter -static,$(LDFLAGS)) -Wall -Werror -o $@ perf-read-vdso.c |
---|
612 | 768 | endif |
---|
613 | 769 | |
---|
.. | .. |
---|
618 | 774 | $(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=jvmti obj=jvmti |
---|
619 | 775 | |
---|
620 | 776 | $(OUTPUT)$(LIBJVMTI): $(LIBJVMTI_IN) |
---|
621 | | - $(QUIET_LINK)$(CC) -shared -Wl,-soname -Wl,$(LIBJVMTI) -o $@ $< |
---|
| 777 | + $(QUIET_LINK)$(CC) $(LDFLAGS) -shared -Wl,-soname -Wl,$(LIBJVMTI) -o $@ $< |
---|
622 | 778 | endif |
---|
623 | 779 | |
---|
624 | 780 | $(patsubst perf-%,%.o,$(PROGRAMS)): $(wildcard */*.h) |
---|
625 | | - |
---|
626 | | -LIBPERF_IN := $(OUTPUT)libperf-in.o |
---|
627 | | - |
---|
628 | | -$(LIBPERF_IN): prepare FORCE |
---|
629 | | - $(Q)$(MAKE) $(build)=libperf |
---|
630 | | - |
---|
631 | | -$(LIB_FILE): $(LIBPERF_IN) |
---|
632 | | - $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIBPERF_IN) $(LIB_OBJS) |
---|
633 | 781 | |
---|
634 | 782 | LIBTRACEEVENT_FLAGS += plugin_dir=$(plugindir_SQ) 'EXTRA_CFLAGS=$(EXTRA_CFLAGS)' 'LDFLAGS=$(LDFLAGS)' |
---|
635 | 783 | |
---|
.. | .. |
---|
637 | 785 | $(Q)$(MAKE) -C $(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) O=$(OUTPUT) $(OUTPUT)libtraceevent.a |
---|
638 | 786 | |
---|
639 | 787 | libtraceevent_plugins: FORCE |
---|
640 | | - $(Q)$(MAKE) -C $(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) O=$(OUTPUT) plugins |
---|
| 788 | + $(Q)$(MAKE) -C $(TRACE_EVENT_DIR)plugins $(LIBTRACEEVENT_FLAGS) O=$(OUTPUT) plugins |
---|
641 | 789 | |
---|
642 | 790 | $(LIBTRACEEVENT_DYNAMIC_LIST): libtraceevent_plugins |
---|
643 | | - $(Q)$(MAKE) -C $(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) O=$(OUTPUT) $(OUTPUT)libtraceevent-dynamic-list |
---|
| 791 | + $(Q)$(MAKE) -C $(TRACE_EVENT_DIR)plugins $(LIBTRACEEVENT_FLAGS) O=$(OUTPUT) $(OUTPUT)libtraceevent-dynamic-list |
---|
644 | 792 | |
---|
645 | 793 | $(LIBTRACEEVENT)-clean: |
---|
646 | 794 | $(call QUIET_CLEAN, libtraceevent) |
---|
.. | .. |
---|
663 | 811 | $(call QUIET_CLEAN, libbpf) |
---|
664 | 812 | $(Q)$(MAKE) -C $(BPF_DIR) O=$(OUTPUT) clean >/dev/null |
---|
665 | 813 | |
---|
| 814 | +$(LIBPERF): FORCE |
---|
| 815 | + $(Q)$(MAKE) -C $(LIBPERF_DIR) EXTRA_CFLAGS="$(LIBPERF_CFLAGS)" O=$(OUTPUT) $(OUTPUT)libperf.a |
---|
| 816 | + |
---|
| 817 | +$(LIBPERF)-clean: |
---|
| 818 | + $(call QUIET_CLEAN, libperf) |
---|
| 819 | + $(Q)$(MAKE) -C $(LIBPERF_DIR) O=$(OUTPUT) clean >/dev/null |
---|
| 820 | + |
---|
666 | 821 | $(LIBSUBCMD): FORCE |
---|
667 | 822 | $(Q)$(MAKE) -C $(SUBCMD_DIR) O=$(OUTPUT) $(OUTPUT)libsubcmd.a |
---|
668 | 823 | |
---|
669 | 824 | $(LIBSUBCMD)-clean: |
---|
670 | | - $(call QUIET_CLEAN, libsubcmd) |
---|
671 | 825 | $(Q)$(MAKE) -C $(SUBCMD_DIR) O=$(OUTPUT) clean |
---|
672 | 826 | |
---|
673 | 827 | help: |
---|
.. | .. |
---|
707 | 861 | |
---|
708 | 862 | # 'make doc' should call 'make -C Documentation all' |
---|
709 | 863 | $(DOC_TARGETS): |
---|
710 | | - $(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) $(@:doc=all) |
---|
| 864 | + $(Q)$(MAKE) -C $(DOC_DIR) O=$(OUTPUT) $(@:doc=all) ASCIIDOC_EXTRA=$(ASCIIDOC_EXTRA) |
---|
711 | 865 | |
---|
712 | 866 | TAG_FOLDERS= . ../lib ../include |
---|
713 | 867 | TAG_FILES= ../../include/uapi/linux/perf_event.h |
---|
.. | .. |
---|
743 | 897 | |
---|
744 | 898 | ### Installation rules |
---|
745 | 899 | |
---|
746 | | -ifndef NO_GTK2 |
---|
| 900 | +ifdef GTK2 |
---|
747 | 901 | install-gtk: $(OUTPUT)libperf-gtk.so |
---|
748 | 902 | $(call QUIET_INSTALL, 'GTK UI') \ |
---|
749 | 903 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(libdir_SQ)'; \ |
---|
.. | .. |
---|
775 | 929 | ifndef NO_LIBBPF |
---|
776 | 930 | $(call QUIET_INSTALL, bpf-headers) \ |
---|
777 | 931 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perf_include_instdir_SQ)/bpf'; \ |
---|
778 | | - $(INSTALL) include/bpf/*.h -t '$(DESTDIR_SQ)$(perf_include_instdir_SQ)/bpf' |
---|
| 932 | + $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perf_include_instdir_SQ)/bpf/linux'; \ |
---|
| 933 | + $(INSTALL) include/bpf/*.h -t '$(DESTDIR_SQ)$(perf_include_instdir_SQ)/bpf'; \ |
---|
| 934 | + $(INSTALL) include/bpf/linux/*.h -t '$(DESTDIR_SQ)$(perf_include_instdir_SQ)/bpf/linux' |
---|
779 | 935 | $(call QUIET_INSTALL, bpf-examples) \ |
---|
780 | 936 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perf_examples_instdir_SQ)/bpf'; \ |
---|
781 | 937 | $(INSTALL) examples/bpf/*.c -t '$(DESTDIR_SQ)$(perf_examples_instdir_SQ)/bpf' |
---|
.. | .. |
---|
801 | 957 | $(call QUIET_INSTALL, python-scripts) \ |
---|
802 | 958 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/Perf-Trace-Util/lib/Perf/Trace'; \ |
---|
803 | 959 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/bin'; \ |
---|
804 | | - $(INSTALL) scripts/python/Perf-Trace-Util/lib/Perf/Trace/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/Perf-Trace-Util/lib/Perf/Trace'; \ |
---|
805 | | - $(INSTALL) scripts/python/*.py -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python'; \ |
---|
| 960 | + $(INSTALL) scripts/python/Perf-Trace-Util/lib/Perf/Trace/* -m 644 -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/Perf-Trace-Util/lib/Perf/Trace'; \ |
---|
| 961 | + $(INSTALL) scripts/python/*.py -m 644 -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python'; \ |
---|
806 | 962 | $(INSTALL) scripts/python/bin/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/bin' |
---|
807 | 963 | endif |
---|
808 | 964 | $(call QUIET_INSTALL, perf_completion-script) \ |
---|
.. | .. |
---|
816 | 972 | $(call QUIET_INSTALL, tests) \ |
---|
817 | 973 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests'; \ |
---|
818 | 974 | $(INSTALL) tests/attr.py '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests'; \ |
---|
| 975 | + $(INSTALL) tests/pe-file.exe* '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests'; \ |
---|
819 | 976 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/attr'; \ |
---|
820 | 977 | $(INSTALL) tests/attr/* '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/attr'; \ |
---|
821 | 978 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/shell'; \ |
---|
.. | .. |
---|
832 | 989 | |
---|
833 | 990 | # 'make install-doc' should call 'make -C Documentation install' |
---|
834 | 991 | $(INSTALL_DOC_TARGETS): |
---|
835 | | - $(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) $(@:-doc=) |
---|
| 992 | + $(Q)$(MAKE) -C $(DOC_DIR) O=$(OUTPUT) $(@:-doc=) ASCIIDOC_EXTRA=$(ASCIIDOC_EXTRA) |
---|
836 | 993 | |
---|
837 | 994 | ### Cleaning rules |
---|
838 | 995 | |
---|
.. | .. |
---|
847 | 1004 | python-clean: |
---|
848 | 1005 | $(python-clean) |
---|
849 | 1006 | |
---|
850 | | -clean:: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean $(LIBSUBCMD)-clean config-clean fixdep-clean python-clean |
---|
851 | | - $(call QUIET_CLEAN, core-objs) $(RM) $(LIB_FILE) $(OUTPUT)perf-archive $(OUTPUT)perf-with-kcore $(LANG_BINDINGS) |
---|
| 1007 | +clean:: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean $(LIBSUBCMD)-clean $(LIBPERF)-clean config-clean fixdep-clean python-clean |
---|
| 1008 | + $(call QUIET_CLEAN, core-objs) $(RM) $(LIBPERF_A) $(OUTPUT)perf-archive $(OUTPUT)perf-with-kcore $(LANG_BINDINGS) |
---|
852 | 1009 | $(Q)find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete |
---|
853 | 1010 | $(Q)$(RM) $(OUTPUT).config-detected |
---|
854 | 1011 | $(call QUIET_CLEAN, core-progs) $(RM) $(ALL_PROGRAMS) perf perf-read-vdso32 perf-read-vdsox32 $(OUTPUT)pmu-events/jevents $(OUTPUT)$(LIBJVMTI).so |
---|
.. | .. |
---|
856 | 1013 | $(OUTPUT)util/intel-pt-decoder/inat-tables.c \ |
---|
857 | 1014 | $(OUTPUT)tests/llvm-src-{base,kbuild,prologue,relocation}.c \ |
---|
858 | 1015 | $(OUTPUT)pmu-events/pmu-events.c \ |
---|
| 1016 | + $(OUTPUT)$(fadvise_advice_array) \ |
---|
| 1017 | + $(OUTPUT)$(fsconfig_arrays) \ |
---|
| 1018 | + $(OUTPUT)$(fsmount_arrays) \ |
---|
| 1019 | + $(OUTPUT)$(fspick_arrays) \ |
---|
859 | 1020 | $(OUTPUT)$(madvise_behavior_array) \ |
---|
| 1021 | + $(OUTPUT)$(mmap_flags_array) \ |
---|
| 1022 | + $(OUTPUT)$(mmap_prot_array) \ |
---|
| 1023 | + $(OUTPUT)$(mremap_flags_array) \ |
---|
| 1024 | + $(OUTPUT)$(mount_flags_array) \ |
---|
| 1025 | + $(OUTPUT)$(move_mount_flags_array) \ |
---|
860 | 1026 | $(OUTPUT)$(drm_ioctl_array) \ |
---|
861 | 1027 | $(OUTPUT)$(pkey_alloc_access_rights_array) \ |
---|
862 | 1028 | $(OUTPUT)$(sndrv_ctl_ioctl_array) \ |
---|
.. | .. |
---|
864 | 1030 | $(OUTPUT)$(kvm_ioctl_array) \ |
---|
865 | 1031 | $(OUTPUT)$(kcmp_type_array) \ |
---|
866 | 1032 | $(OUTPUT)$(socket_ipproto_array) \ |
---|
| 1033 | + $(OUTPUT)$(socket_arrays) \ |
---|
867 | 1034 | $(OUTPUT)$(vhost_virtio_ioctl_array) \ |
---|
868 | 1035 | $(OUTPUT)$(perf_ioctl_array) \ |
---|
869 | 1036 | $(OUTPUT)$(prctl_option_array) \ |
---|
870 | | - $(OUTPUT)$(arch_errno_name_array) |
---|
871 | | - $(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) clean |
---|
| 1037 | + $(OUTPUT)$(usbdevfs_ioctl_array) \ |
---|
| 1038 | + $(OUTPUT)$(x86_arch_irq_vectors_array) \ |
---|
| 1039 | + $(OUTPUT)$(x86_arch_MSRs_array) \ |
---|
| 1040 | + $(OUTPUT)$(x86_arch_prctl_code_array) \ |
---|
| 1041 | + $(OUTPUT)$(rename_flags_array) \ |
---|
| 1042 | + $(OUTPUT)$(arch_errno_name_array) \ |
---|
| 1043 | + $(OUTPUT)$(sync_file_range_arrays) |
---|
| 1044 | + $(call QUIET_CLEAN, Documentation) \ |
---|
| 1045 | + $(MAKE) -C $(DOC_DIR) O=$(OUTPUT) clean >/dev/null |
---|
872 | 1046 | |
---|
873 | 1047 | # |
---|
874 | 1048 | # To provide FEATURE-DUMP into $(FEATURE_DUMP_COPY) |
---|