aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2015-11-13 04:10:45 -0500
committerIngo Molnar <mingo@kernel.org>2015-11-13 04:10:45 -0500
commit2a49f02a7580d23802ea0e16ceb6d5523ab21aa8 (patch)
tree04b96518a95e0e43df054a7b81806e52ec2407e2
parent41ac18ebfc429ce3f4d369ef07447d652999a0cd (diff)
parent2059fc7a5a9e667797b8ec503bfb4685afee48d8 (diff)
Merge tag 'perf-urgent-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
Pull perf/urgent fixes from Arnaldo Carvalho de Melo: - Fix 'd' hotkey for filtering by DSO in the top/report TUI browser (Arnaldo Carvalho de Melo) - Allow forcing reading of non-root owned /tmp/perf-PID JIT symbol maps (Arnaldo Carvalho de Melo) - Rebuild rbtree when adjusting symbols for kcore (Adrian Hunter) - Actually install tmon in the tools/ install rule (Kamal Mostafa) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--tools/Makefile11
-rw-r--r--tools/perf/builtin-report.c6
-rw-r--r--tools/perf/ui/browsers/hists.c7
-rw-r--r--tools/perf/util/symbol.c34
-rw-r--r--tools/perf/util/symbol.h1
5 files changed, 31 insertions, 28 deletions
diff --git a/tools/Makefile b/tools/Makefile
index d6f307dfb1a3..7dc820a8c1f1 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -32,6 +32,10 @@ help:
32 @echo ' from the kernel command line to build and install one of' 32 @echo ' from the kernel command line to build and install one of'
33 @echo ' the tools above' 33 @echo ' the tools above'
34 @echo '' 34 @echo ''
35 @echo ' $$ make tools/all'
36 @echo ''
37 @echo ' builds all tools.'
38 @echo ''
35 @echo ' $$ make tools/install' 39 @echo ' $$ make tools/install'
36 @echo '' 40 @echo ''
37 @echo ' installs all tools.' 41 @echo ' installs all tools.'
@@ -77,6 +81,11 @@ tmon: FORCE
77freefall: FORCE 81freefall: FORCE
78 $(call descend,laptop/$@) 82 $(call descend,laptop/$@)
79 83
84all: acpi cgroup cpupower hv firewire lguest \
85 perf selftests turbostat usb \
86 virtio vm net x86_energy_perf_policy \
87 tmon freefall
88
80acpi_install: 89acpi_install:
81 $(call descend,power/$(@:_install=),install) 90 $(call descend,power/$(@:_install=),install)
82 91
@@ -101,7 +110,7 @@ freefall_install:
101install: acpi_install cgroup_install cpupower_install hv_install firewire_install lguest_install \ 110install: acpi_install cgroup_install cpupower_install hv_install firewire_install lguest_install \
102 perf_install selftests_install turbostat_install usb_install \ 111 perf_install selftests_install turbostat_install usb_install \
103 virtio_install vm_install net_install x86_energy_perf_policy_install \ 112 virtio_install vm_install net_install x86_energy_perf_policy_install \
104 tmon freefall_install 113 tmon_install freefall_install
105 114
106acpi_clean: 115acpi_clean:
107 $(call descend,power/acpi,clean) 116 $(call descend,power/acpi,clean)
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 2853ad2bd435..f256fac1e722 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -44,7 +44,7 @@
44struct report { 44struct report {
45 struct perf_tool tool; 45 struct perf_tool tool;
46 struct perf_session *session; 46 struct perf_session *session;
47 bool force, use_tui, use_gtk, use_stdio; 47 bool use_tui, use_gtk, use_stdio;
48 bool hide_unresolved; 48 bool hide_unresolved;
49 bool dont_use_callchains; 49 bool dont_use_callchains;
50 bool show_full_info; 50 bool show_full_info;
@@ -678,7 +678,7 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
678 "file", "vmlinux pathname"), 678 "file", "vmlinux pathname"),
679 OPT_STRING(0, "kallsyms", &symbol_conf.kallsyms_name, 679 OPT_STRING(0, "kallsyms", &symbol_conf.kallsyms_name,
680 "file", "kallsyms pathname"), 680 "file", "kallsyms pathname"),
681 OPT_BOOLEAN('f', "force", &report.force, "don't complain, do it"), 681 OPT_BOOLEAN('f', "force", &symbol_conf.force, "don't complain, do it"),
682 OPT_BOOLEAN('m', "modules", &symbol_conf.use_modules, 682 OPT_BOOLEAN('m', "modules", &symbol_conf.use_modules,
683 "load module symbols - WARNING: use only with -k and LIVE kernel"), 683 "load module symbols - WARNING: use only with -k and LIVE kernel"),
684 OPT_BOOLEAN('n', "show-nr-samples", &symbol_conf.show_nr_samples, 684 OPT_BOOLEAN('n', "show-nr-samples", &symbol_conf.show_nr_samples,
@@ -832,7 +832,7 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
832 } 832 }
833 833
834 file.path = input_name; 834 file.path = input_name;
835 file.force = report.force; 835 file.force = symbol_conf.force;
836 836
837repeat: 837repeat:
838 session = perf_session__new(&file, false, &report.tool); 838 session = perf_session__new(&file, false, &report.tool);
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index e5afb8936040..fa9eb92c9e24 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -1430,7 +1430,6 @@ close_file_and_continue:
1430 1430
1431struct popup_action { 1431struct popup_action {
1432 struct thread *thread; 1432 struct thread *thread;
1433 struct dso *dso;
1434 struct map_symbol ms; 1433 struct map_symbol ms;
1435 int socket; 1434 int socket;
1436 1435
@@ -1565,7 +1564,6 @@ add_dso_opt(struct hist_browser *browser, struct popup_action *act,
1565 return 0; 1564 return 0;
1566 1565
1567 act->ms.map = map; 1566 act->ms.map = map;
1568 act->dso = map->dso;
1569 act->fn = do_zoom_dso; 1567 act->fn = do_zoom_dso;
1570 return 1; 1568 return 1;
1571} 1569}
@@ -1827,7 +1825,6 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
1827 1825
1828 while (1) { 1826 while (1) {
1829 struct thread *thread = NULL; 1827 struct thread *thread = NULL;
1830 struct dso *dso = NULL;
1831 struct map *map = NULL; 1828 struct map *map = NULL;
1832 int choice = 0; 1829 int choice = 0;
1833 int socked_id = -1; 1830 int socked_id = -1;
@@ -1839,8 +1836,6 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
1839 if (browser->he_selection != NULL) { 1836 if (browser->he_selection != NULL) {
1840 thread = hist_browser__selected_thread(browser); 1837 thread = hist_browser__selected_thread(browser);
1841 map = browser->selection->map; 1838 map = browser->selection->map;
1842 if (map)
1843 dso = map->dso;
1844 socked_id = browser->he_selection->socket; 1839 socked_id = browser->he_selection->socket;
1845 } 1840 }
1846 switch (key) { 1841 switch (key) {
@@ -1874,7 +1869,7 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
1874 hist_browser__dump(browser); 1869 hist_browser__dump(browser);
1875 continue; 1870 continue;
1876 case 'd': 1871 case 'd':
1877 actions->dso = dso; 1872 actions->ms.map = map;
1878 do_zoom_dso(browser, actions); 1873 do_zoom_dso(browser, actions);
1879 continue; 1874 continue;
1880 case 'V': 1875 case 'V':
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index b4cc7662677e..cd08027a6d2c 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -654,19 +654,24 @@ static int dso__split_kallsyms_for_kcore(struct dso *dso, struct map *map,
654 struct map_groups *kmaps = map__kmaps(map); 654 struct map_groups *kmaps = map__kmaps(map);
655 struct map *curr_map; 655 struct map *curr_map;
656 struct symbol *pos; 656 struct symbol *pos;
657 int count = 0, moved = 0; 657 int count = 0;
658 struct rb_root old_root = dso->symbols[map->type];
658 struct rb_root *root = &dso->symbols[map->type]; 659 struct rb_root *root = &dso->symbols[map->type];
659 struct rb_node *next = rb_first(root); 660 struct rb_node *next = rb_first(root);
660 661
661 if (!kmaps) 662 if (!kmaps)
662 return -1; 663 return -1;
663 664
665 *root = RB_ROOT;
666
664 while (next) { 667 while (next) {
665 char *module; 668 char *module;
666 669
667 pos = rb_entry(next, struct symbol, rb_node); 670 pos = rb_entry(next, struct symbol, rb_node);
668 next = rb_next(&pos->rb_node); 671 next = rb_next(&pos->rb_node);
669 672
673 rb_erase_init(&pos->rb_node, &old_root);
674
670 module = strchr(pos->name, '\t'); 675 module = strchr(pos->name, '\t');
671 if (module) 676 if (module)
672 *module = '\0'; 677 *module = '\0';
@@ -674,28 +679,21 @@ static int dso__split_kallsyms_for_kcore(struct dso *dso, struct map *map,
674 curr_map = map_groups__find(kmaps, map->type, pos->start); 679 curr_map = map_groups__find(kmaps, map->type, pos->start);
675 680
676 if (!curr_map || (filter && filter(curr_map, pos))) { 681 if (!curr_map || (filter && filter(curr_map, pos))) {
677 rb_erase_init(&pos->rb_node, root);
678 symbol__delete(pos); 682 symbol__delete(pos);
679 } else { 683 continue;
680 pos->start -= curr_map->start - curr_map->pgoff;
681 if (pos->end)
682 pos->end -= curr_map->start - curr_map->pgoff;
683 if (curr_map->dso != map->dso) {
684 rb_erase_init(&pos->rb_node, root);
685 symbols__insert(
686 &curr_map->dso->symbols[curr_map->type],
687 pos);
688 ++moved;
689 } else {
690 ++count;
691 }
692 } 684 }
685
686 pos->start -= curr_map->start - curr_map->pgoff;
687 if (pos->end)
688 pos->end -= curr_map->start - curr_map->pgoff;
689 symbols__insert(&curr_map->dso->symbols[curr_map->type], pos);
690 ++count;
693 } 691 }
694 692
695 /* Symbols have been adjusted */ 693 /* Symbols have been adjusted */
696 dso->adjust_symbols = 1; 694 dso->adjust_symbols = 1;
697 695
698 return count + moved; 696 return count;
699} 697}
700 698
701/* 699/*
@@ -1438,9 +1436,9 @@ int dso__load(struct dso *dso, struct map *map, symbol_filter_t filter)
1438 if (lstat(dso->name, &st) < 0) 1436 if (lstat(dso->name, &st) < 0)
1439 goto out; 1437 goto out;
1440 1438
1441 if (st.st_uid && (st.st_uid != geteuid())) { 1439 if (!symbol_conf.force && st.st_uid && (st.st_uid != geteuid())) {
1442 pr_warning("File %s not owned by current user or root, " 1440 pr_warning("File %s not owned by current user or root, "
1443 "ignoring it.\n", dso->name); 1441 "ignoring it (use -f to override).\n", dso->name);
1444 goto out; 1442 goto out;
1445 } 1443 }
1446 1444
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index 40073c60b83d..dcd786e364f2 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -84,6 +84,7 @@ struct symbol_conf {
84 unsigned short priv_size; 84 unsigned short priv_size;
85 unsigned short nr_events; 85 unsigned short nr_events;
86 bool try_vmlinux_path, 86 bool try_vmlinux_path,
87 force,
87 ignore_vmlinux, 88 ignore_vmlinux,
88 ignore_vmlinux_buildid, 89 ignore_vmlinux_buildid,
89 show_kernel_path, 90 show_kernel_path,