Skip to content

Commit 4f7cf3a

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: User visible changes: o Add +field argument support for --sort option (Jiri Olsa) o Do not access kallsyms when analyzing user binaries with 'probe' (Masami Hiramatsu) o Ignore stripped vmlinux and fallback to kallsyms (Anton Blanchard) o Add path to Ubuntu kernel debuginfo file (Anton Blanchard) o Disable kernel symbol demangling by default (Avi Kivity) Infrastructure changes: o More intel PT prep work, from Adrian Hunter, including: - Let a user specify a PMU event without any config terms - Add perf-with-kcore script - Let default config be defined for a PMU - Add perf_pmu__scan_file() o "perf kvm stat report" improvements by Alexander Yarygin: o Save pid string in opts.target.pid o Enable the target.system_wide flag o Unify the title bar output o Fix build issue on powerpc when DWARF support is disabled (Anton Blanchard) o Allow to specify lib compile variable for spec usage (Jiri Olsa) o Fix build on ARM (Stephane Eranian) o Fix build on powerpc when DWARF support is disabled (Anton Blanchard) o Don't include sys/poll.h directly (Arnaldo Carvalho de Melo) o Use ring buffer consume method to look like other tools (Arnaldo Carvalho de Melo) o Allow to specify lib compile variable for spec usage (Jiri Olsa) o Fix GNU-only grep usage in Makefile (John Spencer) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
2 parents c88f209 + e568573 commit 4f7cf3a

31 files changed

+487
-60
lines changed

tools/perf/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ perf.data
1515
perf.data.old
1616
output.svg
1717
perf-archive
18+
perf-with-kcore
1819
tags
1920
TAGS
2021
cscope*

tools/perf/Documentation/perf-probe.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ OPTIONS
104104
Specify path to the executable or shared library file for user
105105
space tracing. Can also be used with --funcs option.
106106

107+
--demangle-kernel::
108+
Demangle kernel symbols.
109+
107110
In absence of -m/-x options, perf probe checks if the first argument after
108111
the options is an absolute path name. If its an absolute path, perf probe
109112
uses it as a target module/target user space binary to probe.

tools/perf/Documentation/perf-report.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,9 @@ OPTIONS
276276
Demangle symbol names to human readable form. It's enabled by default,
277277
disable with --no-demangle.
278278

279+
--demangle-kernel::
280+
Demangle kernel symbol names to human readable form (for C++ kernels).
281+
279282
--mem-mode::
280283
Use the data addresses of samples in addition to instruction addresses
281284
to build the histograms. To generate meaningful output, the perf.data

tools/perf/Documentation/perf-top.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ Default is to monitor all CPUS.
9898
--hide_user_symbols::
9999
Hide user symbols.
100100

101+
--demangle-kernel::
102+
Demangle kernel symbols.
103+
101104
-D::
102105
--dump-symtab::
103106
Dump the symbol table used for profiling.

tools/perf/Makefile.perf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ PYRF_OBJS =
126126
SCRIPT_SH =
127127

128128
SCRIPT_SH += perf-archive.sh
129+
SCRIPT_SH += perf-with-kcore.sh
129130

130131
grep-libs = $(filter -l%,$(1))
131132
strip-libs = $(filter-out -l%,$(1))
@@ -878,6 +879,8 @@ install-bin: all install-gtk
878879
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
879880
$(call QUIET_INSTALL, perf-archive) \
880881
$(INSTALL) $(OUTPUT)perf-archive -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
882+
$(call QUIET_INSTALL, perf-with-kcore) \
883+
$(INSTALL) $(OUTPUT)perf-with-kcore -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
881884
ifndef NO_LIBPERL
882885
$(call QUIET_INSTALL, perl-scripts) \
883886
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'; \
@@ -923,7 +926,7 @@ config-clean:
923926
@$(MAKE) -C config/feature-checks clean >/dev/null
924927

925928
clean: $(LIBTRACEEVENT)-clean $(LIBAPIKFS)-clean config-clean
926-
$(call QUIET_CLEAN, core-objs) $(RM) $(LIB_OBJS) $(BUILTIN_OBJS) $(LIB_FILE) $(OUTPUT)perf-archive $(OUTPUT)perf.o $(LANG_BINDINGS) $(GTK_OBJS)
929+
$(call QUIET_CLEAN, core-objs) $(RM) $(LIB_OBJS) $(BUILTIN_OBJS) $(LIB_FILE) $(OUTPUT)perf-archive $(OUTPUT)perf-with-kcore $(OUTPUT)perf.o $(LANG_BINDINGS) $(GTK_OBJS)
927930
$(call QUIET_CLEAN, core-progs) $(RM) $(ALL_PROGRAMS) perf
928931
$(call QUIET_CLEAN, core-gen) $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope* $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)PERF-CFLAGS $(OUTPUT)PERF-FEATURES $(OUTPUT)util/*-bison* $(OUTPUT)util/*-flex*
929932
$(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) clean

tools/perf/arch/arm/tests/dwarf-unwind.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include "thread.h"
44
#include "map.h"
55
#include "event.h"
6+
#include "debug.h"
67
#include "tests/tests.h"
78

89
#define STACK_SIZE 8192

tools/perf/arch/arm/util/unwind-libunwind.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <libunwind.h>
44
#include "perf_regs.h"
55
#include "../../util/unwind.h"
6+
#include "../../util/debug.h"
67

78
int libunwind__arch_reg_id(int regnum)
89
{

tools/perf/arch/powerpc/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ifndef NO_DWARF
22
PERF_HAVE_DWARF_REGS := 1
33
LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/dwarf-regs.o
4+
LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/skip-callchain-idx.o
45
endif
56
LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/header.o
6-
LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/skip-callchain-idx.o

tools/perf/bench/sched-messaging.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include <sys/socket.h>
2727
#include <sys/wait.h>
2828
#include <sys/time.h>
29-
#include <sys/poll.h>
29+
#include <poll.h>
3030
#include <limits.h>
3131
#include <err.h>
3232

tools/perf/builtin-kvm.c

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -543,14 +543,12 @@ static void print_vcpu_info(struct perf_kvm_stat *kvm)
543543

544544
pr_info("Analyze events for ");
545545

546-
if (kvm->live) {
547-
if (kvm->opts.target.system_wide)
548-
pr_info("all VMs, ");
549-
else if (kvm->opts.target.pid)
550-
pr_info("pid(s) %s, ", kvm->opts.target.pid);
551-
else
552-
pr_info("dazed and confused on what is monitored, ");
553-
}
546+
if (kvm->opts.target.system_wide)
547+
pr_info("all VMs, ");
548+
else if (kvm->opts.target.pid)
549+
pr_info("pid(s) %s, ", kvm->opts.target.pid);
550+
else
551+
pr_info("dazed and confused on what is monitored, ");
554552

555553
if (vcpu == -1)
556554
pr_info("all VCPUs:\n\n");
@@ -1085,8 +1083,8 @@ static int read_events(struct perf_kvm_stat *kvm)
10851083

10861084
static int parse_target_str(struct perf_kvm_stat *kvm)
10871085
{
1088-
if (kvm->pid_str) {
1089-
kvm->pid_list = intlist__new(kvm->pid_str);
1086+
if (kvm->opts.target.pid) {
1087+
kvm->pid_list = intlist__new(kvm->opts.target.pid);
10901088
if (kvm->pid_list == NULL) {
10911089
pr_err("Error parsing process id string\n");
10921090
return -EINVAL;
@@ -1188,7 +1186,7 @@ kvm_events_report(struct perf_kvm_stat *kvm, int argc, const char **argv)
11881186
OPT_STRING('k', "key", &kvm->sort_key, "sort-key",
11891187
"key for sorting: sample(sort by samples number)"
11901188
" time (sort by avg time)"),
1191-
OPT_STRING('p', "pid", &kvm->pid_str, "pid",
1189+
OPT_STRING('p', "pid", &kvm->opts.target.pid, "pid",
11921190
"analyze events only for given process id(s)"),
11931191
OPT_END()
11941192
};
@@ -1207,6 +1205,9 @@ kvm_events_report(struct perf_kvm_stat *kvm, int argc, const char **argv)
12071205
kvm_events_report_options);
12081206
}
12091207

1208+
if (!kvm->opts.target.pid)
1209+
kvm->opts.target.system_wide = true;
1210+
12101211
return kvm_events_report_vcpu(kvm);
12111212
}
12121213

0 commit comments

Comments
 (0)