diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/Makefile | 11 | ||||
-rw-r--r-- | tools/net/Makefile | 7 | ||||
-rw-r--r-- | tools/perf/builtin-inject.c | 1 | ||||
-rw-r--r-- | tools/perf/builtin-report.c | 6 | ||||
-rw-r--r-- | tools/perf/ui/browsers/hists.c | 7 | ||||
-rw-r--r-- | tools/perf/util/build-id.c | 1 | ||||
-rw-r--r-- | tools/perf/util/dso.c | 17 | ||||
-rw-r--r-- | tools/perf/util/dso.h | 1 | ||||
-rw-r--r-- | tools/perf/util/machine.c | 1 | ||||
-rw-r--r-- | tools/perf/util/probe-finder.c | 24 | ||||
-rw-r--r-- | tools/perf/util/symbol.c | 34 | ||||
-rw-r--r-- | tools/perf/util/symbol.h | 1 | ||||
-rw-r--r-- | tools/power/x86/turbostat/turbostat.c | 8 | ||||
-rw-r--r-- | tools/vm/page-types.c | 1 |
14 files changed, 78 insertions, 42 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 | |||
77 | freefall: FORCE | 81 | freefall: FORCE |
78 | $(call descend,laptop/$@) | 82 | $(call descend,laptop/$@) |
79 | 83 | ||
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 | |||
80 | acpi_install: | 89 | acpi_install: |
81 | $(call descend,power/$(@:_install=),install) | 90 | $(call descend,power/$(@:_install=),install) |
82 | 91 | ||
@@ -101,7 +110,7 @@ freefall_install: | |||
101 | install: acpi_install cgroup_install cpupower_install hv_install firewire_install lguest_install \ | 110 | install: 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 | ||
106 | acpi_clean: | 115 | acpi_clean: |
107 | $(call descend,power/acpi,clean) | 116 | $(call descend,power/acpi,clean) |
diff --git a/tools/net/Makefile b/tools/net/Makefile index ee577ea03ba5..ddf888010652 100644 --- a/tools/net/Makefile +++ b/tools/net/Makefile | |||
@@ -4,6 +4,9 @@ CC = gcc | |||
4 | LEX = flex | 4 | LEX = flex |
5 | YACC = bison | 5 | YACC = bison |
6 | 6 | ||
7 | CFLAGS += -Wall -O2 | ||
8 | CFLAGS += -D__EXPORTED_HEADERS__ -I../../include/uapi -I../../include | ||
9 | |||
7 | %.yacc.c: %.y | 10 | %.yacc.c: %.y |
8 | $(YACC) -o $@ -d $< | 11 | $(YACC) -o $@ -d $< |
9 | 12 | ||
@@ -12,15 +15,13 @@ YACC = bison | |||
12 | 15 | ||
13 | all : bpf_jit_disasm bpf_dbg bpf_asm | 16 | all : bpf_jit_disasm bpf_dbg bpf_asm |
14 | 17 | ||
15 | bpf_jit_disasm : CFLAGS = -Wall -O2 -DPACKAGE='bpf_jit_disasm' | 18 | bpf_jit_disasm : CFLAGS += -DPACKAGE='bpf_jit_disasm' |
16 | bpf_jit_disasm : LDLIBS = -lopcodes -lbfd -ldl | 19 | bpf_jit_disasm : LDLIBS = -lopcodes -lbfd -ldl |
17 | bpf_jit_disasm : bpf_jit_disasm.o | 20 | bpf_jit_disasm : bpf_jit_disasm.o |
18 | 21 | ||
19 | bpf_dbg : CFLAGS = -Wall -O2 | ||
20 | bpf_dbg : LDLIBS = -lreadline | 22 | bpf_dbg : LDLIBS = -lreadline |
21 | bpf_dbg : bpf_dbg.o | 23 | bpf_dbg : bpf_dbg.o |
22 | 24 | ||
23 | bpf_asm : CFLAGS = -Wall -O2 -I. | ||
24 | bpf_asm : LDLIBS = | 25 | bpf_asm : LDLIBS = |
25 | bpf_asm : bpf_asm.o bpf_exp.yacc.o bpf_exp.lex.o | 26 | bpf_asm : bpf_asm.o bpf_exp.yacc.o bpf_exp.lex.o |
26 | bpf_exp.lex.o : bpf_exp.yacc.c | 27 | bpf_exp.lex.o : bpf_exp.yacc.c |
diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c index 0a945d2e8ca5..99d127fe9c35 100644 --- a/tools/perf/builtin-inject.c +++ b/tools/perf/builtin-inject.c | |||
@@ -675,6 +675,7 @@ int cmd_inject(int argc, const char **argv, const char *prefix __maybe_unused) | |||
675 | .fork = perf_event__repipe, | 675 | .fork = perf_event__repipe, |
676 | .exit = perf_event__repipe, | 676 | .exit = perf_event__repipe, |
677 | .lost = perf_event__repipe, | 677 | .lost = perf_event__repipe, |
678 | .lost_samples = perf_event__repipe, | ||
678 | .aux = perf_event__repipe, | 679 | .aux = perf_event__repipe, |
679 | .itrace_start = perf_event__repipe, | 680 | .itrace_start = perf_event__repipe, |
680 | .context_switch = perf_event__repipe, | 681 | .context_switch = perf_event__repipe, |
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 @@ | |||
44 | struct report { | 44 | struct 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 | ||
837 | repeat: | 837 | repeat: |
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 | ||
1431 | struct popup_action { | 1431 | struct 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/build-id.c b/tools/perf/util/build-id.c index d909459fb54c..217b5a60e2ab 100644 --- a/tools/perf/util/build-id.c +++ b/tools/perf/util/build-id.c | |||
@@ -76,6 +76,7 @@ struct perf_tool build_id__mark_dso_hit_ops = { | |||
76 | .exit = perf_event__exit_del_thread, | 76 | .exit = perf_event__exit_del_thread, |
77 | .attr = perf_event__process_attr, | 77 | .attr = perf_event__process_attr, |
78 | .build_id = perf_event__process_build_id, | 78 | .build_id = perf_event__process_build_id, |
79 | .ordered_events = true, | ||
79 | }; | 80 | }; |
80 | 81 | ||
81 | int build_id__sprintf(const u8 *build_id, int len, char *bf) | 82 | int build_id__sprintf(const u8 *build_id, int len, char *bf) |
diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c index 7c0c08386a1d..425df5c86c9c 100644 --- a/tools/perf/util/dso.c +++ b/tools/perf/util/dso.c | |||
@@ -933,6 +933,7 @@ static struct dso *__dso__findlink_by_longname(struct rb_root *root, | |||
933 | /* Add new node and rebalance tree */ | 933 | /* Add new node and rebalance tree */ |
934 | rb_link_node(&dso->rb_node, parent, p); | 934 | rb_link_node(&dso->rb_node, parent, p); |
935 | rb_insert_color(&dso->rb_node, root); | 935 | rb_insert_color(&dso->rb_node, root); |
936 | dso->root = root; | ||
936 | } | 937 | } |
937 | return NULL; | 938 | return NULL; |
938 | } | 939 | } |
@@ -945,15 +946,30 @@ static inline struct dso *__dso__find_by_longname(struct rb_root *root, | |||
945 | 946 | ||
946 | void dso__set_long_name(struct dso *dso, const char *name, bool name_allocated) | 947 | void dso__set_long_name(struct dso *dso, const char *name, bool name_allocated) |
947 | { | 948 | { |
949 | struct rb_root *root = dso->root; | ||
950 | |||
948 | if (name == NULL) | 951 | if (name == NULL) |
949 | return; | 952 | return; |
950 | 953 | ||
951 | if (dso->long_name_allocated) | 954 | if (dso->long_name_allocated) |
952 | free((char *)dso->long_name); | 955 | free((char *)dso->long_name); |
953 | 956 | ||
957 | if (root) { | ||
958 | rb_erase(&dso->rb_node, root); | ||
959 | /* | ||
960 | * __dso__findlink_by_longname() isn't guaranteed to add it | ||
961 | * back, so a clean removal is required here. | ||
962 | */ | ||
963 | RB_CLEAR_NODE(&dso->rb_node); | ||
964 | dso->root = NULL; | ||
965 | } | ||
966 | |||
954 | dso->long_name = name; | 967 | dso->long_name = name; |
955 | dso->long_name_len = strlen(name); | 968 | dso->long_name_len = strlen(name); |
956 | dso->long_name_allocated = name_allocated; | 969 | dso->long_name_allocated = name_allocated; |
970 | |||
971 | if (root) | ||
972 | __dso__findlink_by_longname(root, dso, NULL); | ||
957 | } | 973 | } |
958 | 974 | ||
959 | void dso__set_short_name(struct dso *dso, const char *name, bool name_allocated) | 975 | void dso__set_short_name(struct dso *dso, const char *name, bool name_allocated) |
@@ -1046,6 +1062,7 @@ struct dso *dso__new(const char *name) | |||
1046 | dso->kernel = DSO_TYPE_USER; | 1062 | dso->kernel = DSO_TYPE_USER; |
1047 | dso->needs_swap = DSO_SWAP__UNSET; | 1063 | dso->needs_swap = DSO_SWAP__UNSET; |
1048 | RB_CLEAR_NODE(&dso->rb_node); | 1064 | RB_CLEAR_NODE(&dso->rb_node); |
1065 | dso->root = NULL; | ||
1049 | INIT_LIST_HEAD(&dso->node); | 1066 | INIT_LIST_HEAD(&dso->node); |
1050 | INIT_LIST_HEAD(&dso->data.open_entry); | 1067 | INIT_LIST_HEAD(&dso->data.open_entry); |
1051 | pthread_mutex_init(&dso->lock, NULL); | 1068 | pthread_mutex_init(&dso->lock, NULL); |
diff --git a/tools/perf/util/dso.h b/tools/perf/util/dso.h index fc8db9c764ac..45ec4d0a50ed 100644 --- a/tools/perf/util/dso.h +++ b/tools/perf/util/dso.h | |||
@@ -135,6 +135,7 @@ struct dso { | |||
135 | pthread_mutex_t lock; | 135 | pthread_mutex_t lock; |
136 | struct list_head node; | 136 | struct list_head node; |
137 | struct rb_node rb_node; /* rbtree node sorted by long name */ | 137 | struct rb_node rb_node; /* rbtree node sorted by long name */ |
138 | struct rb_root *root; /* root of rbtree that rb_node is in */ | ||
138 | struct rb_root symbols[MAP__NR_TYPES]; | 139 | struct rb_root symbols[MAP__NR_TYPES]; |
139 | struct rb_root symbol_names[MAP__NR_TYPES]; | 140 | struct rb_root symbol_names[MAP__NR_TYPES]; |
140 | struct { | 141 | struct { |
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index 5ef90be2a249..8b303ff20289 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c | |||
@@ -91,6 +91,7 @@ static void dsos__purge(struct dsos *dsos) | |||
91 | 91 | ||
92 | list_for_each_entry_safe(pos, n, &dsos->head, node) { | 92 | list_for_each_entry_safe(pos, n, &dsos->head, node) { |
93 | RB_CLEAR_NODE(&pos->rb_node); | 93 | RB_CLEAR_NODE(&pos->rb_node); |
94 | pos->root = NULL; | ||
94 | list_del_init(&pos->node); | 95 | list_del_init(&pos->node); |
95 | dso__put(pos); | 96 | dso__put(pos); |
96 | } | 97 | } |
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c index bd8f03de5e40..05012bb178d7 100644 --- a/tools/perf/util/probe-finder.c +++ b/tools/perf/util/probe-finder.c | |||
@@ -1183,7 +1183,7 @@ static int add_probe_trace_event(Dwarf_Die *sc_die, struct probe_finder *pf) | |||
1183 | container_of(pf, struct trace_event_finder, pf); | 1183 | container_of(pf, struct trace_event_finder, pf); |
1184 | struct perf_probe_point *pp = &pf->pev->point; | 1184 | struct perf_probe_point *pp = &pf->pev->point; |
1185 | struct probe_trace_event *tev; | 1185 | struct probe_trace_event *tev; |
1186 | struct perf_probe_arg *args; | 1186 | struct perf_probe_arg *args = NULL; |
1187 | int ret, i; | 1187 | int ret, i; |
1188 | 1188 | ||
1189 | /* Check number of tevs */ | 1189 | /* Check number of tevs */ |
@@ -1198,19 +1198,23 @@ static int add_probe_trace_event(Dwarf_Die *sc_die, struct probe_finder *pf) | |||
1198 | ret = convert_to_trace_point(&pf->sp_die, tf->mod, pf->addr, | 1198 | ret = convert_to_trace_point(&pf->sp_die, tf->mod, pf->addr, |
1199 | pp->retprobe, pp->function, &tev->point); | 1199 | pp->retprobe, pp->function, &tev->point); |
1200 | if (ret < 0) | 1200 | if (ret < 0) |
1201 | return ret; | 1201 | goto end; |
1202 | 1202 | ||
1203 | tev->point.realname = strdup(dwarf_diename(sc_die)); | 1203 | tev->point.realname = strdup(dwarf_diename(sc_die)); |
1204 | if (!tev->point.realname) | 1204 | if (!tev->point.realname) { |
1205 | return -ENOMEM; | 1205 | ret = -ENOMEM; |
1206 | goto end; | ||
1207 | } | ||
1206 | 1208 | ||
1207 | pr_debug("Probe point found: %s+%lu\n", tev->point.symbol, | 1209 | pr_debug("Probe point found: %s+%lu\n", tev->point.symbol, |
1208 | tev->point.offset); | 1210 | tev->point.offset); |
1209 | 1211 | ||
1210 | /* Expand special probe argument if exist */ | 1212 | /* Expand special probe argument if exist */ |
1211 | args = zalloc(sizeof(struct perf_probe_arg) * MAX_PROBE_ARGS); | 1213 | args = zalloc(sizeof(struct perf_probe_arg) * MAX_PROBE_ARGS); |
1212 | if (args == NULL) | 1214 | if (args == NULL) { |
1213 | return -ENOMEM; | 1215 | ret = -ENOMEM; |
1216 | goto end; | ||
1217 | } | ||
1214 | 1218 | ||
1215 | ret = expand_probe_args(sc_die, pf, args); | 1219 | ret = expand_probe_args(sc_die, pf, args); |
1216 | if (ret < 0) | 1220 | if (ret < 0) |
@@ -1234,6 +1238,10 @@ static int add_probe_trace_event(Dwarf_Die *sc_die, struct probe_finder *pf) | |||
1234 | } | 1238 | } |
1235 | 1239 | ||
1236 | end: | 1240 | end: |
1241 | if (ret) { | ||
1242 | clear_probe_trace_event(tev); | ||
1243 | tf->ntevs--; | ||
1244 | } | ||
1237 | free(args); | 1245 | free(args); |
1238 | return ret; | 1246 | return ret; |
1239 | } | 1247 | } |
@@ -1246,7 +1254,7 @@ int debuginfo__find_trace_events(struct debuginfo *dbg, | |||
1246 | struct trace_event_finder tf = { | 1254 | struct trace_event_finder tf = { |
1247 | .pf = {.pev = pev, .callback = add_probe_trace_event}, | 1255 | .pf = {.pev = pev, .callback = add_probe_trace_event}, |
1248 | .max_tevs = probe_conf.max_probes, .mod = dbg->mod}; | 1256 | .max_tevs = probe_conf.max_probes, .mod = dbg->mod}; |
1249 | int ret; | 1257 | int ret, i; |
1250 | 1258 | ||
1251 | /* Allocate result tevs array */ | 1259 | /* Allocate result tevs array */ |
1252 | *tevs = zalloc(sizeof(struct probe_trace_event) * tf.max_tevs); | 1260 | *tevs = zalloc(sizeof(struct probe_trace_event) * tf.max_tevs); |
@@ -1258,6 +1266,8 @@ int debuginfo__find_trace_events(struct debuginfo *dbg, | |||
1258 | 1266 | ||
1259 | ret = debuginfo__find_probes(dbg, &tf.pf); | 1267 | ret = debuginfo__find_probes(dbg, &tf.pf); |
1260 | if (ret < 0) { | 1268 | if (ret < 0) { |
1269 | for (i = 0; i < tf.ntevs; i++) | ||
1270 | clear_probe_trace_event(&tf.tevs[i]); | ||
1261 | zfree(tevs); | 1271 | zfree(tevs); |
1262 | return ret; | 1272 | return ret; |
1263 | } | 1273 | } |
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, |
diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c index d8e4b20b6d54..0dac7e05a6ac 100644 --- a/tools/power/x86/turbostat/turbostat.c +++ b/tools/power/x86/turbostat/turbostat.c | |||
@@ -1173,9 +1173,9 @@ dump_nhm_platform_info(void) | |||
1173 | unsigned long long msr; | 1173 | unsigned long long msr; |
1174 | unsigned int ratio; | 1174 | unsigned int ratio; |
1175 | 1175 | ||
1176 | get_msr(base_cpu, MSR_NHM_PLATFORM_INFO, &msr); | 1176 | get_msr(base_cpu, MSR_PLATFORM_INFO, &msr); |
1177 | 1177 | ||
1178 | fprintf(stderr, "cpu%d: MSR_NHM_PLATFORM_INFO: 0x%08llx\n", base_cpu, msr); | 1178 | fprintf(stderr, "cpu%d: MSR_PLATFORM_INFO: 0x%08llx\n", base_cpu, msr); |
1179 | 1179 | ||
1180 | ratio = (msr >> 40) & 0xFF; | 1180 | ratio = (msr >> 40) & 0xFF; |
1181 | fprintf(stderr, "%d * %.0f = %.0f MHz max efficiency frequency\n", | 1181 | fprintf(stderr, "%d * %.0f = %.0f MHz max efficiency frequency\n", |
@@ -1807,7 +1807,7 @@ void check_permissions() | |||
1807 | * | 1807 | * |
1808 | * MSR_SMI_COUNT 0x00000034 | 1808 | * MSR_SMI_COUNT 0x00000034 |
1809 | * | 1809 | * |
1810 | * MSR_NHM_PLATFORM_INFO 0x000000ce | 1810 | * MSR_PLATFORM_INFO 0x000000ce |
1811 | * MSR_NHM_SNB_PKG_CST_CFG_CTL 0x000000e2 | 1811 | * MSR_NHM_SNB_PKG_CST_CFG_CTL 0x000000e2 |
1812 | * | 1812 | * |
1813 | * MSR_PKG_C3_RESIDENCY 0x000003f8 | 1813 | * MSR_PKG_C3_RESIDENCY 0x000003f8 |
@@ -1876,7 +1876,7 @@ int probe_nhm_msrs(unsigned int family, unsigned int model) | |||
1876 | get_msr(base_cpu, MSR_NHM_SNB_PKG_CST_CFG_CTL, &msr); | 1876 | get_msr(base_cpu, MSR_NHM_SNB_PKG_CST_CFG_CTL, &msr); |
1877 | pkg_cstate_limit = pkg_cstate_limits[msr & 0xF]; | 1877 | pkg_cstate_limit = pkg_cstate_limits[msr & 0xF]; |
1878 | 1878 | ||
1879 | get_msr(base_cpu, MSR_NHM_PLATFORM_INFO, &msr); | 1879 | get_msr(base_cpu, MSR_PLATFORM_INFO, &msr); |
1880 | base_ratio = (msr >> 8) & 0xFF; | 1880 | base_ratio = (msr >> 8) & 0xFF; |
1881 | 1881 | ||
1882 | base_hz = base_ratio * bclk * 1000000; | 1882 | base_hz = base_ratio * bclk * 1000000; |
diff --git a/tools/vm/page-types.c b/tools/vm/page-types.c index bcf5ec760eb9..5a6016224bb9 100644 --- a/tools/vm/page-types.c +++ b/tools/vm/page-types.c | |||
@@ -128,6 +128,7 @@ static const char * const page_flag_names[] = { | |||
128 | [KPF_THP] = "t:thp", | 128 | [KPF_THP] = "t:thp", |
129 | [KPF_BALLOON] = "o:balloon", | 129 | [KPF_BALLOON] = "o:balloon", |
130 | [KPF_ZERO_PAGE] = "z:zero_page", | 130 | [KPF_ZERO_PAGE] = "z:zero_page", |
131 | [KPF_IDLE] = "i:idle_page", | ||
131 | 132 | ||
132 | [KPF_RESERVED] = "r:reserved", | 133 | [KPF_RESERVED] = "r:reserved", |
133 | [KPF_MLOCKED] = "m:mlocked", | 134 | [KPF_MLOCKED] = "m:mlocked", |