Skip to content

Commit

Permalink
Merge tag 'perf-urgent-for-mingo' of git://git.kernel.org/pub/scm/lin…
Browse files Browse the repository at this point in the history
…ux/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>
  • Loading branch information
Ingo Molnar committed Nov 13, 2015
2 parents 41ac18e + 2059fc7 commit 2a49f02
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 28 deletions.
11 changes: 10 additions & 1 deletion tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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.'
Expand Down Expand Up @@ -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)

Expand All @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions tools/perf/builtin-report.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand Down
7 changes: 1 addition & 6 deletions tools/perf/ui/browsers/hists.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand All @@ -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) {
Expand Down Expand Up @@ -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':
Expand Down
34 changes: 16 additions & 18 deletions tools/perf/util/symbol.c
Original file line number Diff line number Diff line change
Expand Up @@ -654,48 +654,46 @@ 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';

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;
}

/*
Expand Down Expand Up @@ -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;
}

Expand Down
1 change: 1 addition & 0 deletions tools/perf/util/symbol.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 2a49f02

Please sign in to comment.