diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-16 15:44:49 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-16 15:44:49 -0500 |
commit | dd3190ee8142d94c9aa09d278a106544b2e5e7d1 (patch) | |
tree | 741c378b30e9cd36385d73ae649553309119897f /tools | |
parent | b29c8306a368cf65782669eba079f81dc861c54d (diff) | |
parent | 89b4be142bf2491a94af325f5206fc2f2aa18960 (diff) |
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf fixes from Ingo Molnar:
"Tooling changes only: it includes the ARM tooling fixlets, various
other fixes, smaller updates, minor cleanups"
* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
perf record: Add an option to force per-cpu mmaps
perf probe: Add '--demangle'/'--no-demangle'
perf ui browser: Fix segfault caused by off by one handling END key
perf symbols: Limit max callchain using max_stack on DWARF unwinding too
perf evsel: Introduce perf_evsel__prev() method
perf tools: Use perf_evlist__{first,last}, perf_evsel__next
perf tools: Synthesize anon MMAP records again
perf top: Add missing newline if the 'uid' is invalid
perf tools: Remove trivial extra semincolon
perf trace: Tweak summary output
tools/perf/build: Fix feature-libunwind-debug-frame handling
tools/perf/build: Fix timerfd feature check
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/Documentation/perf-record.txt | 6 | ||||
-rw-r--r-- | tools/perf/builtin-probe.c | 2 | ||||
-rw-r--r-- | tools/perf/builtin-record.c | 2 | ||||
-rw-r--r-- | tools/perf/builtin-top.c | 4 | ||||
-rw-r--r-- | tools/perf/builtin-trace.c | 10 | ||||
-rw-r--r-- | tools/perf/config/Makefile | 14 | ||||
-rw-r--r-- | tools/perf/config/feature-checks/Makefile | 3 | ||||
-rw-r--r-- | tools/perf/config/feature-checks/test-all.c | 4 | ||||
-rw-r--r-- | tools/perf/tests/parse-events.c | 3 | ||||
-rw-r--r-- | tools/perf/ui/browser.c | 4 | ||||
-rw-r--r-- | tools/perf/ui/browsers/hists.c | 11 | ||||
-rw-r--r-- | tools/perf/util/event.c | 6 | ||||
-rw-r--r-- | tools/perf/util/evlist.c | 6 | ||||
-rw-r--r-- | tools/perf/util/evsel.c | 4 | ||||
-rw-r--r-- | tools/perf/util/evsel.h | 5 | ||||
-rw-r--r-- | tools/perf/util/machine.c | 2 | ||||
-rw-r--r-- | tools/perf/util/target.h | 1 | ||||
-rw-r--r-- | tools/perf/util/unwind.c | 9 | ||||
-rw-r--r-- | tools/perf/util/unwind.h | 5 |
19 files changed, 63 insertions, 38 deletions
diff --git a/tools/perf/Documentation/perf-record.txt b/tools/perf/Documentation/perf-record.txt index 052f7c4dc00c..43b42c4f4a91 100644 --- a/tools/perf/Documentation/perf-record.txt +++ b/tools/perf/Documentation/perf-record.txt | |||
@@ -201,6 +201,12 @@ abort events and some memory events in precise mode on modern Intel CPUs. | |||
201 | --transaction:: | 201 | --transaction:: |
202 | Record transaction flags for transaction related events. | 202 | Record transaction flags for transaction related events. |
203 | 203 | ||
204 | --force-per-cpu:: | ||
205 | Force the use of per-cpu mmaps. By default, when tasks are specified (i.e. -p, | ||
206 | -t or -u options) per-thread mmaps are created. This option overrides that and | ||
207 | forces per-cpu mmaps. A side-effect of that is that inheritance is | ||
208 | automatically enabled. Add the -i option also to disable inheritance. | ||
209 | |||
204 | SEE ALSO | 210 | SEE ALSO |
205 | -------- | 211 | -------- |
206 | linkperf:perf-stat[1], linkperf:perf-list[1] | 212 | linkperf:perf-stat[1], linkperf:perf-list[1] |
diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c index 89acc17cf2a0..6ea9e85bdc00 100644 --- a/tools/perf/builtin-probe.c +++ b/tools/perf/builtin-probe.c | |||
@@ -325,6 +325,8 @@ int cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused) | |||
325 | opt_set_filter), | 325 | opt_set_filter), |
326 | OPT_CALLBACK('x', "exec", NULL, "executable|path", | 326 | OPT_CALLBACK('x', "exec", NULL, "executable|path", |
327 | "target executable name or path", opt_set_target), | 327 | "target executable name or path", opt_set_target), |
328 | OPT_BOOLEAN(0, "demangle", &symbol_conf.demangle, | ||
329 | "Disable symbol demangling"), | ||
328 | OPT_END() | 330 | OPT_END() |
329 | }; | 331 | }; |
330 | int ret; | 332 | int ret; |
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 4d644fe2d5b7..7c8020a32784 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c | |||
@@ -888,6 +888,8 @@ const struct option record_options[] = { | |||
888 | "sample by weight (on special events only)"), | 888 | "sample by weight (on special events only)"), |
889 | OPT_BOOLEAN(0, "transaction", &record.opts.sample_transaction, | 889 | OPT_BOOLEAN(0, "transaction", &record.opts.sample_transaction, |
890 | "sample transaction flags (special events only)"), | 890 | "sample transaction flags (special events only)"), |
891 | OPT_BOOLEAN(0, "force-per-cpu", &record.opts.target.force_per_cpu, | ||
892 | "force the use of per-cpu mmaps"), | ||
891 | OPT_END() | 893 | OPT_END() |
892 | }; | 894 | }; |
893 | 895 | ||
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index b8f8e29db332..71e6402729a8 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c | |||
@@ -1172,7 +1172,7 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused) | |||
1172 | status = target__validate(target); | 1172 | status = target__validate(target); |
1173 | if (status) { | 1173 | if (status) { |
1174 | target__strerror(target, status, errbuf, BUFSIZ); | 1174 | target__strerror(target, status, errbuf, BUFSIZ); |
1175 | ui__warning("%s", errbuf); | 1175 | ui__warning("%s\n", errbuf); |
1176 | } | 1176 | } |
1177 | 1177 | ||
1178 | status = target__parse_uid(target); | 1178 | status = target__parse_uid(target); |
@@ -1180,7 +1180,7 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused) | |||
1180 | int saved_errno = errno; | 1180 | int saved_errno = errno; |
1181 | 1181 | ||
1182 | target__strerror(target, status, errbuf, BUFSIZ); | 1182 | target__strerror(target, status, errbuf, BUFSIZ); |
1183 | ui__error("%s", errbuf); | 1183 | ui__error("%s\n", errbuf); |
1184 | 1184 | ||
1185 | status = -saved_errno; | 1185 | status = -saved_errno; |
1186 | goto out_delete_evlist; | 1186 | goto out_delete_evlist; |
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index 6b230af940e2..8be17fc462ba 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c | |||
@@ -2112,9 +2112,9 @@ static size_t thread__dump_stats(struct thread_trace *ttrace, | |||
2112 | 2112 | ||
2113 | printed += fprintf(fp, "\n"); | 2113 | printed += fprintf(fp, "\n"); |
2114 | 2114 | ||
2115 | printed += fprintf(fp, " msec/call\n"); | 2115 | printed += fprintf(fp, " syscall calls min avg max stddev\n"); |
2116 | printed += fprintf(fp, " syscall calls min avg max stddev\n"); | 2116 | printed += fprintf(fp, " (msec) (msec) (msec) (%%)\n"); |
2117 | printed += fprintf(fp, " --------------- -------- -------- -------- -------- ------\n"); | 2117 | printed += fprintf(fp, " --------------- -------- --------- --------- --------- ------\n"); |
2118 | 2118 | ||
2119 | /* each int_node is a syscall */ | 2119 | /* each int_node is a syscall */ |
2120 | while (inode) { | 2120 | while (inode) { |
@@ -2131,9 +2131,9 @@ static size_t thread__dump_stats(struct thread_trace *ttrace, | |||
2131 | 2131 | ||
2132 | sc = &trace->syscalls.table[inode->i]; | 2132 | sc = &trace->syscalls.table[inode->i]; |
2133 | printed += fprintf(fp, " %-15s", sc->name); | 2133 | printed += fprintf(fp, " %-15s", sc->name); |
2134 | printed += fprintf(fp, " %8" PRIu64 " %8.3f %8.3f", | 2134 | printed += fprintf(fp, " %8" PRIu64 " %9.3f %9.3f", |
2135 | n, min, avg); | 2135 | n, min, avg); |
2136 | printed += fprintf(fp, " %8.3f %6.2f\n", max, pct); | 2136 | printed += fprintf(fp, " %9.3f %9.2f%%\n", max, pct); |
2137 | } | 2137 | } |
2138 | 2138 | ||
2139 | inode = intlist__next(inode); | 2139 | inode = intlist__next(inode); |
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile index f5905f2b197d..f7d11a811c74 100644 --- a/tools/perf/config/Makefile +++ b/tools/perf/config/Makefile | |||
@@ -142,7 +142,8 @@ CORE_FEATURE_TESTS = \ | |||
142 | libunwind \ | 142 | libunwind \ |
143 | on-exit \ | 143 | on-exit \ |
144 | stackprotector \ | 144 | stackprotector \ |
145 | stackprotector-all | 145 | stackprotector-all \ |
146 | timerfd | ||
146 | 147 | ||
147 | # | 148 | # |
148 | # So here we detect whether test-all was rebuilt, to be able | 149 | # So here we detect whether test-all was rebuilt, to be able |
@@ -328,8 +329,14 @@ ifndef NO_LIBUNWIND | |||
328 | msg := $(warning No libunwind found, disabling post unwind support. Please install libunwind-dev[el] >= 1.1); | 329 | msg := $(warning No libunwind found, disabling post unwind support. Please install libunwind-dev[el] >= 1.1); |
329 | NO_LIBUNWIND := 1 | 330 | NO_LIBUNWIND := 1 |
330 | else | 331 | else |
331 | ifneq ($(feature-libunwind-debug-frame), 1) | 332 | ifeq ($(ARCH),arm) |
332 | msg := $(warning No debug_frame support found in libunwind); | 333 | $(call feature_check,libunwind-debug-frame) |
334 | ifneq ($(feature-libunwind-debug-frame), 1) | ||
335 | msg := $(warning No debug_frame support found in libunwind); | ||
336 | CFLAGS += -DNO_LIBUNWIND_DEBUG_FRAME | ||
337 | endif | ||
338 | else | ||
339 | # non-ARM has no dwarf_find_debug_frame() function: | ||
333 | CFLAGS += -DNO_LIBUNWIND_DEBUG_FRAME | 340 | CFLAGS += -DNO_LIBUNWIND_DEBUG_FRAME |
334 | endif | 341 | endif |
335 | endif | 342 | endif |
@@ -405,7 +412,6 @@ else | |||
405 | endif | 412 | endif |
406 | endif | 413 | endif |
407 | 414 | ||
408 | $(call feature_check,timerfd) | ||
409 | ifeq ($(feature-timerfd), 1) | 415 | ifeq ($(feature-timerfd), 1) |
410 | CFLAGS += -DHAVE_TIMERFD_SUPPORT | 416 | CFLAGS += -DHAVE_TIMERFD_SUPPORT |
411 | else | 417 | else |
diff --git a/tools/perf/config/feature-checks/Makefile b/tools/perf/config/feature-checks/Makefile index e8e195f49a4e..87e790017c69 100644 --- a/tools/perf/config/feature-checks/Makefile +++ b/tools/perf/config/feature-checks/Makefile | |||
@@ -76,6 +76,9 @@ test-libnuma: | |||
76 | test-libunwind: | 76 | test-libunwind: |
77 | $(BUILD) $(LIBUNWIND_LIBS) -lelf | 77 | $(BUILD) $(LIBUNWIND_LIBS) -lelf |
78 | 78 | ||
79 | test-libunwind-debug-frame: | ||
80 | $(BUILD) $(LIBUNWIND_LIBS) -lelf | ||
81 | |||
79 | test-libaudit: | 82 | test-libaudit: |
80 | $(BUILD) -laudit | 83 | $(BUILD) -laudit |
81 | 84 | ||
diff --git a/tools/perf/config/feature-checks/test-all.c b/tools/perf/config/feature-checks/test-all.c index 799865b60772..59e7a705e146 100644 --- a/tools/perf/config/feature-checks/test-all.c +++ b/tools/perf/config/feature-checks/test-all.c | |||
@@ -49,10 +49,6 @@ | |||
49 | # include "test-libunwind.c" | 49 | # include "test-libunwind.c" |
50 | #undef main | 50 | #undef main |
51 | 51 | ||
52 | #define main main_test_libunwind_debug_frame | ||
53 | # include "test-libunwind-debug-frame.c" | ||
54 | #undef main | ||
55 | |||
56 | #define main main_test_libaudit | 52 | #define main main_test_libaudit |
57 | # include "test-libaudit.c" | 53 | # include "test-libaudit.c" |
58 | #undef main | 54 | #undef main |
diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c index ef671cd41bb3..3cbd10496087 100644 --- a/tools/perf/tests/parse-events.c +++ b/tools/perf/tests/parse-events.c | |||
@@ -441,9 +441,8 @@ static int test__checkevent_pmu_name(struct perf_evlist *evlist) | |||
441 | 441 | ||
442 | static int test__checkevent_pmu_events(struct perf_evlist *evlist) | 442 | static int test__checkevent_pmu_events(struct perf_evlist *evlist) |
443 | { | 443 | { |
444 | struct perf_evsel *evsel; | 444 | struct perf_evsel *evsel = perf_evlist__first(evlist); |
445 | 445 | ||
446 | evsel = list_entry(evlist->entries.next, struct perf_evsel, node); | ||
447 | TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->nr_entries); | 446 | TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->nr_entries); |
448 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->attr.type); | 447 | TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->attr.type); |
449 | TEST_ASSERT_VAL("wrong exclude_user", | 448 | TEST_ASSERT_VAL("wrong exclude_user", |
diff --git a/tools/perf/ui/browser.c b/tools/perf/ui/browser.c index bbc782e364b0..cbaa7af45513 100644 --- a/tools/perf/ui/browser.c +++ b/tools/perf/ui/browser.c | |||
@@ -569,7 +569,7 @@ void ui_browser__argv_seek(struct ui_browser *browser, off_t offset, int whence) | |||
569 | browser->top = browser->top + browser->top_idx + offset; | 569 | browser->top = browser->top + browser->top_idx + offset; |
570 | break; | 570 | break; |
571 | case SEEK_END: | 571 | case SEEK_END: |
572 | browser->top = browser->top + browser->nr_entries + offset; | 572 | browser->top = browser->top + browser->nr_entries - 1 + offset; |
573 | break; | 573 | break; |
574 | default: | 574 | default: |
575 | return; | 575 | return; |
@@ -680,7 +680,7 @@ static void __ui_browser__line_arrow_down(struct ui_browser *browser, | |||
680 | if (end >= browser->top_idx + browser->height) | 680 | if (end >= browser->top_idx + browser->height) |
681 | end_row = browser->height - 1; | 681 | end_row = browser->height - 1; |
682 | else | 682 | else |
683 | end_row = end - browser->top_idx;; | 683 | end_row = end - browser->top_idx; |
684 | 684 | ||
685 | ui_browser__gotorc(browser, row, column); | 685 | ui_browser__gotorc(browser, row, column); |
686 | SLsmg_draw_vline(end_row - row + 1); | 686 | SLsmg_draw_vline(end_row - row + 1); |
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c index 16848bb4c418..a440e03cd8c2 100644 --- a/tools/perf/ui/browsers/hists.c +++ b/tools/perf/ui/browsers/hists.c | |||
@@ -1847,15 +1847,15 @@ browse_hists: | |||
1847 | switch (key) { | 1847 | switch (key) { |
1848 | case K_TAB: | 1848 | case K_TAB: |
1849 | if (pos->node.next == &evlist->entries) | 1849 | if (pos->node.next == &evlist->entries) |
1850 | pos = list_entry(evlist->entries.next, struct perf_evsel, node); | 1850 | pos = perf_evlist__first(evlist); |
1851 | else | 1851 | else |
1852 | pos = list_entry(pos->node.next, struct perf_evsel, node); | 1852 | pos = perf_evsel__next(pos); |
1853 | goto browse_hists; | 1853 | goto browse_hists; |
1854 | case K_UNTAB: | 1854 | case K_UNTAB: |
1855 | if (pos->node.prev == &evlist->entries) | 1855 | if (pos->node.prev == &evlist->entries) |
1856 | pos = list_entry(evlist->entries.prev, struct perf_evsel, node); | 1856 | pos = perf_evlist__last(evlist); |
1857 | else | 1857 | else |
1858 | pos = list_entry(pos->node.prev, struct perf_evsel, node); | 1858 | pos = perf_evsel__prev(pos); |
1859 | goto browse_hists; | 1859 | goto browse_hists; |
1860 | case K_ESC: | 1860 | case K_ESC: |
1861 | if (!ui_browser__dialog_yesno(&menu->b, | 1861 | if (!ui_browser__dialog_yesno(&menu->b, |
@@ -1943,8 +1943,7 @@ int perf_evlist__tui_browse_hists(struct perf_evlist *evlist, const char *help, | |||
1943 | 1943 | ||
1944 | single_entry: | 1944 | single_entry: |
1945 | if (nr_entries == 1) { | 1945 | if (nr_entries == 1) { |
1946 | struct perf_evsel *first = list_entry(evlist->entries.next, | 1946 | struct perf_evsel *first = perf_evlist__first(evlist); |
1947 | struct perf_evsel, node); | ||
1948 | const char *ev_name = perf_evsel__name(first); | 1947 | const char *ev_name = perf_evsel__name(first); |
1949 | 1948 | ||
1950 | return perf_evsel__hists_browse(first, nr_entries, help, | 1949 | return perf_evsel__hists_browse(first, nr_entries, help, |
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c index 6e3a846aed0e..bb788c109fe6 100644 --- a/tools/perf/util/event.c +++ b/tools/perf/util/event.c | |||
@@ -209,8 +209,10 @@ static int perf_event__synthesize_mmap_events(struct perf_tool *tool, | |||
209 | &event->mmap.start, &event->mmap.len, prot, | 209 | &event->mmap.start, &event->mmap.len, prot, |
210 | &event->mmap.pgoff, | 210 | &event->mmap.pgoff, |
211 | execname); | 211 | execname); |
212 | 212 | /* | |
213 | if (n != 5) | 213 | * Anon maps don't have the execname. |
214 | */ | ||
215 | if (n < 4) | ||
214 | continue; | 216 | continue; |
215 | /* | 217 | /* |
216 | * Just like the kernel, see __perf_event_mmap in kernel/perf_event.c | 218 | * Just like the kernel, see __perf_event_mmap in kernel/perf_event.c |
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index dc6fa3fbb180..bbc746aa5716 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c | |||
@@ -819,7 +819,9 @@ int perf_evlist__create_maps(struct perf_evlist *evlist, struct target *target) | |||
819 | if (evlist->threads == NULL) | 819 | if (evlist->threads == NULL) |
820 | return -1; | 820 | return -1; |
821 | 821 | ||
822 | if (target__has_task(target)) | 822 | if (target->force_per_cpu) |
823 | evlist->cpus = cpu_map__new(target->cpu_list); | ||
824 | else if (target__has_task(target)) | ||
823 | evlist->cpus = cpu_map__dummy_new(); | 825 | evlist->cpus = cpu_map__dummy_new(); |
824 | else if (!target__has_cpu(target) && !target->uses_mmap) | 826 | else if (!target__has_cpu(target) && !target->uses_mmap) |
825 | evlist->cpus = cpu_map__dummy_new(); | 827 | evlist->cpus = cpu_map__dummy_new(); |
@@ -1148,7 +1150,7 @@ size_t perf_evlist__fprintf(struct perf_evlist *evlist, FILE *fp) | |||
1148 | perf_evsel__name(evsel)); | 1150 | perf_evsel__name(evsel)); |
1149 | } | 1151 | } |
1150 | 1152 | ||
1151 | return printed + fprintf(fp, "\n");; | 1153 | return printed + fprintf(fp, "\n"); |
1152 | } | 1154 | } |
1153 | 1155 | ||
1154 | int perf_evlist__strerror_tp(struct perf_evlist *evlist __maybe_unused, | 1156 | int perf_evlist__strerror_tp(struct perf_evlist *evlist __maybe_unused, |
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 18f7c188ff63..46dd4c2a41ce 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c | |||
@@ -645,7 +645,7 @@ void perf_evsel__config(struct perf_evsel *evsel, | |||
645 | } | 645 | } |
646 | } | 646 | } |
647 | 647 | ||
648 | if (target__has_cpu(&opts->target)) | 648 | if (target__has_cpu(&opts->target) || opts->target.force_per_cpu) |
649 | perf_evsel__set_sample_bit(evsel, CPU); | 649 | perf_evsel__set_sample_bit(evsel, CPU); |
650 | 650 | ||
651 | if (opts->period) | 651 | if (opts->period) |
@@ -653,7 +653,7 @@ void perf_evsel__config(struct perf_evsel *evsel, | |||
653 | 653 | ||
654 | if (!perf_missing_features.sample_id_all && | 654 | if (!perf_missing_features.sample_id_all && |
655 | (opts->sample_time || !opts->no_inherit || | 655 | (opts->sample_time || !opts->no_inherit || |
656 | target__has_cpu(&opts->target))) | 656 | target__has_cpu(&opts->target) || opts->target.force_per_cpu)) |
657 | perf_evsel__set_sample_bit(evsel, TIME); | 657 | perf_evsel__set_sample_bit(evsel, TIME); |
658 | 658 | ||
659 | if (opts->raw_samples) { | 659 | if (opts->raw_samples) { |
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index f5029653dcd7..1ea7c92e6e33 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h | |||
@@ -279,6 +279,11 @@ static inline struct perf_evsel *perf_evsel__next(struct perf_evsel *evsel) | |||
279 | return list_entry(evsel->node.next, struct perf_evsel, node); | 279 | return list_entry(evsel->node.next, struct perf_evsel, node); |
280 | } | 280 | } |
281 | 281 | ||
282 | static inline struct perf_evsel *perf_evsel__prev(struct perf_evsel *evsel) | ||
283 | { | ||
284 | return list_entry(evsel->node.prev, struct perf_evsel, node); | ||
285 | } | ||
286 | |||
282 | /** | 287 | /** |
283 | * perf_evsel__is_group_leader - Return whether given evsel is a leader event | 288 | * perf_evsel__is_group_leader - Return whether given evsel is a leader event |
284 | * | 289 | * |
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index 0393912d8033..84cdb072ac83 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c | |||
@@ -1368,7 +1368,7 @@ int machine__resolve_callchain(struct machine *machine, | |||
1368 | 1368 | ||
1369 | return unwind__get_entries(unwind_entry, &callchain_cursor, machine, | 1369 | return unwind__get_entries(unwind_entry, &callchain_cursor, machine, |
1370 | thread, evsel->attr.sample_regs_user, | 1370 | thread, evsel->attr.sample_regs_user, |
1371 | sample); | 1371 | sample, max_stack); |
1372 | 1372 | ||
1373 | } | 1373 | } |
1374 | 1374 | ||
diff --git a/tools/perf/util/target.h b/tools/perf/util/target.h index 89bab7129de4..2d0c50690892 100644 --- a/tools/perf/util/target.h +++ b/tools/perf/util/target.h | |||
@@ -12,6 +12,7 @@ struct target { | |||
12 | uid_t uid; | 12 | uid_t uid; |
13 | bool system_wide; | 13 | bool system_wide; |
14 | bool uses_mmap; | 14 | bool uses_mmap; |
15 | bool force_per_cpu; | ||
15 | }; | 16 | }; |
16 | 17 | ||
17 | enum target_errno { | 18 | enum target_errno { |
diff --git a/tools/perf/util/unwind.c b/tools/perf/util/unwind.c index 5390d0b8862a..0efd5393de85 100644 --- a/tools/perf/util/unwind.c +++ b/tools/perf/util/unwind.c | |||
@@ -559,7 +559,7 @@ static unw_accessors_t accessors = { | |||
559 | }; | 559 | }; |
560 | 560 | ||
561 | static int get_entries(struct unwind_info *ui, unwind_entry_cb_t cb, | 561 | static int get_entries(struct unwind_info *ui, unwind_entry_cb_t cb, |
562 | void *arg) | 562 | void *arg, int max_stack) |
563 | { | 563 | { |
564 | unw_addr_space_t addr_space; | 564 | unw_addr_space_t addr_space; |
565 | unw_cursor_t c; | 565 | unw_cursor_t c; |
@@ -575,7 +575,7 @@ static int get_entries(struct unwind_info *ui, unwind_entry_cb_t cb, | |||
575 | if (ret) | 575 | if (ret) |
576 | display_error(ret); | 576 | display_error(ret); |
577 | 577 | ||
578 | while (!ret && (unw_step(&c) > 0)) { | 578 | while (!ret && (unw_step(&c) > 0) && max_stack--) { |
579 | unw_word_t ip; | 579 | unw_word_t ip; |
580 | 580 | ||
581 | unw_get_reg(&c, UNW_REG_IP, &ip); | 581 | unw_get_reg(&c, UNW_REG_IP, &ip); |
@@ -588,7 +588,8 @@ static int get_entries(struct unwind_info *ui, unwind_entry_cb_t cb, | |||
588 | 588 | ||
589 | int unwind__get_entries(unwind_entry_cb_t cb, void *arg, | 589 | int unwind__get_entries(unwind_entry_cb_t cb, void *arg, |
590 | struct machine *machine, struct thread *thread, | 590 | struct machine *machine, struct thread *thread, |
591 | u64 sample_uregs, struct perf_sample *data) | 591 | u64 sample_uregs, struct perf_sample *data, |
592 | int max_stack) | ||
592 | { | 593 | { |
593 | unw_word_t ip; | 594 | unw_word_t ip; |
594 | struct unwind_info ui = { | 595 | struct unwind_info ui = { |
@@ -610,5 +611,5 @@ int unwind__get_entries(unwind_entry_cb_t cb, void *arg, | |||
610 | if (ret) | 611 | if (ret) |
611 | return -ENOMEM; | 612 | return -ENOMEM; |
612 | 613 | ||
613 | return get_entries(&ui, cb, arg); | 614 | return get_entries(&ui, cb, arg, max_stack); |
614 | } | 615 | } |
diff --git a/tools/perf/util/unwind.h b/tools/perf/util/unwind.h index ec0c71a2ca2e..d5966f49e22c 100644 --- a/tools/perf/util/unwind.h +++ b/tools/perf/util/unwind.h | |||
@@ -18,7 +18,7 @@ int unwind__get_entries(unwind_entry_cb_t cb, void *arg, | |||
18 | struct machine *machine, | 18 | struct machine *machine, |
19 | struct thread *thread, | 19 | struct thread *thread, |
20 | u64 sample_uregs, | 20 | u64 sample_uregs, |
21 | struct perf_sample *data); | 21 | struct perf_sample *data, int max_stack); |
22 | int unwind__arch_reg_id(int regnum); | 22 | int unwind__arch_reg_id(int regnum); |
23 | #else | 23 | #else |
24 | static inline int | 24 | static inline int |
@@ -27,7 +27,8 @@ unwind__get_entries(unwind_entry_cb_t cb __maybe_unused, | |||
27 | struct machine *machine __maybe_unused, | 27 | struct machine *machine __maybe_unused, |
28 | struct thread *thread __maybe_unused, | 28 | struct thread *thread __maybe_unused, |
29 | u64 sample_uregs __maybe_unused, | 29 | u64 sample_uregs __maybe_unused, |
30 | struct perf_sample *data __maybe_unused) | 30 | struct perf_sample *data __maybe_unused, |
31 | int max_stack __maybe_unused) | ||
31 | { | 32 | { |
32 | return 0; | 33 | return 0; |
33 | } | 34 | } |