diff options
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/MANIFEST | 2 | ||||
-rw-r--r-- | tools/perf/Makefile.perf | 19 | ||||
-rw-r--r-- | tools/perf/builtin-record.c | 11 | ||||
-rw-r--r-- | tools/perf/builtin-stat.c | 4 | ||||
-rw-r--r-- | tools/perf/builtin-top.c | 4 | ||||
-rw-r--r-- | tools/perf/config/Makefile | 2 | ||||
-rw-r--r-- | tools/perf/ui/browsers/hists.c | 2 | ||||
-rw-r--r-- | tools/perf/util/Build | 2 | ||||
-rw-r--r-- | tools/perf/util/auxtrace.c | 10 | ||||
-rw-r--r-- | tools/perf/util/machine.c | 20 | ||||
-rw-r--r-- | tools/perf/util/python-ext-sources | 4 | ||||
-rw-r--r-- | tools/perf/util/stat-shadow.c | 8 | ||||
-rw-r--r-- | tools/perf/util/symbol.c | 2 | ||||
-rw-r--r-- | tools/perf/util/symbol.h | 3 | ||||
-rw-r--r-- | tools/perf/util/thread.c | 6 | ||||
-rw-r--r-- | tools/perf/util/thread_map.c | 3 | ||||
-rw-r--r-- | tools/perf/util/vdso.c | 8 |
17 files changed, 77 insertions, 33 deletions
diff --git a/tools/perf/MANIFEST b/tools/perf/MANIFEST index 09dc0aabb515..d01a0aad5a01 100644 --- a/tools/perf/MANIFEST +++ b/tools/perf/MANIFEST | |||
@@ -18,6 +18,7 @@ tools/arch/x86/include/asm/atomic.h | |||
18 | tools/arch/x86/include/asm/rmwcc.h | 18 | tools/arch/x86/include/asm/rmwcc.h |
19 | tools/lib/traceevent | 19 | tools/lib/traceevent |
20 | tools/lib/api | 20 | tools/lib/api |
21 | tools/lib/hweight.c | ||
21 | tools/lib/rbtree.c | 22 | tools/lib/rbtree.c |
22 | tools/lib/symbol/kallsyms.c | 23 | tools/lib/symbol/kallsyms.c |
23 | tools/lib/symbol/kallsyms.h | 24 | tools/lib/symbol/kallsyms.h |
@@ -57,7 +58,6 @@ include/linux/perf_event.h | |||
57 | include/linux/list.h | 58 | include/linux/list.h |
58 | include/linux/hash.h | 59 | include/linux/hash.h |
59 | include/linux/stringify.h | 60 | include/linux/stringify.h |
60 | lib/hweight.c | ||
61 | include/linux/swab.h | 61 | include/linux/swab.h |
62 | arch/*/include/asm/unistd*.h | 62 | arch/*/include/asm/unistd*.h |
63 | arch/*/include/uapi/asm/unistd*.h | 63 | arch/*/include/uapi/asm/unistd*.h |
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 7a4b549214e3..bba34636b733 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf | |||
@@ -109,9 +109,22 @@ $(OUTPUT)PERF-VERSION-FILE: ../../.git/HEAD | |||
109 | $(Q)$(SHELL_PATH) util/PERF-VERSION-GEN $(OUTPUT) | 109 | $(Q)$(SHELL_PATH) util/PERF-VERSION-GEN $(OUTPUT) |
110 | $(Q)touch $(OUTPUT)PERF-VERSION-FILE | 110 | $(Q)touch $(OUTPUT)PERF-VERSION-FILE |
111 | 111 | ||
112 | CC = $(CROSS_COMPILE)gcc | 112 | # Makefiles suck: This macro sets a default value of $(2) for the |
113 | LD ?= $(CROSS_COMPILE)ld | 113 | # variable named by $(1), unless the variable has been set by |
114 | AR = $(CROSS_COMPILE)ar | 114 | # environment or command line. This is necessary for CC and AR |
115 | # because make sets default values, so the simpler ?= approach | ||
116 | # won't work as expected. | ||
117 | define allow-override | ||
118 | $(if $(or $(findstring environment,$(origin $(1))),\ | ||
119 | $(findstring command line,$(origin $(1)))),,\ | ||
120 | $(eval $(1) = $(2))) | ||
121 | endef | ||
122 | |||
123 | # Allow setting CC and AR and LD, or setting CROSS_COMPILE as a prefix. | ||
124 | $(call allow-override,CC,$(CROSS_COMPILE)gcc) | ||
125 | $(call allow-override,AR,$(CROSS_COMPILE)ar) | ||
126 | $(call allow-override,LD,$(CROSS_COMPILE)ld) | ||
127 | |||
115 | PKG_CONFIG = $(CROSS_COMPILE)pkg-config | 128 | PKG_CONFIG = $(CROSS_COMPILE)pkg-config |
116 | 129 | ||
117 | RM = rm -f | 130 | RM = rm -f |
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index de165a1b9240..20b56eb987f8 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c | |||
@@ -521,6 +521,15 @@ static int __cmd_record(struct record *rec, int argc, const char **argv) | |||
521 | goto out_child; | 521 | goto out_child; |
522 | } | 522 | } |
523 | 523 | ||
524 | /* | ||
525 | * Normally perf_session__new would do this, but it doesn't have the | ||
526 | * evlist. | ||
527 | */ | ||
528 | if (rec->tool.ordered_events && !perf_evlist__sample_id_all(rec->evlist)) { | ||
529 | pr_warning("WARNING: No sample_id_all support, falling back to unordered processing\n"); | ||
530 | rec->tool.ordered_events = false; | ||
531 | } | ||
532 | |||
524 | if (!rec->evlist->nr_groups) | 533 | if (!rec->evlist->nr_groups) |
525 | perf_header__clear_feat(&session->header, HEADER_GROUP_DESC); | 534 | perf_header__clear_feat(&session->header, HEADER_GROUP_DESC); |
526 | 535 | ||
@@ -965,9 +974,11 @@ static struct record record = { | |||
965 | .tool = { | 974 | .tool = { |
966 | .sample = process_sample_event, | 975 | .sample = process_sample_event, |
967 | .fork = perf_event__process_fork, | 976 | .fork = perf_event__process_fork, |
977 | .exit = perf_event__process_exit, | ||
968 | .comm = perf_event__process_comm, | 978 | .comm = perf_event__process_comm, |
969 | .mmap = perf_event__process_mmap, | 979 | .mmap = perf_event__process_mmap, |
970 | .mmap2 = perf_event__process_mmap2, | 980 | .mmap2 = perf_event__process_mmap2, |
981 | .ordered_events = true, | ||
971 | }, | 982 | }, |
972 | }; | 983 | }; |
973 | 984 | ||
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index 37e301a32f43..d99d850e1444 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c | |||
@@ -343,7 +343,7 @@ static int read_counter(struct perf_evsel *counter) | |||
343 | return 0; | 343 | return 0; |
344 | } | 344 | } |
345 | 345 | ||
346 | static void read_counters(bool close) | 346 | static void read_counters(bool close_counters) |
347 | { | 347 | { |
348 | struct perf_evsel *counter; | 348 | struct perf_evsel *counter; |
349 | 349 | ||
@@ -354,7 +354,7 @@ static void read_counters(bool close) | |||
354 | if (process_counter(counter)) | 354 | if (process_counter(counter)) |
355 | pr_warning("failed to process counter %s\n", counter->name); | 355 | pr_warning("failed to process counter %s\n", counter->name); |
356 | 356 | ||
357 | if (close) { | 357 | if (close_counters) { |
358 | perf_evsel__close_fd(counter, perf_evsel__nr_cpus(counter), | 358 | perf_evsel__close_fd(counter, perf_evsel__nr_cpus(counter), |
359 | thread_map__nr(evsel_list->threads)); | 359 | thread_map__nr(evsel_list->threads)); |
360 | } | 360 | } |
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index ecf319728f25..6135cc07213c 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c | |||
@@ -601,8 +601,8 @@ static void display_sig(int sig __maybe_unused) | |||
601 | 601 | ||
602 | static void display_setup_sig(void) | 602 | static void display_setup_sig(void) |
603 | { | 603 | { |
604 | signal(SIGSEGV, display_sig); | 604 | signal(SIGSEGV, sighandler_dump_stack); |
605 | signal(SIGFPE, display_sig); | 605 | signal(SIGFPE, sighandler_dump_stack); |
606 | signal(SIGINT, display_sig); | 606 | signal(SIGINT, display_sig); |
607 | signal(SIGQUIT, display_sig); | 607 | signal(SIGQUIT, display_sig); |
608 | signal(SIGTERM, display_sig); | 608 | signal(SIGTERM, display_sig); |
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile index 094ddaee104c..d31fac19c30b 100644 --- a/tools/perf/config/Makefile +++ b/tools/perf/config/Makefile | |||
@@ -638,7 +638,7 @@ ifndef DESTDIR | |||
638 | prefix ?= $(HOME) | 638 | prefix ?= $(HOME) |
639 | endif | 639 | endif |
640 | bindir_relative = bin | 640 | bindir_relative = bin |
641 | bindir = $(prefix)/$(bindir_relative) | 641 | bindir = $(abspath $(prefix)/$(bindir_relative)) |
642 | mandir = share/man | 642 | mandir = share/man |
643 | infodir = share/info | 643 | infodir = share/info |
644 | perfexecdir = libexec/perf-core | 644 | perfexecdir = libexec/perf-core |
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c index 7629bef2fd79..fa67613976a8 100644 --- a/tools/perf/ui/browsers/hists.c +++ b/tools/perf/ui/browsers/hists.c | |||
@@ -48,7 +48,7 @@ static struct rb_node *hists__filter_entries(struct rb_node *nd, | |||
48 | 48 | ||
49 | static bool hist_browser__has_filter(struct hist_browser *hb) | 49 | static bool hist_browser__has_filter(struct hist_browser *hb) |
50 | { | 50 | { |
51 | return hists__has_filter(hb->hists) || hb->min_pcnt; | 51 | return hists__has_filter(hb->hists) || hb->min_pcnt || symbol_conf.has_filter; |
52 | } | 52 | } |
53 | 53 | ||
54 | static int hist_browser__get_folding(struct hist_browser *browser) | 54 | static int hist_browser__get_folding(struct hist_browser *browser) |
diff --git a/tools/perf/util/Build b/tools/perf/util/Build index 601d11440596..d2d318c59b37 100644 --- a/tools/perf/util/Build +++ b/tools/perf/util/Build | |||
@@ -143,6 +143,6 @@ $(OUTPUT)util/rbtree.o: ../lib/rbtree.c FORCE | |||
143 | $(call rule_mkdir) | 143 | $(call rule_mkdir) |
144 | $(call if_changed_dep,cc_o_c) | 144 | $(call if_changed_dep,cc_o_c) |
145 | 145 | ||
146 | $(OUTPUT)util/hweight.o: ../../lib/hweight.c FORCE | 146 | $(OUTPUT)util/hweight.o: ../lib/hweight.c FORCE |
147 | $(call rule_mkdir) | 147 | $(call rule_mkdir) |
148 | $(call if_changed_dep,cc_o_c) | 148 | $(call if_changed_dep,cc_o_c) |
diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c index 7e7405c9b936..83d9dd96fe08 100644 --- a/tools/perf/util/auxtrace.c +++ b/tools/perf/util/auxtrace.c | |||
@@ -53,11 +53,6 @@ int auxtrace_mmap__mmap(struct auxtrace_mmap *mm, | |||
53 | { | 53 | { |
54 | struct perf_event_mmap_page *pc = userpg; | 54 | struct perf_event_mmap_page *pc = userpg; |
55 | 55 | ||
56 | #if BITS_PER_LONG != 64 && !defined(HAVE_SYNC_COMPARE_AND_SWAP_SUPPORT) | ||
57 | pr_err("Cannot use AUX area tracing mmaps\n"); | ||
58 | return -1; | ||
59 | #endif | ||
60 | |||
61 | WARN_ONCE(mm->base, "Uninitialized auxtrace_mmap\n"); | 56 | WARN_ONCE(mm->base, "Uninitialized auxtrace_mmap\n"); |
62 | 57 | ||
63 | mm->userpg = userpg; | 58 | mm->userpg = userpg; |
@@ -73,6 +68,11 @@ int auxtrace_mmap__mmap(struct auxtrace_mmap *mm, | |||
73 | return 0; | 68 | return 0; |
74 | } | 69 | } |
75 | 70 | ||
71 | #if BITS_PER_LONG != 64 && !defined(HAVE_SYNC_COMPARE_AND_SWAP_SUPPORT) | ||
72 | pr_err("Cannot use AUX area tracing mmaps\n"); | ||
73 | return -1; | ||
74 | #endif | ||
75 | |||
76 | pc->aux_offset = mp->offset; | 76 | pc->aux_offset = mp->offset; |
77 | pc->aux_size = mp->len; | 77 | pc->aux_size = mp->len; |
78 | 78 | ||
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index 7ff682770fdb..f1a4c833121e 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c | |||
@@ -1387,6 +1387,24 @@ int machine__process_fork_event(struct machine *machine, union perf_event *event | |||
1387 | event->fork.ptid); | 1387 | event->fork.ptid); |
1388 | int err = 0; | 1388 | int err = 0; |
1389 | 1389 | ||
1390 | if (dump_trace) | ||
1391 | perf_event__fprintf_task(event, stdout); | ||
1392 | |||
1393 | /* | ||
1394 | * There may be an existing thread that is not actually the parent, | ||
1395 | * either because we are processing events out of order, or because the | ||
1396 | * (fork) event that would have removed the thread was lost. Assume the | ||
1397 | * latter case and continue on as best we can. | ||
1398 | */ | ||
1399 | if (parent->pid_ != (pid_t)event->fork.ppid) { | ||
1400 | dump_printf("removing erroneous parent thread %d/%d\n", | ||
1401 | parent->pid_, parent->tid); | ||
1402 | machine__remove_thread(machine, parent); | ||
1403 | thread__put(parent); | ||
1404 | parent = machine__findnew_thread(machine, event->fork.ppid, | ||
1405 | event->fork.ptid); | ||
1406 | } | ||
1407 | |||
1390 | /* if a thread currently exists for the thread id remove it */ | 1408 | /* if a thread currently exists for the thread id remove it */ |
1391 | if (thread != NULL) { | 1409 | if (thread != NULL) { |
1392 | machine__remove_thread(machine, thread); | 1410 | machine__remove_thread(machine, thread); |
@@ -1395,8 +1413,6 @@ int machine__process_fork_event(struct machine *machine, union perf_event *event | |||
1395 | 1413 | ||
1396 | thread = machine__findnew_thread(machine, event->fork.pid, | 1414 | thread = machine__findnew_thread(machine, event->fork.pid, |
1397 | event->fork.tid); | 1415 | event->fork.tid); |
1398 | if (dump_trace) | ||
1399 | perf_event__fprintf_task(event, stdout); | ||
1400 | 1416 | ||
1401 | if (thread == NULL || parent == NULL || | 1417 | if (thread == NULL || parent == NULL || |
1402 | thread__fork(thread, parent, sample->time) < 0) { | 1418 | thread__fork(thread, parent, sample->time) < 0) { |
diff --git a/tools/perf/util/python-ext-sources b/tools/perf/util/python-ext-sources index e23ded40c79e..0766d98c5da5 100644 --- a/tools/perf/util/python-ext-sources +++ b/tools/perf/util/python-ext-sources | |||
@@ -10,7 +10,7 @@ util/ctype.c | |||
10 | util/evlist.c | 10 | util/evlist.c |
11 | util/evsel.c | 11 | util/evsel.c |
12 | util/cpumap.c | 12 | util/cpumap.c |
13 | ../../lib/hweight.c | 13 | ../lib/hweight.c |
14 | util/thread_map.c | 14 | util/thread_map.c |
15 | util/util.c | 15 | util/util.c |
16 | util/xyarray.c | 16 | util/xyarray.c |
@@ -19,5 +19,5 @@ util/rblist.c | |||
19 | util/stat.c | 19 | util/stat.c |
20 | util/strlist.c | 20 | util/strlist.c |
21 | util/trace-event.c | 21 | util/trace-event.c |
22 | ../../lib/rbtree.c | 22 | ../lib/rbtree.c |
23 | util/string.c | 23 | util/string.c |
diff --git a/tools/perf/util/stat-shadow.c b/tools/perf/util/stat-shadow.c index 53e8bb7bc852..2a5d8d7698ae 100644 --- a/tools/perf/util/stat-shadow.c +++ b/tools/perf/util/stat-shadow.c | |||
@@ -85,7 +85,7 @@ void perf_stat__update_shadow_stats(struct perf_evsel *counter, u64 *count, | |||
85 | else if (perf_evsel__match(counter, HARDWARE, HW_CPU_CYCLES)) | 85 | else if (perf_evsel__match(counter, HARDWARE, HW_CPU_CYCLES)) |
86 | update_stats(&runtime_cycles_stats[ctx][cpu], count[0]); | 86 | update_stats(&runtime_cycles_stats[ctx][cpu], count[0]); |
87 | else if (perf_stat_evsel__is(counter, CYCLES_IN_TX)) | 87 | else if (perf_stat_evsel__is(counter, CYCLES_IN_TX)) |
88 | update_stats(&runtime_transaction_stats[ctx][cpu], count[0]); | 88 | update_stats(&runtime_cycles_in_tx_stats[ctx][cpu], count[0]); |
89 | else if (perf_stat_evsel__is(counter, TRANSACTION_START)) | 89 | else if (perf_stat_evsel__is(counter, TRANSACTION_START)) |
90 | update_stats(&runtime_transaction_stats[ctx][cpu], count[0]); | 90 | update_stats(&runtime_transaction_stats[ctx][cpu], count[0]); |
91 | else if (perf_stat_evsel__is(counter, ELISION_START)) | 91 | else if (perf_stat_evsel__is(counter, ELISION_START)) |
@@ -398,20 +398,18 @@ void perf_stat__print_shadow_stats(FILE *out, struct perf_evsel *evsel, | |||
398 | " # %5.2f%% aborted cycles ", | 398 | " # %5.2f%% aborted cycles ", |
399 | 100.0 * ((total2-avg) / total)); | 399 | 100.0 * ((total2-avg) / total)); |
400 | } else if (perf_stat_evsel__is(evsel, TRANSACTION_START) && | 400 | } else if (perf_stat_evsel__is(evsel, TRANSACTION_START) && |
401 | avg > 0 && | ||
402 | runtime_cycles_in_tx_stats[ctx][cpu].n != 0) { | 401 | runtime_cycles_in_tx_stats[ctx][cpu].n != 0) { |
403 | total = avg_stats(&runtime_cycles_in_tx_stats[ctx][cpu]); | 402 | total = avg_stats(&runtime_cycles_in_tx_stats[ctx][cpu]); |
404 | 403 | ||
405 | if (total) | 404 | if (avg) |
406 | ratio = total / avg; | 405 | ratio = total / avg; |
407 | 406 | ||
408 | fprintf(out, " # %8.0f cycles / transaction ", ratio); | 407 | fprintf(out, " # %8.0f cycles / transaction ", ratio); |
409 | } else if (perf_stat_evsel__is(evsel, ELISION_START) && | 408 | } else if (perf_stat_evsel__is(evsel, ELISION_START) && |
410 | avg > 0 && | ||
411 | runtime_cycles_in_tx_stats[ctx][cpu].n != 0) { | 409 | runtime_cycles_in_tx_stats[ctx][cpu].n != 0) { |
412 | total = avg_stats(&runtime_cycles_in_tx_stats[ctx][cpu]); | 410 | total = avg_stats(&runtime_cycles_in_tx_stats[ctx][cpu]); |
413 | 411 | ||
414 | if (total) | 412 | if (avg) |
415 | ratio = total / avg; | 413 | ratio = total / avg; |
416 | 414 | ||
417 | fprintf(out, " # %8.0f cycles / elision ", ratio); | 415 | fprintf(out, " # %8.0f cycles / elision ", ratio); |
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index 48b588c6951a..60f11414bb5c 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c | |||
@@ -1911,6 +1911,8 @@ int setup_list(struct strlist **list, const char *list_str, | |||
1911 | pr_err("problems parsing %s list\n", list_name); | 1911 | pr_err("problems parsing %s list\n", list_name); |
1912 | return -1; | 1912 | return -1; |
1913 | } | 1913 | } |
1914 | |||
1915 | symbol_conf.has_filter = true; | ||
1914 | return 0; | 1916 | return 0; |
1915 | } | 1917 | } |
1916 | 1918 | ||
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h index bef47ead1d9b..b98ce51af142 100644 --- a/tools/perf/util/symbol.h +++ b/tools/perf/util/symbol.h | |||
@@ -105,7 +105,8 @@ struct symbol_conf { | |||
105 | demangle_kernel, | 105 | demangle_kernel, |
106 | filter_relative, | 106 | filter_relative, |
107 | show_hist_headers, | 107 | show_hist_headers, |
108 | branch_callstack; | 108 | branch_callstack, |
109 | has_filter; | ||
109 | const char *vmlinux_name, | 110 | const char *vmlinux_name, |
110 | *kallsyms_name, | 111 | *kallsyms_name, |
111 | *source_prefix, | 112 | *source_prefix, |
diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c index 28c4b746baa1..0a9ae8014729 100644 --- a/tools/perf/util/thread.c +++ b/tools/perf/util/thread.c | |||
@@ -191,6 +191,12 @@ static int thread__clone_map_groups(struct thread *thread, | |||
191 | if (thread->pid_ == parent->pid_) | 191 | if (thread->pid_ == parent->pid_) |
192 | return 0; | 192 | return 0; |
193 | 193 | ||
194 | if (thread->mg == parent->mg) { | ||
195 | pr_debug("broken map groups on thread %d/%d parent %d/%d\n", | ||
196 | thread->pid_, thread->tid, parent->pid_, parent->tid); | ||
197 | return 0; | ||
198 | } | ||
199 | |||
194 | /* But this one is new process, copy maps. */ | 200 | /* But this one is new process, copy maps. */ |
195 | for (i = 0; i < MAP__NR_TYPES; ++i) | 201 | for (i = 0; i < MAP__NR_TYPES; ++i) |
196 | if (map_groups__clone(thread->mg, parent->mg, i) < 0) | 202 | if (map_groups__clone(thread->mg, parent->mg, i) < 0) |
diff --git a/tools/perf/util/thread_map.c b/tools/perf/util/thread_map.c index da7646d767fe..292ae2c90e06 100644 --- a/tools/perf/util/thread_map.c +++ b/tools/perf/util/thread_map.c | |||
@@ -136,8 +136,7 @@ struct thread_map *thread_map__new_by_uid(uid_t uid) | |||
136 | if (grow) { | 136 | if (grow) { |
137 | struct thread_map *tmp; | 137 | struct thread_map *tmp; |
138 | 138 | ||
139 | tmp = realloc(threads, (sizeof(*threads) + | 139 | tmp = thread_map__realloc(threads, max_threads); |
140 | max_threads * sizeof(pid_t))); | ||
141 | if (tmp == NULL) | 140 | if (tmp == NULL) |
142 | goto out_free_namelist; | 141 | goto out_free_namelist; |
143 | 142 | ||
diff --git a/tools/perf/util/vdso.c b/tools/perf/util/vdso.c index 4b89118f158d..44d440da15dc 100644 --- a/tools/perf/util/vdso.c +++ b/tools/perf/util/vdso.c | |||
@@ -236,18 +236,16 @@ static struct dso *__machine__findnew_compat(struct machine *machine, | |||
236 | const char *file_name; | 236 | const char *file_name; |
237 | struct dso *dso; | 237 | struct dso *dso; |
238 | 238 | ||
239 | pthread_rwlock_wrlock(&machine->dsos.lock); | ||
240 | dso = __dsos__find(&machine->dsos, vdso_file->dso_name, true); | 239 | dso = __dsos__find(&machine->dsos, vdso_file->dso_name, true); |
241 | if (dso) | 240 | if (dso) |
242 | goto out_unlock; | 241 | goto out; |
243 | 242 | ||
244 | file_name = vdso__get_compat_file(vdso_file); | 243 | file_name = vdso__get_compat_file(vdso_file); |
245 | if (!file_name) | 244 | if (!file_name) |
246 | goto out_unlock; | 245 | goto out; |
247 | 246 | ||
248 | dso = __machine__addnew_vdso(machine, vdso_file->dso_name, file_name); | 247 | dso = __machine__addnew_vdso(machine, vdso_file->dso_name, file_name); |
249 | out_unlock: | 248 | out: |
250 | pthread_rwlock_unlock(&machine->dsos.lock); | ||
251 | return dso; | 249 | return dso; |
252 | } | 250 | } |
253 | 251 | ||