Skip to content

Commit 9db5506

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 from Arnaldo Carvalho de Melo: * perf inject changes to allow showing where a task sleeps, from Andrew Vagin. * Makefile improvements from Namhyung Kim. * Add --pre and --post command hooks in 'stat', from Peter Zijlstra. Signed-off-by: Arnaldo Carvalho de Melo <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
2 parents 8f7c1d0 + 1f16c57 commit 9db5506

File tree

9 files changed

+256
-61
lines changed

9 files changed

+256
-61
lines changed

tools/lib/traceevent/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ all_deps := $(all_objs:%.o=.%.d)
253253
# let .d file also depends on the source and header files
254254
define check_deps
255255
@set -e; $(RM) $@; \
256-
$(CC) -M $(CFLAGS) $< > $@.$$$$; \
256+
$(CC) -MM $(CFLAGS) $< > $@.$$$$; \
257257
sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
258258
$(RM) $@.$$$$
259259
endef

tools/perf/Documentation/perf-inject.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,17 @@ OPTIONS
2929
-v::
3030
--verbose::
3131
Be more verbose.
32+
-i::
33+
--input=::
34+
Input file name. (default: stdin)
35+
-o::
36+
--output=::
37+
Output file name. (default: stdout)
38+
-s::
39+
--sched-stat::
40+
Merge sched_stat and sched_switch for getting events where and how long
41+
tasks slept. sched_switch contains a callchain where a task slept and
42+
sched_stat contains a timeslice how long a task slept.
3243

3344
SEE ALSO
3445
--------

tools/perf/Documentation/perf-stat.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,11 @@ with it. --append may be used here. Examples:
108108
3>results perf stat --log-fd 3 -- $cmd
109109
3>>results perf stat --log-fd 3 --append -- $cmd
110110

111+
--pre::
112+
--post::
113+
Pre and post measurement hooks, e.g.:
114+
115+
perf stat --repeat 10 --null --sync --pre 'make -s O=defconfig-build/clean' -- make -s -j64 O=defconfig-build/ bzImage
111116

112117

113118
EXAMPLES

tools/perf/Makefile

Lines changed: 12 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,8 @@ LIB_OBJS += $(OUTPUT)util/symbol-minimal.o
541541
else # NO_LIBELF
542542
BASIC_CFLAGS += -DLIBELF_SUPPORT
543543

544-
ifeq ($(call try-cc,$(SOURCE_ELF_MMAP),$(FLAGS_COMMON),-DLIBELF_MMAP),y)
544+
FLAGS_LIBELF=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS)
545+
ifeq ($(call try-cc,$(SOURCE_ELF_MMAP),$(FLAGS_LIBELF),-DLIBELF_MMAP),y)
545546
BASIC_CFLAGS += -DLIBELF_MMAP
546547
endif
547548

@@ -977,20 +978,15 @@ help:
977978
@echo 'Perf maintainer targets:'
978979
@echo ' clean - clean all binary objects and build output'
979980

980-
doc:
981-
$(MAKE) -C Documentation all
982-
983-
man:
984-
$(MAKE) -C Documentation man
985981

986-
html:
987-
$(MAKE) -C Documentation html
982+
DOC_TARGETS := doc man html info pdf
988983

989-
info:
990-
$(MAKE) -C Documentation info
984+
INSTALL_DOC_TARGETS := $(patsubst %,install-%,$(DOC_TARGETS)) try-install-man
985+
INSTALL_DOC_TARGETS += quick-install-doc quick-install-man quick-install-html
991986

992-
pdf:
993-
$(MAKE) -C Documentation pdf
987+
# 'make doc' should call 'make -C Documentation all'
988+
$(DOC_TARGETS):
989+
$(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) $(@:doc=all)
994990

995991
TAGS:
996992
$(RM) TAGS
@@ -1061,40 +1057,17 @@ install: all try-install-man
10611057
install-python_ext:
10621058
$(PYTHON_WORD) util/setup.py --quiet install --root='/$(DESTDIR_SQ)'
10631059

1064-
install-doc:
1065-
$(MAKE) -C Documentation install
1066-
1067-
install-man:
1068-
$(MAKE) -C Documentation install-man
1069-
1070-
try-install-man:
1071-
$(MAKE) -C Documentation try-install-man
1072-
1073-
install-html:
1074-
$(MAKE) -C Documentation install-html
1075-
1076-
install-info:
1077-
$(MAKE) -C Documentation install-info
1078-
1079-
install-pdf:
1080-
$(MAKE) -C Documentation install-pdf
1081-
1082-
quick-install-doc:
1083-
$(MAKE) -C Documentation quick-install
1084-
1085-
quick-install-man:
1086-
$(MAKE) -C Documentation quick-install-man
1087-
1088-
quick-install-html:
1089-
$(MAKE) -C Documentation quick-install-html
1060+
# 'make install-doc' should call 'make -C Documentation install'
1061+
$(INSTALL_DOC_TARGETS):
1062+
$(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) $(@:-doc=)
10901063

10911064
### Cleaning rules
10921065

10931066
clean: $(LIBTRACEEVENT)-clean
10941067
$(RM) $(LIB_OBJS) $(BUILTIN_OBJS) $(LIB_FILE) $(OUTPUT)perf-archive $(OUTPUT)perf.o $(LANG_BINDINGS)
10951068
$(RM) $(ALL_PROGRAMS) perf
10961069
$(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope*
1097-
$(MAKE) -C Documentation/ clean
1070+
$(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) clean
10981071
$(RM) $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)PERF-CFLAGS
10991072
$(RM) $(OUTPUT)util/*-bison*
11001073
$(RM) $(OUTPUT)util/*-flex*

0 commit comments

Comments
 (0)