diff options
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/Makefile.perf | 13 | ||||
-rw-r--r-- | tools/perf/builtin-record.c | 6 | ||||
-rw-r--r-- | tools/perf/config/Makefile | 3 | ||||
-rw-r--r-- | tools/perf/perf.c | 8 | ||||
-rw-r--r-- | tools/perf/ui/browser.c | 2 | ||||
-rw-r--r-- | tools/perf/ui/browsers/hists.c | 8 | ||||
-rw-r--r-- | tools/perf/util/hist.h | 8 | ||||
-rw-r--r-- | tools/perf/util/sort.c | 103 | ||||
-rw-r--r-- | tools/perf/util/sort.h | 2 |
9 files changed, 90 insertions, 63 deletions
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 67f7c0575b26..ae20edfcc3f7 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf | |||
@@ -789,8 +789,8 @@ help: | |||
789 | @echo '' | 789 | @echo '' |
790 | @echo 'Perf install targets:' | 790 | @echo 'Perf install targets:' |
791 | @echo ' NOTE: documentation build requires asciidoc, xmlto packages to be installed' | 791 | @echo ' NOTE: documentation build requires asciidoc, xmlto packages to be installed' |
792 | @echo ' HINT: use "make prefix=<path> <install target>" to install to a particular' | 792 | @echo ' HINT: use "prefix" or "DESTDIR" to install to a particular' |
793 | @echo ' path like make prefix=/usr/local install install-doc' | 793 | @echo ' path like "make prefix=/usr/local install install-doc"' |
794 | @echo ' install - install compiled binaries' | 794 | @echo ' install - install compiled binaries' |
795 | @echo ' install-doc - install *all* documentation' | 795 | @echo ' install-doc - install *all* documentation' |
796 | @echo ' install-man - install manpage documentation' | 796 | @echo ' install-man - install manpage documentation' |
@@ -815,17 +815,20 @@ INSTALL_DOC_TARGETS += quick-install-doc quick-install-man quick-install-html | |||
815 | $(DOC_TARGETS): | 815 | $(DOC_TARGETS): |
816 | $(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) $(@:doc=all) | 816 | $(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) $(@:doc=all) |
817 | 817 | ||
818 | TAG_FOLDERS= . ../lib/traceevent ../lib/api ../lib/symbol | ||
819 | TAG_FILES= ../../include/uapi/linux/perf_event.h | ||
820 | |||
818 | TAGS: | 821 | TAGS: |
819 | $(RM) TAGS | 822 | $(RM) TAGS |
820 | $(FIND) . -name '*.[hcS]' -print | xargs etags -a | 823 | $(FIND) $(TAG_FOLDERS) -name '*.[hcS]' -print | xargs etags -a $(TAG_FILES) |
821 | 824 | ||
822 | tags: | 825 | tags: |
823 | $(RM) tags | 826 | $(RM) tags |
824 | $(FIND) . -name '*.[hcS]' -print | xargs ctags -a | 827 | $(FIND) $(TAG_FOLDERS) -name '*.[hcS]' -print | xargs ctags -a $(TAG_FILES) |
825 | 828 | ||
826 | cscope: | 829 | cscope: |
827 | $(RM) cscope* | 830 | $(RM) cscope* |
828 | $(FIND) . -name '*.[hcS]' -print | xargs cscope -b | 831 | $(FIND) $(TAG_FOLDERS) -name '*.[hcS]' -print | xargs cscope -b $(TAG_FILES) |
829 | 832 | ||
830 | ### Detect prefix changes | 833 | ### Detect prefix changes |
831 | TRACK_CFLAGS = $(subst ','\'',$(CFLAGS)):\ | 834 | TRACK_CFLAGS = $(subst ','\'',$(CFLAGS)):\ |
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index e4c85b8f46c2..ce2cfec5c764 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c | |||
@@ -454,7 +454,11 @@ static int __cmd_record(struct record *rec, int argc, const char **argv) | |||
454 | if (done) | 454 | if (done) |
455 | break; | 455 | break; |
456 | err = poll(rec->evlist->pollfd, rec->evlist->nr_fds, -1); | 456 | err = poll(rec->evlist->pollfd, rec->evlist->nr_fds, -1); |
457 | if (err < 0 && errno == EINTR) | 457 | /* |
458 | * Propagate error, only if there's any. Ignore positive | ||
459 | * number of returned events and interrupt error. | ||
460 | */ | ||
461 | if (err > 0 || (err < 0 && errno == EINTR)) | ||
458 | err = 0; | 462 | err = 0; |
459 | waking++; | 463 | waking++; |
460 | } | 464 | } |
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile index 729bbdf5cec7..4f100b54ba8b 100644 --- a/tools/perf/config/Makefile +++ b/tools/perf/config/Makefile | |||
@@ -447,6 +447,7 @@ else | |||
447 | ifneq ($(feature-libperl), 1) | 447 | ifneq ($(feature-libperl), 1) |
448 | CFLAGS += -DNO_LIBPERL | 448 | CFLAGS += -DNO_LIBPERL |
449 | NO_LIBPERL := 1 | 449 | NO_LIBPERL := 1 |
450 | msg := $(warning Missing perl devel files. Disabling perl scripting support, consider installing perl-ExtUtils-Embed); | ||
450 | else | 451 | else |
451 | LDFLAGS += $(PERL_EMBED_LDFLAGS) | 452 | LDFLAGS += $(PERL_EMBED_LDFLAGS) |
452 | EXTLIBS += $(PERL_EMBED_LIBADD) | 453 | EXTLIBS += $(PERL_EMBED_LIBADD) |
@@ -599,7 +600,7 @@ endif | |||
599 | 600 | ||
600 | # Make the path relative to DESTDIR, not to prefix | 601 | # Make the path relative to DESTDIR, not to prefix |
601 | ifndef DESTDIR | 602 | ifndef DESTDIR |
602 | prefix = $(HOME) | 603 | prefix ?= $(HOME) |
603 | endif | 604 | endif |
604 | bindir_relative = bin | 605 | bindir_relative = bin |
605 | bindir = $(prefix)/$(bindir_relative) | 606 | bindir = $(prefix)/$(bindir_relative) |
diff --git a/tools/perf/perf.c b/tools/perf/perf.c index 431798a4110d..78f7b920e548 100644 --- a/tools/perf/perf.c +++ b/tools/perf/perf.c | |||
@@ -481,14 +481,18 @@ int main(int argc, const char **argv) | |||
481 | fprintf(stderr, "cannot handle %s internally", cmd); | 481 | fprintf(stderr, "cannot handle %s internally", cmd); |
482 | goto out; | 482 | goto out; |
483 | } | 483 | } |
484 | #ifdef HAVE_LIBAUDIT_SUPPORT | ||
485 | if (!prefixcmp(cmd, "trace")) { | 484 | if (!prefixcmp(cmd, "trace")) { |
485 | #ifdef HAVE_LIBAUDIT_SUPPORT | ||
486 | set_buildid_dir(); | 486 | set_buildid_dir(); |
487 | setup_path(); | 487 | setup_path(); |
488 | argv[0] = "trace"; | 488 | argv[0] = "trace"; |
489 | return cmd_trace(argc, argv, NULL); | 489 | return cmd_trace(argc, argv, NULL); |
490 | } | 490 | #else |
491 | fprintf(stderr, | ||
492 | "trace command not available: missing audit-libs devel package at build time.\n"); | ||
493 | goto out; | ||
491 | #endif | 494 | #endif |
495 | } | ||
492 | /* Look for flags.. */ | 496 | /* Look for flags.. */ |
493 | argv++; | 497 | argv++; |
494 | argc--; | 498 | argc--; |
diff --git a/tools/perf/ui/browser.c b/tools/perf/ui/browser.c index d11541d4d7d7..3ccf6e14f89b 100644 --- a/tools/perf/ui/browser.c +++ b/tools/perf/ui/browser.c | |||
@@ -194,7 +194,7 @@ int ui_browser__warning(struct ui_browser *browser, int timeout, | |||
194 | ui_helpline__vpush(format, args); | 194 | ui_helpline__vpush(format, args); |
195 | va_end(args); | 195 | va_end(args); |
196 | } else { | 196 | } else { |
197 | while ((key == ui__question_window("Warning!", text, | 197 | while ((key = ui__question_window("Warning!", text, |
198 | "Press any key...", | 198 | "Press any key...", |
199 | timeout)) == K_RESIZE) | 199 | timeout)) == K_RESIZE) |
200 | ui_browser__handle_resize(browser); | 200 | ui_browser__handle_resize(browser); |
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c index 5905acde5f1d..52c03fbbba17 100644 --- a/tools/perf/ui/browsers/hists.c +++ b/tools/perf/ui/browsers/hists.c | |||
@@ -1706,14 +1706,14 @@ zoom_dso: | |||
1706 | zoom_out_dso: | 1706 | zoom_out_dso: |
1707 | ui_helpline__pop(); | 1707 | ui_helpline__pop(); |
1708 | browser->hists->dso_filter = NULL; | 1708 | browser->hists->dso_filter = NULL; |
1709 | sort_dso.elide = false; | 1709 | perf_hpp__set_elide(HISTC_DSO, false); |
1710 | } else { | 1710 | } else { |
1711 | if (dso == NULL) | 1711 | if (dso == NULL) |
1712 | continue; | 1712 | continue; |
1713 | ui_helpline__fpush("To zoom out press <- or -> + \"Zoom out of %s DSO\"", | 1713 | ui_helpline__fpush("To zoom out press <- or -> + \"Zoom out of %s DSO\"", |
1714 | dso->kernel ? "the Kernel" : dso->short_name); | 1714 | dso->kernel ? "the Kernel" : dso->short_name); |
1715 | browser->hists->dso_filter = dso; | 1715 | browser->hists->dso_filter = dso; |
1716 | sort_dso.elide = true; | 1716 | perf_hpp__set_elide(HISTC_DSO, true); |
1717 | pstack__push(fstack, &browser->hists->dso_filter); | 1717 | pstack__push(fstack, &browser->hists->dso_filter); |
1718 | } | 1718 | } |
1719 | hists__filter_by_dso(hists); | 1719 | hists__filter_by_dso(hists); |
@@ -1725,13 +1725,13 @@ zoom_thread: | |||
1725 | zoom_out_thread: | 1725 | zoom_out_thread: |
1726 | ui_helpline__pop(); | 1726 | ui_helpline__pop(); |
1727 | browser->hists->thread_filter = NULL; | 1727 | browser->hists->thread_filter = NULL; |
1728 | sort_thread.elide = false; | 1728 | perf_hpp__set_elide(HISTC_THREAD, false); |
1729 | } else { | 1729 | } else { |
1730 | ui_helpline__fpush("To zoom out press <- or -> + \"Zoom out of %s(%d) thread\"", | 1730 | ui_helpline__fpush("To zoom out press <- or -> + \"Zoom out of %s(%d) thread\"", |
1731 | thread->comm_set ? thread__comm_str(thread) : "", | 1731 | thread->comm_set ? thread__comm_str(thread) : "", |
1732 | thread->tid); | 1732 | thread->tid); |
1733 | browser->hists->thread_filter = thread; | 1733 | browser->hists->thread_filter = thread; |
1734 | sort_thread.elide = true; | 1734 | perf_hpp__set_elide(HISTC_THREAD, false); |
1735 | pstack__push(fstack, &browser->hists->thread_filter); | 1735 | pstack__push(fstack, &browser->hists->thread_filter); |
1736 | } | 1736 | } |
1737 | hists__filter_by_thread(hists); | 1737 | hists__filter_by_thread(hists); |
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h index 82b28ff98062..d2bf03575d5f 100644 --- a/tools/perf/util/hist.h +++ b/tools/perf/util/hist.h | |||
@@ -205,6 +205,7 @@ struct perf_hpp_fmt { | |||
205 | 205 | ||
206 | struct list_head list; | 206 | struct list_head list; |
207 | struct list_head sort_list; | 207 | struct list_head sort_list; |
208 | bool elide; | ||
208 | }; | 209 | }; |
209 | 210 | ||
210 | extern struct list_head perf_hpp__list; | 211 | extern struct list_head perf_hpp__list; |
@@ -252,7 +253,12 @@ void perf_hpp__append_sort_keys(void); | |||
252 | 253 | ||
253 | bool perf_hpp__is_sort_entry(struct perf_hpp_fmt *format); | 254 | bool perf_hpp__is_sort_entry(struct perf_hpp_fmt *format); |
254 | bool perf_hpp__same_sort_entry(struct perf_hpp_fmt *a, struct perf_hpp_fmt *b); | 255 | bool perf_hpp__same_sort_entry(struct perf_hpp_fmt *a, struct perf_hpp_fmt *b); |
255 | bool perf_hpp__should_skip(struct perf_hpp_fmt *format); | 256 | |
257 | static inline bool perf_hpp__should_skip(struct perf_hpp_fmt *format) | ||
258 | { | ||
259 | return format->elide; | ||
260 | } | ||
261 | |||
256 | void perf_hpp__reset_width(struct perf_hpp_fmt *fmt, struct hists *hists); | 262 | void perf_hpp__reset_width(struct perf_hpp_fmt *fmt, struct hists *hists); |
257 | 263 | ||
258 | typedef u64 (*hpp_field_fn)(struct hist_entry *he); | 264 | typedef u64 (*hpp_field_fn)(struct hist_entry *he); |
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c index 254f583a52ab..45512baaab67 100644 --- a/tools/perf/util/sort.c +++ b/tools/perf/util/sort.c | |||
@@ -1157,6 +1157,7 @@ __sort_dimension__alloc_hpp(struct sort_dimension *sd) | |||
1157 | 1157 | ||
1158 | INIT_LIST_HEAD(&hse->hpp.list); | 1158 | INIT_LIST_HEAD(&hse->hpp.list); |
1159 | INIT_LIST_HEAD(&hse->hpp.sort_list); | 1159 | INIT_LIST_HEAD(&hse->hpp.sort_list); |
1160 | hse->hpp.elide = false; | ||
1160 | 1161 | ||
1161 | return hse; | 1162 | return hse; |
1162 | } | 1163 | } |
@@ -1364,27 +1365,64 @@ static int __setup_sorting(void) | |||
1364 | return ret; | 1365 | return ret; |
1365 | } | 1366 | } |
1366 | 1367 | ||
1367 | bool perf_hpp__should_skip(struct perf_hpp_fmt *format) | 1368 | void perf_hpp__set_elide(int idx, bool elide) |
1368 | { | 1369 | { |
1369 | if (perf_hpp__is_sort_entry(format)) { | 1370 | struct perf_hpp_fmt *fmt; |
1370 | struct hpp_sort_entry *hse; | 1371 | struct hpp_sort_entry *hse; |
1371 | 1372 | ||
1372 | hse = container_of(format, struct hpp_sort_entry, hpp); | 1373 | perf_hpp__for_each_format(fmt) { |
1373 | return hse->se->elide; | 1374 | if (!perf_hpp__is_sort_entry(fmt)) |
1375 | continue; | ||
1376 | |||
1377 | hse = container_of(fmt, struct hpp_sort_entry, hpp); | ||
1378 | if (hse->se->se_width_idx == idx) { | ||
1379 | fmt->elide = elide; | ||
1380 | break; | ||
1381 | } | ||
1374 | } | 1382 | } |
1375 | return false; | ||
1376 | } | 1383 | } |
1377 | 1384 | ||
1378 | static void sort_entry__setup_elide(struct sort_entry *se, | 1385 | static bool __get_elide(struct strlist *list, const char *list_name, FILE *fp) |
1379 | struct strlist *list, | ||
1380 | const char *list_name, FILE *fp) | ||
1381 | { | 1386 | { |
1382 | if (list && strlist__nr_entries(list) == 1) { | 1387 | if (list && strlist__nr_entries(list) == 1) { |
1383 | if (fp != NULL) | 1388 | if (fp != NULL) |
1384 | fprintf(fp, "# %s: %s\n", list_name, | 1389 | fprintf(fp, "# %s: %s\n", list_name, |
1385 | strlist__entry(list, 0)->s); | 1390 | strlist__entry(list, 0)->s); |
1386 | se->elide = true; | 1391 | return true; |
1392 | } | ||
1393 | return false; | ||
1394 | } | ||
1395 | |||
1396 | static bool get_elide(int idx, FILE *output) | ||
1397 | { | ||
1398 | switch (idx) { | ||
1399 | case HISTC_SYMBOL: | ||
1400 | return __get_elide(symbol_conf.sym_list, "symbol", output); | ||
1401 | case HISTC_DSO: | ||
1402 | return __get_elide(symbol_conf.dso_list, "dso", output); | ||
1403 | case HISTC_COMM: | ||
1404 | return __get_elide(symbol_conf.comm_list, "comm", output); | ||
1405 | default: | ||
1406 | break; | ||
1387 | } | 1407 | } |
1408 | |||
1409 | if (sort__mode != SORT_MODE__BRANCH) | ||
1410 | return false; | ||
1411 | |||
1412 | switch (idx) { | ||
1413 | case HISTC_SYMBOL_FROM: | ||
1414 | return __get_elide(symbol_conf.sym_from_list, "sym_from", output); | ||
1415 | case HISTC_SYMBOL_TO: | ||
1416 | return __get_elide(symbol_conf.sym_to_list, "sym_to", output); | ||
1417 | case HISTC_DSO_FROM: | ||
1418 | return __get_elide(symbol_conf.dso_from_list, "dso_from", output); | ||
1419 | case HISTC_DSO_TO: | ||
1420 | return __get_elide(symbol_conf.dso_to_list, "dso_to", output); | ||
1421 | default: | ||
1422 | break; | ||
1423 | } | ||
1424 | |||
1425 | return false; | ||
1388 | } | 1426 | } |
1389 | 1427 | ||
1390 | void sort__setup_elide(FILE *output) | 1428 | void sort__setup_elide(FILE *output) |
@@ -1392,39 +1430,12 @@ void sort__setup_elide(FILE *output) | |||
1392 | struct perf_hpp_fmt *fmt; | 1430 | struct perf_hpp_fmt *fmt; |
1393 | struct hpp_sort_entry *hse; | 1431 | struct hpp_sort_entry *hse; |
1394 | 1432 | ||
1395 | sort_entry__setup_elide(&sort_dso, symbol_conf.dso_list, | 1433 | perf_hpp__for_each_format(fmt) { |
1396 | "dso", output); | 1434 | if (!perf_hpp__is_sort_entry(fmt)) |
1397 | sort_entry__setup_elide(&sort_comm, symbol_conf.comm_list, | 1435 | continue; |
1398 | "comm", output); | 1436 | |
1399 | sort_entry__setup_elide(&sort_sym, symbol_conf.sym_list, | 1437 | hse = container_of(fmt, struct hpp_sort_entry, hpp); |
1400 | "symbol", output); | 1438 | fmt->elide = get_elide(hse->se->se_width_idx, output); |
1401 | |||
1402 | if (sort__mode == SORT_MODE__BRANCH) { | ||
1403 | sort_entry__setup_elide(&sort_dso_from, | ||
1404 | symbol_conf.dso_from_list, | ||
1405 | "dso_from", output); | ||
1406 | sort_entry__setup_elide(&sort_dso_to, | ||
1407 | symbol_conf.dso_to_list, | ||
1408 | "dso_to", output); | ||
1409 | sort_entry__setup_elide(&sort_sym_from, | ||
1410 | symbol_conf.sym_from_list, | ||
1411 | "sym_from", output); | ||
1412 | sort_entry__setup_elide(&sort_sym_to, | ||
1413 | symbol_conf.sym_to_list, | ||
1414 | "sym_to", output); | ||
1415 | } else if (sort__mode == SORT_MODE__MEMORY) { | ||
1416 | sort_entry__setup_elide(&sort_dso, symbol_conf.dso_list, | ||
1417 | "symbol_daddr", output); | ||
1418 | sort_entry__setup_elide(&sort_dso, symbol_conf.dso_list, | ||
1419 | "dso_daddr", output); | ||
1420 | sort_entry__setup_elide(&sort_dso, symbol_conf.dso_list, | ||
1421 | "mem", output); | ||
1422 | sort_entry__setup_elide(&sort_dso, symbol_conf.dso_list, | ||
1423 | "local_weight", output); | ||
1424 | sort_entry__setup_elide(&sort_dso, symbol_conf.dso_list, | ||
1425 | "tlb", output); | ||
1426 | sort_entry__setup_elide(&sort_dso, symbol_conf.dso_list, | ||
1427 | "snoop", output); | ||
1428 | } | 1439 | } |
1429 | 1440 | ||
1430 | /* | 1441 | /* |
@@ -1435,8 +1446,7 @@ void sort__setup_elide(FILE *output) | |||
1435 | if (!perf_hpp__is_sort_entry(fmt)) | 1446 | if (!perf_hpp__is_sort_entry(fmt)) |
1436 | continue; | 1447 | continue; |
1437 | 1448 | ||
1438 | hse = container_of(fmt, struct hpp_sort_entry, hpp); | 1449 | if (!fmt->elide) |
1439 | if (!hse->se->elide) | ||
1440 | return; | 1450 | return; |
1441 | } | 1451 | } |
1442 | 1452 | ||
@@ -1444,8 +1454,7 @@ void sort__setup_elide(FILE *output) | |||
1444 | if (!perf_hpp__is_sort_entry(fmt)) | 1454 | if (!perf_hpp__is_sort_entry(fmt)) |
1445 | continue; | 1455 | continue; |
1446 | 1456 | ||
1447 | hse = container_of(fmt, struct hpp_sort_entry, hpp); | 1457 | fmt->elide = false; |
1448 | hse->se->elide = false; | ||
1449 | } | 1458 | } |
1450 | } | 1459 | } |
1451 | 1460 | ||
diff --git a/tools/perf/util/sort.h b/tools/perf/util/sort.h index 426b873e16ff..5bf0098d6b06 100644 --- a/tools/perf/util/sort.h +++ b/tools/perf/util/sort.h | |||
@@ -202,7 +202,6 @@ struct sort_entry { | |||
202 | int (*se_snprintf)(struct hist_entry *he, char *bf, size_t size, | 202 | int (*se_snprintf)(struct hist_entry *he, char *bf, size_t size, |
203 | unsigned int width); | 203 | unsigned int width); |
204 | u8 se_width_idx; | 204 | u8 se_width_idx; |
205 | bool elide; | ||
206 | }; | 205 | }; |
207 | 206 | ||
208 | extern struct sort_entry sort_thread; | 207 | extern struct sort_entry sort_thread; |
@@ -213,6 +212,7 @@ int setup_output_field(void); | |||
213 | void reset_output_field(void); | 212 | void reset_output_field(void); |
214 | extern int sort_dimension__add(const char *); | 213 | extern int sort_dimension__add(const char *); |
215 | void sort__setup_elide(FILE *fp); | 214 | void sort__setup_elide(FILE *fp); |
215 | void perf_hpp__set_elide(int idx, bool elide); | ||
216 | 216 | ||
217 | int report_parse_ignore_callees_opt(const struct option *opt, const char *arg, int unset); | 217 | int report_parse_ignore_callees_opt(const struct option *opt, const char *arg, int unset); |
218 | 218 | ||