mirror of https://gitee.com/openkylin/linux.git
perf/urgent fixes:
- 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> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABAgAGBQJWRRhnAAoJENZQFvNTUqpAbugQAIkqcdvr9uYlCZA7HddP6fzw gJ4llH/583jnnOz9Z1qaLmn8WNtR1CCbOrRnu1gO6pTMxqNpA3/nft2K+2Ii3xDx FB4EcgiQboaJUlBLeg9TpKtG0ySjfUgNgGGwgyeiRhqQZvFFb9iNHHDVHJ2nEadb t4M/r0p+TczD/stbgwjqGnTNUR/e9BjPL9W5+b8LLlGvNP/574OKY5Sfh+dSN73q SqX7PrGJwcSK6C/JtwfvDCAmbXJSLeRJcji5J/8FYMaH9OxwewFMyLB57REbm93u VdCw9XI600sJLOyVM64DtARXoCfKreJxLB37cseFFHbkxwG01hO+FV9y2rvAg7eu BrpDsHy1FgaBXnM9rZbH6oUpqvuQzbzz+/sxvLz7OwDBPdE2olFAJehYMmDJ4OmV R84SSW80Wj31ehu1b0Sl43L7ePMuH1JYil6m1lQW0evIF8fxgPMEv0f2g7UhYcP6 HB/GhuLAsiLhuzOVk8FNi6hiyff0ftIKLwBjKcBeRDq1S102EvROjM51TyCwC5EC UQL2eEKoHz36VVaa7Ew4voFMTxxD3N8Sln7o7jL++SUVXFp9bmRspD6WbnugmwYP HdzuIh0xdm4FBPXIZacV6lJkN+vAM3UnXUWhwZRHsewnJm/YcM4c6Rp7tEbcj1FV NBTY6WgX+/nznAcZETlB =iVw0 -----END PGP SIGNATURE----- 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>
This commit is contained in:
commit
2a49f02a75
|
@ -32,6 +32,10 @@ help:
|
|||
@echo ' from the kernel command line to build and install one of'
|
||||
@echo ' the tools above'
|
||||
@echo ''
|
||||
@echo ' $$ make tools/all'
|
||||
@echo ''
|
||||
@echo ' builds all tools.'
|
||||
@echo ''
|
||||
@echo ' $$ make tools/install'
|
||||
@echo ''
|
||||
@echo ' installs all tools.'
|
||||
|
@ -77,6 +81,11 @@ tmon: FORCE
|
|||
freefall: FORCE
|
||||
$(call descend,laptop/$@)
|
||||
|
||||
all: acpi cgroup cpupower hv firewire lguest \
|
||||
perf selftests turbostat usb \
|
||||
virtio vm net x86_energy_perf_policy \
|
||||
tmon freefall
|
||||
|
||||
acpi_install:
|
||||
$(call descend,power/$(@:_install=),install)
|
||||
|
||||
|
@ -101,7 +110,7 @@ freefall_install:
|
|||
install: acpi_install cgroup_install cpupower_install hv_install firewire_install lguest_install \
|
||||
perf_install selftests_install turbostat_install usb_install \
|
||||
virtio_install vm_install net_install x86_energy_perf_policy_install \
|
||||
tmon freefall_install
|
||||
tmon_install freefall_install
|
||||
|
||||
acpi_clean:
|
||||
$(call descend,power/acpi,clean)
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
struct report {
|
||||
struct perf_tool tool;
|
||||
struct perf_session *session;
|
||||
bool force, use_tui, use_gtk, use_stdio;
|
||||
bool use_tui, use_gtk, use_stdio;
|
||||
bool hide_unresolved;
|
||||
bool dont_use_callchains;
|
||||
bool show_full_info;
|
||||
|
@ -678,7 +678,7 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
|
|||
"file", "vmlinux pathname"),
|
||||
OPT_STRING(0, "kallsyms", &symbol_conf.kallsyms_name,
|
||||
"file", "kallsyms pathname"),
|
||||
OPT_BOOLEAN('f', "force", &report.force, "don't complain, do it"),
|
||||
OPT_BOOLEAN('f', "force", &symbol_conf.force, "don't complain, do it"),
|
||||
OPT_BOOLEAN('m', "modules", &symbol_conf.use_modules,
|
||||
"load module symbols - WARNING: use only with -k and LIVE kernel"),
|
||||
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)
|
|||
}
|
||||
|
||||
file.path = input_name;
|
||||
file.force = report.force;
|
||||
file.force = symbol_conf.force;
|
||||
|
||||
repeat:
|
||||
session = perf_session__new(&file, false, &report.tool);
|
||||
|
|
|
@ -1430,7 +1430,6 @@ static int switch_data_file(void)
|
|||
|
||||
struct popup_action {
|
||||
struct thread *thread;
|
||||
struct dso *dso;
|
||||
struct map_symbol ms;
|
||||
int socket;
|
||||
|
||||
|
@ -1565,7 +1564,6 @@ add_dso_opt(struct hist_browser *browser, struct popup_action *act,
|
|||
return 0;
|
||||
|
||||
act->ms.map = map;
|
||||
act->dso = map->dso;
|
||||
act->fn = do_zoom_dso;
|
||||
return 1;
|
||||
}
|
||||
|
@ -1827,7 +1825,6 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
|
|||
|
||||
while (1) {
|
||||
struct thread *thread = NULL;
|
||||
struct dso *dso = NULL;
|
||||
struct map *map = NULL;
|
||||
int choice = 0;
|
||||
int socked_id = -1;
|
||||
|
@ -1839,8 +1836,6 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
|
|||
if (browser->he_selection != NULL) {
|
||||
thread = hist_browser__selected_thread(browser);
|
||||
map = browser->selection->map;
|
||||
if (map)
|
||||
dso = map->dso;
|
||||
socked_id = browser->he_selection->socket;
|
||||
}
|
||||
switch (key) {
|
||||
|
@ -1874,7 +1869,7 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
|
|||
hist_browser__dump(browser);
|
||||
continue;
|
||||
case 'd':
|
||||
actions->dso = dso;
|
||||
actions->ms.map = map;
|
||||
do_zoom_dso(browser, actions);
|
||||
continue;
|
||||
case 'V':
|
||||
|
|
|
@ -654,19 +654,24 @@ static int dso__split_kallsyms_for_kcore(struct dso *dso, struct map *map,
|
|||
struct map_groups *kmaps = map__kmaps(map);
|
||||
struct map *curr_map;
|
||||
struct symbol *pos;
|
||||
int count = 0, moved = 0;
|
||||
int count = 0;
|
||||
struct rb_root old_root = dso->symbols[map->type];
|
||||
struct rb_root *root = &dso->symbols[map->type];
|
||||
struct rb_node *next = rb_first(root);
|
||||
|
||||
if (!kmaps)
|
||||
return -1;
|
||||
|
||||
*root = RB_ROOT;
|
||||
|
||||
while (next) {
|
||||
char *module;
|
||||
|
||||
pos = rb_entry(next, struct symbol, rb_node);
|
||||
next = rb_next(&pos->rb_node);
|
||||
|
||||
rb_erase_init(&pos->rb_node, &old_root);
|
||||
|
||||
module = strchr(pos->name, '\t');
|
||||
if (module)
|
||||
*module = '\0';
|
||||
|
@ -674,28 +679,21 @@ static int dso__split_kallsyms_for_kcore(struct dso *dso, struct map *map,
|
|||
curr_map = map_groups__find(kmaps, map->type, pos->start);
|
||||
|
||||
if (!curr_map || (filter && filter(curr_map, pos))) {
|
||||
rb_erase_init(&pos->rb_node, root);
|
||||
symbol__delete(pos);
|
||||
} else {
|
||||
pos->start -= curr_map->start - curr_map->pgoff;
|
||||
if (pos->end)
|
||||
pos->end -= curr_map->start - curr_map->pgoff;
|
||||
if (curr_map->dso != map->dso) {
|
||||
rb_erase_init(&pos->rb_node, root);
|
||||
symbols__insert(
|
||||
&curr_map->dso->symbols[curr_map->type],
|
||||
pos);
|
||||
++moved;
|
||||
} else {
|
||||
++count;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
pos->start -= curr_map->start - curr_map->pgoff;
|
||||
if (pos->end)
|
||||
pos->end -= curr_map->start - curr_map->pgoff;
|
||||
symbols__insert(&curr_map->dso->symbols[curr_map->type], pos);
|
||||
++count;
|
||||
}
|
||||
|
||||
/* Symbols have been adjusted */
|
||||
dso->adjust_symbols = 1;
|
||||
|
||||
return count + moved;
|
||||
return count;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1438,9 +1436,9 @@ int dso__load(struct dso *dso, struct map *map, symbol_filter_t filter)
|
|||
if (lstat(dso->name, &st) < 0)
|
||||
goto out;
|
||||
|
||||
if (st.st_uid && (st.st_uid != geteuid())) {
|
||||
if (!symbol_conf.force && st.st_uid && (st.st_uid != geteuid())) {
|
||||
pr_warning("File %s not owned by current user or root, "
|
||||
"ignoring it.\n", dso->name);
|
||||
"ignoring it (use -f to override).\n", dso->name);
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
|
|
@ -84,6 +84,7 @@ struct symbol_conf {
|
|||
unsigned short priv_size;
|
||||
unsigned short nr_events;
|
||||
bool try_vmlinux_path,
|
||||
force,
|
||||
ignore_vmlinux,
|
||||
ignore_vmlinux_buildid,
|
||||
show_kernel_path,
|
||||
|
|
Loading…
Reference in New Issue