Skip to content

Commit 2a49f02

Browse files
author
Ingo Molnar
committed
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 <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
2 parents 41ac18e + 2059fc7 commit 2a49f02

File tree

5 files changed

+31
-28
lines changed

5 files changed

+31
-28
lines changed

tools/Makefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ help:
3232
@echo ' from the kernel command line to build and install one of'
3333
@echo ' the tools above'
3434
@echo ''
35+
@echo ' $$ make tools/all'
36+
@echo ''
37+
@echo ' builds all tools.'
38+
@echo ''
3539
@echo ' $$ make tools/install'
3640
@echo ''
3741
@echo ' installs all tools.'
@@ -77,6 +81,11 @@ tmon: FORCE
7781
freefall: FORCE
7882
$(call descend,laptop/$@)
7983

84+
all: acpi cgroup cpupower hv firewire lguest \
85+
perf selftests turbostat usb \
86+
virtio vm net x86_energy_perf_policy \
87+
tmon freefall
88+
8089
acpi_install:
8190
$(call descend,power/$(@:_install=),install)
8291

@@ -101,7 +110,7 @@ freefall_install:
101110
install: acpi_install cgroup_install cpupower_install hv_install firewire_install lguest_install \
102111
perf_install selftests_install turbostat_install usb_install \
103112
virtio_install vm_install net_install x86_energy_perf_policy_install \
104-
tmon freefall_install
113+
tmon_install freefall_install
105114

106115
acpi_clean:
107116
$(call descend,power/acpi,clean)

tools/perf/builtin-report.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
struct report {
4545
struct perf_tool tool;
4646
struct perf_session *session;
47-
bool force, use_tui, use_gtk, use_stdio;
47+
bool use_tui, use_gtk, use_stdio;
4848
bool hide_unresolved;
4949
bool dont_use_callchains;
5050
bool show_full_info;
@@ -678,7 +678,7 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
678678
"file", "vmlinux pathname"),
679679
OPT_STRING(0, "kallsyms", &symbol_conf.kallsyms_name,
680680
"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"),
682682
OPT_BOOLEAN('m', "modules", &symbol_conf.use_modules,
683683
"load module symbols - WARNING: use only with -k and LIVE kernel"),
684684
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)
832832
}
833833

834834
file.path = input_name;
835-
file.force = report.force;
835+
file.force = symbol_conf.force;
836836

837837
repeat:
838838
session = perf_session__new(&file, false, &report.tool);

tools/perf/ui/browsers/hists.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1430,7 +1430,6 @@ static int switch_data_file(void)
14301430

14311431
struct popup_action {
14321432
struct thread *thread;
1433-
struct dso *dso;
14341433
struct map_symbol ms;
14351434
int socket;
14361435

@@ -1565,7 +1564,6 @@ add_dso_opt(struct hist_browser *browser, struct popup_action *act,
15651564
return 0;
15661565

15671566
act->ms.map = map;
1568-
act->dso = map->dso;
15691567
act->fn = do_zoom_dso;
15701568
return 1;
15711569
}
@@ -1827,7 +1825,6 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
18271825

18281826
while (1) {
18291827
struct thread *thread = NULL;
1830-
struct dso *dso = NULL;
18311828
struct map *map = NULL;
18321829
int choice = 0;
18331830
int socked_id = -1;
@@ -1839,8 +1836,6 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
18391836
if (browser->he_selection != NULL) {
18401837
thread = hist_browser__selected_thread(browser);
18411838
map = browser->selection->map;
1842-
if (map)
1843-
dso = map->dso;
18441839
socked_id = browser->he_selection->socket;
18451840
}
18461841
switch (key) {
@@ -1874,7 +1869,7 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
18741869
hist_browser__dump(browser);
18751870
continue;
18761871
case 'd':
1877-
actions->dso = dso;
1872+
actions->ms.map = map;
18781873
do_zoom_dso(browser, actions);
18791874
continue;
18801875
case 'V':

tools/perf/util/symbol.c

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -654,48 +654,46 @@ static int dso__split_kallsyms_for_kcore(struct dso *dso, struct map *map,
654654
struct map_groups *kmaps = map__kmaps(map);
655655
struct map *curr_map;
656656
struct symbol *pos;
657-
int count = 0, moved = 0;
657+
int count = 0;
658+
struct rb_root old_root = dso->symbols[map->type];
658659
struct rb_root *root = &dso->symbols[map->type];
659660
struct rb_node *next = rb_first(root);
660661

661662
if (!kmaps)
662663
return -1;
663664

665+
*root = RB_ROOT;
666+
664667
while (next) {
665668
char *module;
666669

667670
pos = rb_entry(next, struct symbol, rb_node);
668671
next = rb_next(&pos->rb_node);
669672

673+
rb_erase_init(&pos->rb_node, &old_root);
674+
670675
module = strchr(pos->name, '\t');
671676
if (module)
672677
*module = '\0';
673678

674679
curr_map = map_groups__find(kmaps, map->type, pos->start);
675680

676681
if (!curr_map || (filter && filter(curr_map, pos))) {
677-
rb_erase_init(&pos->rb_node, root);
678682
symbol__delete(pos);
679-
} else {
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-
}
683+
continue;
692684
}
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;
693691
}
694692

695693
/* Symbols have been adjusted */
696694
dso->adjust_symbols = 1;
697695

698-
return count + moved;
696+
return count;
699697
}
700698

701699
/*
@@ -1438,9 +1436,9 @@ int dso__load(struct dso *dso, struct map *map, symbol_filter_t filter)
14381436
if (lstat(dso->name, &st) < 0)
14391437
goto out;
14401438

1441-
if (st.st_uid && (st.st_uid != geteuid())) {
1439+
if (!symbol_conf.force && st.st_uid && (st.st_uid != geteuid())) {
14421440
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);
14441442
goto out;
14451443
}
14461444

tools/perf/util/symbol.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ struct symbol_conf {
8484
unsigned short priv_size;
8585
unsigned short nr_events;
8686
bool try_vmlinux_path,
87+
force,
8788
ignore_vmlinux,
8889
ignore_vmlinux_buildid,
8990
show_kernel_path,

0 commit comments

Comments
 (0)