Skip to content

Commit 6ca2a9c

Browse files
author
Ingo Molnar
committed
Merge tag 'perf-core-for-mingo' 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: * Align the 'Ok'/'FAILED!' test results in 'perf test. * Support interrupted syscalls in 'trace' * Add an event duration column and filter in 'trace'. * There are references to the man pages in some tools, so try to build Documentation when installing, warning the user if that is not possible, from Borislav Petkov. * Give user better message if precise is not supported, from David Ahern. * Try to find cross-built objdump path by using the session environment information in the perf.data file header, from Irina Tirdea, original patch and idea by Namhyung Kim. * Diplays more output on features check for make V=1, so that one can figure out what is happening by looking at gcc output, etc. From Jiri Olsa. * Account the nr_entries in rblist properly, fix by Suzuki K. Poulose. Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2 parents ce37f40 + af3df2c commit 6ca2a9c

File tree

17 files changed

+535
-58
lines changed

17 files changed

+535
-58
lines changed

tools/perf/Documentation/Makefile

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
include ../config/utilities.mak
2+
13
OUTPUT := ./
24
ifeq ("$(origin O)", "command line")
35
ifneq ($(O),)
@@ -64,13 +66,24 @@ MAKEINFO=makeinfo
6466
INSTALL_INFO=install-info
6567
DOCBOOK2X_TEXI=docbook2x-texi
6668
DBLATEX=dblatex
69+
XMLTO=xmlto
6770
ifndef PERL_PATH
6871
PERL_PATH = /usr/bin/perl
6972
endif
7073

7174
-include ../config.mak.autogen
7275
-include ../config.mak
7376

77+
_tmp_tool_path := $(call get-executable,$(ASCIIDOC))
78+
ifeq ($(_tmp_tool_path),)
79+
missing_tools = $(ASCIIDOC)
80+
endif
81+
82+
_tmp_tool_path := $(call get-executable,$(XMLTO))
83+
ifeq ($(_tmp_tool_path),)
84+
missing_tools += $(XMLTO)
85+
endif
86+
7487
#
7588
# For asciidoc ...
7689
# -7.1.2, no extra settings are needed.
@@ -170,14 +183,28 @@ pdf: $(OUTPUT)user-manual.pdf
170183

171184
install: install-man
172185

173-
install-man: man
186+
check-man-tools:
187+
ifdef missing_tools
188+
$(error "You need to install $(missing_tools) for man pages")
189+
endif
190+
191+
do-install-man: man
174192
$(INSTALL) -d -m 755 $(DESTDIR)$(man1dir)
175193
# $(INSTALL) -d -m 755 $(DESTDIR)$(man5dir)
176194
# $(INSTALL) -d -m 755 $(DESTDIR)$(man7dir)
177195
$(INSTALL) -m 644 $(DOC_MAN1) $(DESTDIR)$(man1dir)
178196
# $(INSTALL) -m 644 $(DOC_MAN5) $(DESTDIR)$(man5dir)
179197
# $(INSTALL) -m 644 $(DOC_MAN7) $(DESTDIR)$(man7dir)
180198

199+
install-man: check-man-tools man
200+
201+
try-install-man:
202+
ifdef missing_tools
203+
$(warning Please install $(missing_tools) to have the man pages installed)
204+
else
205+
$(MAKE) do-install-man
206+
endif
207+
181208
install-info: info
182209
$(INSTALL) -d -m 755 $(DESTDIR)$(infodir)
183210
$(INSTALL) -m 644 $(OUTPUT)perf.info $(OUTPUT)perfman.info $(DESTDIR)$(infodir)
@@ -246,7 +273,7 @@ $(MAN_HTML): $(OUTPUT)%.html : %.txt
246273

247274
$(OUTPUT)%.1 $(OUTPUT)%.5 $(OUTPUT)%.7 : $(OUTPUT)%.xml
248275
$(QUIET_XMLTO)$(RM) $@ && \
249-
xmlto -o $(OUTPUT) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
276+
$(XMLTO) -o $(OUTPUT) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
250277

251278
$(OUTPUT)%.xml : %.txt
252279
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \

tools/perf/Documentation/perf-trace.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ comma-separated list with no space: 0,1. Ranges of CPUs are specified with -: 0-
4848
In per-thread mode with inheritance mode on (default), Events are captured only when
4949
the thread executes on the designated CPUs. Default is to monitor all CPUs.
5050

51+
--duration:
52+
Show only events that had a duration greater than N.M ms.
53+
5154
SEE ALSO
5255
--------
5356
linkperf:perf-record[1], linkperf:perf-script[1]

tools/perf/Makefile

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -155,15 +155,15 @@ SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__
155155

156156
-include config/feature-tests.mak
157157

158-
ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror -fstack-protector-all),y)
158+
ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror -fstack-protector-all,-fstack-protector-all),y)
159159
CFLAGS := $(CFLAGS) -fstack-protector-all
160160
endif
161161

162-
ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror -Wstack-protector),y)
162+
ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror -Wstack-protector,-Wstack-protector),y)
163163
CFLAGS := $(CFLAGS) -Wstack-protector
164164
endif
165165

166-
ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror -Wvolatile-register-var),y)
166+
ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror -Wvolatile-register-var,-Wvolatile-register-var),y)
167167
CFLAGS := $(CFLAGS) -Wvolatile-register-var
168168
endif
169169

@@ -172,7 +172,7 @@ endif
172172
BASIC_CFLAGS = -Iutil/include -Iarch/$(ARCH)/include -I$(OUTPUT)util -I$(TRACE_EVENT_DIR) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
173173
BASIC_LDFLAGS =
174174

175-
ifeq ($(call try-cc,$(SOURCE_BIONIC),$(CFLAGS)),y)
175+
ifeq ($(call try-cc,$(SOURCE_BIONIC),$(CFLAGS),bionic),y)
176176
BIONIC := 1
177177
EXTLIBS := $(filter-out -lrt,$(EXTLIBS))
178178
EXTLIBS := $(filter-out -lpthread,$(EXTLIBS))
@@ -426,6 +426,8 @@ LIB_OBJS += $(OUTPUT)ui/helpline.o
426426
LIB_OBJS += $(OUTPUT)ui/hist.o
427427
LIB_OBJS += $(OUTPUT)ui/stdio/hist.o
428428

429+
LIB_OBJS += $(OUTPUT)arch/common.o
430+
429431
BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o
430432
BUILTIN_OBJS += $(OUTPUT)builtin-bench.o
431433
# Benchmark modules
@@ -477,9 +479,9 @@ ifdef NO_LIBELF
477479
NO_LIBUNWIND := 1
478480
else
479481
FLAGS_LIBELF=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS)
480-
ifneq ($(call try-cc,$(SOURCE_LIBELF),$(FLAGS_LIBELF)),y)
482+
ifneq ($(call try-cc,$(SOURCE_LIBELF),$(FLAGS_LIBELF),libelf),y)
481483
FLAGS_GLIBC=$(ALL_CFLAGS) $(ALL_LDFLAGS)
482-
ifeq ($(call try-cc,$(SOURCE_GLIBC),$(FLAGS_GLIBC)),y)
484+
ifeq ($(call try-cc,$(SOURCE_GLIBC),$(FLAGS_GLIBC),glibc),y)
483485
LIBC_SUPPORT := 1
484486
endif
485487
ifeq ($(BIONIC),1)
@@ -494,7 +496,7 @@ ifneq ($(call try-cc,$(SOURCE_LIBELF),$(FLAGS_LIBELF)),y)
494496
endif
495497
else
496498
FLAGS_DWARF=$(ALL_CFLAGS) -ldw -lelf $(ALL_LDFLAGS) $(EXTLIBS)
497-
ifneq ($(call try-cc,$(SOURCE_DWARF),$(FLAGS_DWARF)),y)
499+
ifneq ($(call try-cc,$(SOURCE_DWARF),$(FLAGS_DWARF),libdw),y)
498500
msg := $(warning No libdw.h found or old libdw.h found or elfutils is older than 0.138, disables dwarf support. Please install new elfutils-devel/libdw-dev);
499501
NO_DWARF := 1
500502
endif # Dwarf support
@@ -510,7 +512,7 @@ ifdef LIBUNWIND_DIR
510512
endif
511513

512514
FLAGS_UNWIND=$(LIBUNWIND_CFLAGS) $(ALL_CFLAGS) $(LIBUNWIND_LDFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) $(LIBUNWIND_LIBS)
513-
ifneq ($(call try-cc,$(SOURCE_LIBUNWIND),$(FLAGS_UNWIND)),y)
515+
ifneq ($(call try-cc,$(SOURCE_LIBUNWIND),$(FLAGS_UNWIND),libunwind),y)
514516
msg := $(warning No libunwind found, disabling post unwind support. Please install libunwind-dev[el] >= 0.99);
515517
NO_LIBUNWIND := 1
516518
endif # Libunwind support
@@ -539,7 +541,7 @@ LIB_OBJS += $(OUTPUT)util/symbol-minimal.o
539541
else # NO_LIBELF
540542
BASIC_CFLAGS += -DLIBELF_SUPPORT
541543

542-
ifeq ($(call try-cc,$(SOURCE_ELF_MMAP),$(FLAGS_COMMON)),y)
544+
ifeq ($(call try-cc,$(SOURCE_ELF_MMAP),$(FLAGS_COMMON),-DLIBELF_MMAP),y)
543545
BASIC_CFLAGS += -DLIBELF_MMAP
544546
endif
545547

@@ -565,7 +567,7 @@ endif
565567

566568
ifndef NO_LIBAUDIT
567569
FLAGS_LIBAUDIT = $(ALL_CFLAGS) $(ALL_LDFLAGS) -laudit
568-
ifneq ($(call try-cc,$(SOURCE_LIBAUDIT),$(FLAGS_LIBAUDIT)),y)
570+
ifneq ($(call try-cc,$(SOURCE_LIBAUDIT),$(FLAGS_LIBAUDIT),libaudit),y)
569571
msg := $(warning No libaudit.h found, disables 'trace' tool, please install audit-libs-devel or libaudit-dev);
570572
else
571573
BASIC_CFLAGS += -DLIBAUDIT_SUPPORT
@@ -576,7 +578,7 @@ endif
576578

577579
ifndef NO_NEWT
578580
FLAGS_NEWT=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) -lnewt
579-
ifneq ($(call try-cc,$(SOURCE_NEWT),$(FLAGS_NEWT)),y)
581+
ifneq ($(call try-cc,$(SOURCE_NEWT),$(FLAGS_NEWT),libnewt),y)
580582
msg := $(warning newt not found, disables TUI support. Please install newt-devel or libnewt-dev);
581583
else
582584
# Fedora has /usr/include/slang/slang.h, but ubuntu /usr/include/slang.h
@@ -605,10 +607,10 @@ endif
605607

606608
ifndef NO_GTK2
607609
FLAGS_GTK2=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) $(shell pkg-config --libs --cflags gtk+-2.0 2>/dev/null)
608-
ifneq ($(call try-cc,$(SOURCE_GTK2),$(FLAGS_GTK2)),y)
610+
ifneq ($(call try-cc,$(SOURCE_GTK2),$(FLAGS_GTK2),gtk2),y)
609611
msg := $(warning GTK2 not found, disables GTK2 support. Please install gtk2-devel or libgtk2.0-dev);
610612
else
611-
ifeq ($(call try-cc,$(SOURCE_GTK2_INFOBAR),$(FLAGS_GTK2)),y)
613+
ifeq ($(call try-cc,$(SOURCE_GTK2_INFOBAR),$(FLAGS_GTK2),-DHAVE_GTK_INFO_BAR),y)
612614
BASIC_CFLAGS += -DHAVE_GTK_INFO_BAR
613615
endif
614616
BASIC_CFLAGS += -DGTK2_SUPPORT
@@ -635,7 +637,7 @@ else
635637
PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null`
636638
FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
637639

638-
ifneq ($(call try-cc,$(SOURCE_PERL_EMBED),$(FLAGS_PERL_EMBED)),y)
640+
ifneq ($(call try-cc,$(SOURCE_PERL_EMBED),$(FLAGS_PERL_EMBED),perl),y)
639641
BASIC_CFLAGS += -DNO_LIBPERL
640642
else
641643
ALL_LDFLAGS += $(PERL_EMBED_LDFLAGS)
@@ -689,11 +691,11 @@ else
689691
PYTHON_EMBED_CCOPTS := $(shell $(PYTHON_CONFIG_SQ) --cflags 2>/dev/null)
690692
FLAGS_PYTHON_EMBED := $(PYTHON_EMBED_CCOPTS) $(PYTHON_EMBED_LDOPTS)
691693

692-
ifneq ($(call try-cc,$(SOURCE_PYTHON_EMBED),$(FLAGS_PYTHON_EMBED)),y)
694+
ifneq ($(call try-cc,$(SOURCE_PYTHON_EMBED),$(FLAGS_PYTHON_EMBED),python),y)
693695
$(call disable-python,Python.h (for Python 2.x))
694696
else
695697

696-
ifneq ($(call try-cc,$(SOURCE_PYTHON_VERSION),$(FLAGS_PYTHON_EMBED)),y)
698+
ifneq ($(call try-cc,$(SOURCE_PYTHON_VERSION),$(FLAGS_PYTHON_EMBED),python version),y)
697699
$(warning Python 3 is not yet supported; please set)
698700
$(warning PYTHON and/or PYTHON_CONFIG appropriately.)
699701
$(warning If you also have Python 2 installed, then)
@@ -727,22 +729,22 @@ else
727729
BASIC_CFLAGS += -DHAVE_CPLUS_DEMANGLE
728730
else
729731
FLAGS_BFD=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) -DPACKAGE='perf' -lbfd
730-
has_bfd := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD))
732+
has_bfd := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD),libbfd)
731733
ifeq ($(has_bfd),y)
732734
EXTLIBS += -lbfd
733735
else
734736
FLAGS_BFD_IBERTY=$(FLAGS_BFD) -liberty
735-
has_bfd_iberty := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD_IBERTY))
737+
has_bfd_iberty := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD_IBERTY),liberty)
736738
ifeq ($(has_bfd_iberty),y)
737739
EXTLIBS += -lbfd -liberty
738740
else
739741
FLAGS_BFD_IBERTY_Z=$(FLAGS_BFD_IBERTY) -lz
740-
has_bfd_iberty_z := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD_IBERTY_Z))
742+
has_bfd_iberty_z := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD_IBERTY_Z),libz)
741743
ifeq ($(has_bfd_iberty_z),y)
742744
EXTLIBS += -lbfd -liberty -lz
743745
else
744746
FLAGS_CPLUS_DEMANGLE=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) -liberty
745-
has_cplus_demangle := $(call try-cc,$(SOURCE_CPLUS_DEMANGLE),$(FLAGS_CPLUS_DEMANGLE))
747+
has_cplus_demangle := $(call try-cc,$(SOURCE_CPLUS_DEMANGLE),$(FLAGS_CPLUS_DEMANGLE),demangle)
746748
ifeq ($(has_cplus_demangle),y)
747749
EXTLIBS += -liberty
748750
BASIC_CFLAGS += -DHAVE_CPLUS_DEMANGLE
@@ -764,19 +766,19 @@ ifeq ($(NO_PERF_REGS),0)
764766
endif
765767

766768
ifndef NO_STRLCPY
767-
ifeq ($(call try-cc,$(SOURCE_STRLCPY),),y)
769+
ifeq ($(call try-cc,$(SOURCE_STRLCPY),,-DHAVE_STRLCPY),y)
768770
BASIC_CFLAGS += -DHAVE_STRLCPY
769771
endif
770772
endif
771773

772774
ifndef NO_ON_EXIT
773-
ifeq ($(call try-cc,$(SOURCE_ON_EXIT),),y)
775+
ifeq ($(call try-cc,$(SOURCE_ON_EXIT),,-DHAVE_ON_EXIT),y)
774776
BASIC_CFLAGS += -DHAVE_ON_EXIT
775777
endif
776778
endif
777779

778780
ifndef NO_BACKTRACE
779-
ifeq ($(call try-cc,$(SOURCE_BACKTRACE),),y)
781+
ifeq ($(call try-cc,$(SOURCE_BACKTRACE),,-DBACKTRACE_SUPPORT),y)
780782
BASIC_CFLAGS += -DBACKTRACE_SUPPORT
781783
endif
782784
endif
@@ -1039,7 +1041,7 @@ perfexec_instdir = $(prefix)/$(perfexecdir)
10391041
endif
10401042
perfexec_instdir_SQ = $(subst ','\'',$(perfexec_instdir))
10411043

1042-
install: all
1044+
install: all try-install-man
10431045
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'
10441046
$(INSTALL) $(OUTPUT)perf '$(DESTDIR_SQ)$(bindir_SQ)'
10451047
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'
@@ -1065,6 +1067,9 @@ install-doc:
10651067
install-man:
10661068
$(MAKE) -C Documentation install-man
10671069

1070+
try-install-man:
1071+
$(MAKE) -C Documentation try-install-man
1072+
10681073
install-html:
10691074
$(MAKE) -C Documentation install-html
10701075

0 commit comments

Comments
 (0)