Skip to content

Commit 56ee04a

Browse files
author
Ingo Molnar
committed
Merge tag 'perf-core-for-mingo-5.6-20200116' 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: perf report: Andi Kleen: - Clarify in help that --children is default. Jin Yao: - Fix no libunwind compiled warning breaking s390. perf annotate/report/top: Andi Kleen: - Support --prefix/--prefix-strip, use it with objdump when doing disassembly. perf c2c: Andres Freund: - Fix return type for histogram sorting comparision functions. perf header: Michael Petlan: - Use last modification time for timestamp, i.e. st.st_mtime instead of the st_ctime. perf beauty: Cengiz Can: - Fix sockaddr printf format for long integers. libperf: Jiri Olsa: - Setup initial evlist::all_cpus value perf parser: Jiri Olsa: - Use %define api.pure full instead of %pure-parser, nuking warning from bison about using deprecated stuff. perf ui gtk: - Add missing zalloc object, fixing gtk browser build. perf clang: Maciej S. Szmigiero: - Fix build issues with Clang 9 and 8+. Signed-off-by: Arnaldo Carvalho de Melo <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
2 parents cb6c82d + 8af19d6 commit 56ee04a

File tree

18 files changed

+97
-16
lines changed

18 files changed

+97
-16
lines changed

tools/build/feature/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ $(OUTPUT)test-libcrypto.bin:
197197
$(BUILD) -lcrypto
198198

199199
$(OUTPUT)test-gtk2.bin:
200-
$(BUILD) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null)
200+
$(BUILD) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null) -Wno-deprecated-declarations
201201

202202
$(OUTPUT)test-gtk2-infobar.bin:
203203
$(BUILD) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null)

tools/build/feature/test-clang.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
// SPDX-License-Identifier: GPL-2.0
2+
#include "clang/Basic/Version.h"
3+
#if CLANG_VERSION_MAJOR < 8
24
#include "clang/Basic/VirtualFileSystem.h"
5+
#endif
36
#include "clang/Driver/Driver.h"
47
#include "clang/Frontend/TextDiagnosticPrinter.h"
58
#include "llvm/ADT/IntrusiveRefCntPtr.h"
69
#include "llvm/Support/ManagedStatic.h"
10+
#if CLANG_VERSION_MAJOR >= 8
11+
#include "llvm/Support/VirtualFileSystem.h"
12+
#endif
713
#include "llvm/Support/raw_ostream.h"
814

915
using namespace clang;

tools/lib/perf/evlist.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,9 @@ void perf_evlist__set_maps(struct perf_evlist *evlist,
164164
evlist->threads = perf_thread_map__get(threads);
165165
}
166166

167+
if (!evlist->all_cpus && cpus)
168+
evlist->all_cpus = perf_cpu_map__get(cpus);
169+
167170
perf_evlist__propagate_maps(evlist);
168171
}
169172

tools/perf/Documentation/perf-annotate.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,12 @@ OPTIONS
112112
--objdump=<path>::
113113
Path to objdump binary.
114114

115+
--prefix=PREFIX::
116+
--prefix-strip=N::
117+
Remove first N entries from source file path names in executables
118+
and add PREFIX. This allows to display source code compiled on systems
119+
with different file system layout.
120+
115121
--skip-missing::
116122
Skip symbols that cannot be annotated.
117123

tools/perf/Documentation/perf-report.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,12 @@ OPTIONS
367367
--objdump=<path>::
368368
Path to objdump binary.
369369

370+
--prefix=PREFIX::
371+
--prefix-strip=N::
372+
Remove first N entries from source file path names in executables
373+
and add PREFIX. This allows to display source code compiled on systems
374+
with different file system layout.
375+
370376
--group::
371377
Show event group information together. It forces group output also
372378
if there are no groups defined in data file.

tools/perf/Documentation/perf-top.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,12 @@ Default is to monitor all CPUS.
158158
-M::
159159
--disassembler-style=:: Set disassembler style for objdump.
160160

161+
--prefix=PREFIX::
162+
--prefix-strip=N::
163+
Remove first N entries from source file path names in executables
164+
and add PREFIX. This allows to display source code compiled on systems
165+
with different file system layout.
166+
161167
--source::
162168
Interleave source code with assembly code. Enabled by default,
163169
disable with --no-source.

tools/perf/builtin-annotate.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,10 @@ int cmd_annotate(int argc, const char **argv)
535535
"Display raw encoding of assembly instructions (default)"),
536536
OPT_STRING('M', "disassembler-style", &annotate.opts.disassembler_style, "disassembler style",
537537
"Specify disassembler style (e.g. -M intel for intel syntax)"),
538+
OPT_STRING(0, "prefix", &annotate.opts.prefix, "prefix",
539+
"Add prefix to source file path names in programs (with --prefix-strip)"),
540+
OPT_STRING(0, "prefix-strip", &annotate.opts.prefix_strip, "N",
541+
"Strip first N entries of source file path name in programs (with --prefix)"),
538542
OPT_STRING(0, "objdump", &annotate.opts.objdump_path, "path",
539543
"objdump binary to use for disassembly and annotations"),
540544
OPT_BOOLEAN(0, "group", &symbol_conf.event_group,
@@ -574,6 +578,9 @@ int cmd_annotate(int argc, const char **argv)
574578
annotate.sym_hist_filter = argv[0];
575579
}
576580

581+
if (annotate_check_args(&annotate.opts) < 0)
582+
return -EINVAL;
583+
577584
if (symbol_conf.show_nr_samples && annotate.use_gtk) {
578585
pr_err("--show-nr-samples is not available in --gtk mode at this time\n");
579586
return ret;

tools/perf/builtin-c2c.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -595,8 +595,8 @@ tot_hitm_cmp(struct perf_hpp_fmt *fmt __maybe_unused,
595595
{
596596
struct c2c_hist_entry *c2c_left;
597597
struct c2c_hist_entry *c2c_right;
598-
unsigned int tot_hitm_left;
599-
unsigned int tot_hitm_right;
598+
uint64_t tot_hitm_left;
599+
uint64_t tot_hitm_right;
600600

601601
c2c_left = container_of(left, struct c2c_hist_entry, he);
602602
c2c_right = container_of(right, struct c2c_hist_entry, he);
@@ -629,7 +629,8 @@ __f ## _cmp(struct perf_hpp_fmt *fmt __maybe_unused, \
629629
\
630630
c2c_left = container_of(left, struct c2c_hist_entry, he); \
631631
c2c_right = container_of(right, struct c2c_hist_entry, he); \
632-
return c2c_left->stats.__f - c2c_right->stats.__f; \
632+
return (uint64_t) c2c_left->stats.__f - \
633+
(uint64_t) c2c_right->stats.__f; \
633634
}
634635

635636
#define STAT_FN(__f) \
@@ -682,7 +683,8 @@ ld_llcmiss_cmp(struct perf_hpp_fmt *fmt __maybe_unused,
682683
c2c_left = container_of(left, struct c2c_hist_entry, he);
683684
c2c_right = container_of(right, struct c2c_hist_entry, he);
684685

685-
return llc_miss(&c2c_left->stats) - llc_miss(&c2c_right->stats);
686+
return (uint64_t) llc_miss(&c2c_left->stats) -
687+
(uint64_t) llc_miss(&c2c_right->stats);
686688
}
687689

688690
static uint64_t total_records(struct c2c_stats *stats)

tools/perf/builtin-report.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -412,10 +412,10 @@ static int report__setup_sample_type(struct report *rep)
412412
PERF_SAMPLE_BRANCH_ANY))
413413
rep->nonany_branch_mode = true;
414414

415-
#ifndef HAVE_LIBUNWIND_SUPPORT
415+
#if !defined(HAVE_LIBUNWIND_SUPPORT) && !defined(HAVE_DWARF_SUPPORT)
416416
if (dwarf_callchain_users) {
417-
ui__warning("Please install libunwind development packages "
418-
"during the perf build.\n");
417+
ui__warning("Please install libunwind or libdw "
418+
"development packages during the perf build.\n");
419419
}
420420
#endif
421421

@@ -1164,7 +1164,8 @@ int cmd_report(int argc, const char **argv)
11641164
report_callchain_help, &report_parse_callchain_opt,
11651165
callchain_default_opt),
11661166
OPT_BOOLEAN(0, "children", &symbol_conf.cumulate_callchain,
1167-
"Accumulate callchains of children and show total overhead as well"),
1167+
"Accumulate callchains of children and show total overhead as well. "
1168+
"Enabled by default, use --no-children to disable."),
11681169
OPT_INTEGER(0, "max-stack", &report.max_stack,
11691170
"Set the maximum stack depth when parsing the callchain, "
11701171
"anything beyond the specified depth will be ignored. "
@@ -1207,6 +1208,10 @@ int cmd_report(int argc, const char **argv)
12071208
"Display raw encoding of assembly instructions (default)"),
12081209
OPT_STRING('M', "disassembler-style", &report.annotation_opts.disassembler_style, "disassembler style",
12091210
"Specify disassembler style (e.g. -M intel for intel syntax)"),
1211+
OPT_STRING(0, "prefix", &report.annotation_opts.prefix, "prefix",
1212+
"Add prefix to source file path names in programs (with --prefix-strip)"),
1213+
OPT_STRING(0, "prefix-strip", &report.annotation_opts.prefix_strip, "N",
1214+
"Strip first N entries of source file path name in programs (with --prefix)"),
12101215
OPT_BOOLEAN(0, "show-total-period", &symbol_conf.show_total_period,
12111216
"Show a column with the sum of periods"),
12121217
OPT_BOOLEAN_SET(0, "group", &symbol_conf.event_group, &report.group_set,
@@ -1286,6 +1291,9 @@ int cmd_report(int argc, const char **argv)
12861291
report.symbol_filter_str = argv[0];
12871292
}
12881293

1294+
if (annotate_check_args(&report.annotation_opts) < 0)
1295+
return -EINVAL;
1296+
12891297
if (report.mmaps_mode)
12901298
report.tasks_mode = true;
12911299

tools/perf/builtin-top.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1512,6 +1512,10 @@ int cmd_top(int argc, const char **argv)
15121512
"objdump binary to use for disassembly and annotations"),
15131513
OPT_STRING('M', "disassembler-style", &top.annotation_opts.disassembler_style, "disassembler style",
15141514
"Specify disassembler style (e.g. -M intel for intel syntax)"),
1515+
OPT_STRING(0, "prefix", &top.annotation_opts.prefix, "prefix",
1516+
"Add prefix to source file path names in programs (with --prefix-strip)"),
1517+
OPT_STRING(0, "prefix-strip", &top.annotation_opts.prefix_strip, "N",
1518+
"Strip first N entries of source file path name in programs (with --prefix)"),
15151519
OPT_STRING('u', "uid", &target->uid_str, "user", "user to profile"),
15161520
OPT_CALLBACK(0, "percent-limit", &top, "percent",
15171521
"Don't show entries under that percent", parse_percent_limit),
@@ -1582,6 +1586,9 @@ int cmd_top(int argc, const char **argv)
15821586
if (argc)
15831587
usage_with_options(top_usage, options);
15841588

1589+
if (annotate_check_args(&top.annotation_opts) < 0)
1590+
goto out_delete_evlist;
1591+
15851592
if (!top.evlist->core.nr_entries &&
15861593
perf_evlist__add_default(top.evlist) < 0) {
15871594
pr_err("Not enough memory for event selector list\n");

0 commit comments

Comments
 (0)