diff --git a/[refs] b/[refs] index 4a0aedaa4b0b..e6c91d8cb2a1 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b36f19d572151abb987ce308a3e066b977a2146f +refs/heads/master: acd35a463cb2a8d2b28e094d718cf6e653ad7191 diff --git a/trunk/kernel/perf_event.c b/trunk/kernel/perf_event.c index 2a060be3b07f..45b7aec55458 100644 --- a/trunk/kernel/perf_event.c +++ b/trunk/kernel/perf_event.c @@ -2933,7 +2933,7 @@ static void perf_output_put_handle(struct perf_output_handle *handle) */ if (!local_dec_and_test(&data->nest)) - return; + goto out; /* * Publish the known good head. Rely on the full barrier implied @@ -2954,6 +2954,7 @@ static void perf_output_put_handle(struct perf_output_handle *handle) if (handle->wakeup != local_read(&data->wakeup)) perf_output_wakeup(handle); + out: preempt_enable(); } diff --git a/trunk/tools/perf/util/build-id.c b/trunk/tools/perf/util/build-id.c index 70c5cf87d020..0f60a3906808 100644 --- a/trunk/tools/perf/util/build-id.c +++ b/trunk/tools/perf/util/build-id.c @@ -6,8 +6,6 @@ * Copyright (C) 2009, 2010 Red Hat Inc. * Copyright (C) 2009, 2010 Arnaldo Carvalho de Melo */ -#include "util.h" -#include #include "build-id.h" #include "event.h" #include "symbol.h" @@ -39,23 +37,3 @@ struct perf_event_ops build_id__mark_dso_hit_ops = { .mmap = event__process_mmap, .fork = event__process_task, }; - -char *dso__build_id_filename(struct dso *self, char *bf, size_t size) -{ - char build_id_hex[BUILD_ID_SIZE * 2 + 1]; - const char *home; - - if (!self->has_build_id) - return NULL; - - build_id__sprintf(self->build_id, sizeof(self->build_id), build_id_hex); - home = getenv("HOME"); - if (bf == NULL) { - if (asprintf(&bf, "%s/%s/.build-id/%.2s/%s", home, - DEBUG_CACHE_DIR, build_id_hex, build_id_hex + 2) < 0) - return NULL; - } else - snprintf(bf, size, "%s/%s/.build-id/%.2s/%s", home, - DEBUG_CACHE_DIR, build_id_hex, build_id_hex + 2); - return bf; -} diff --git a/trunk/tools/perf/util/build-id.h b/trunk/tools/perf/util/build-id.h index 5dafb00eaa06..1d981d63cf9a 100644 --- a/trunk/tools/perf/util/build-id.h +++ b/trunk/tools/perf/util/build-id.h @@ -5,6 +5,4 @@ extern struct perf_event_ops build_id__mark_dso_hit_ops; -char *dso__build_id_filename(struct dso *self, char *bf, size_t size); - #endif diff --git a/trunk/tools/perf/util/callchain.c b/trunk/tools/perf/util/callchain.c index 62b69ad4aa73..21a52e0a4435 100644 --- a/trunk/tools/perf/util/callchain.c +++ b/trunk/tools/perf/util/callchain.c @@ -15,7 +15,6 @@ #include #include -#include "util.h" #include "callchain.h" bool ip_callchain__valid(struct ip_callchain *chain, event_t *event) diff --git a/trunk/tools/perf/util/callchain.h b/trunk/tools/perf/util/callchain.h index 1ca73e4a2723..1cba1f5504e7 100644 --- a/trunk/tools/perf/util/callchain.h +++ b/trunk/tools/perf/util/callchain.h @@ -5,6 +5,7 @@ #include #include #include "event.h" +#include "util.h" #include "symbol.h" enum chain_mode { diff --git a/trunk/tools/perf/util/hist.c b/trunk/tools/perf/util/hist.c index 739c39fd0ade..9a71c94f057a 100644 --- a/trunk/tools/perf/util/hist.c +++ b/trunk/tools/perf/util/hist.c @@ -1,4 +1,3 @@ -#include "build-id.h" #include "util.h" #include "hist.h" #include "session.h" @@ -989,35 +988,22 @@ int hist_entry__annotate(struct hist_entry *self, struct list_head *head) struct symbol *sym = self->ms.sym; struct map *map = self->ms.map; struct dso *dso = map->dso; - char *filename = dso__build_id_filename(dso, NULL, 0); + const char *filename = dso->long_name; char command[PATH_MAX * 2]; FILE *file; - int err = -1; u64 len; - if (filename == NULL) { - if (dso->has_build_id) { - pr_err("Can't annotate %s: not enough memory\n", - sym->name); - return -1; - } - /* - * If we don't have build-ids, well, lets hope that this - * DSO is the same as when 'perf record' ran. - */ - filename = dso->long_name; - } + if (!filename) + return -1; if (dso->origin == DSO__ORIG_KERNEL) { - if (dso->annotate_warned) { - err = 0; - goto out_free_filename; - } + if (dso->annotate_warned) + return 0; dso->annotate_warned = 1; pr_err("Can't annotate %s: No vmlinux file was found in the " "path:\n", sym->name); vmlinux_path__fprintf(stderr); - goto out_free_filename; + return -1; } pr_debug("%s: filename=%s, sym=%s, start=%#Lx, end=%#Lx\n", __func__, @@ -1039,18 +1025,14 @@ int hist_entry__annotate(struct hist_entry *self, struct list_head *head) file = popen(command, "r"); if (!file) - goto out_free_filename; + return -1; while (!feof(file)) if (hist_entry__parse_objdump_line(self, file, head) < 0) break; pclose(file); - err = 0; -out_free_filename: - if (dso->has_build_id) - free(filename); - return err; + return 0; } void hists__inc_nr_events(struct hists *self, u32 type) diff --git a/trunk/tools/perf/util/newt.c b/trunk/tools/perf/util/newt.c index 051022eb5f43..9338d060ee49 100644 --- a/trunk/tools/perf/util/newt.c +++ b/trunk/tools/perf/util/newt.c @@ -383,7 +383,6 @@ static int ui_browser__run(struct ui_browser *self, const char *title, newtFormAddHotKey(self->form, NEWT_KEY_DOWN); newtFormAddHotKey(self->form, NEWT_KEY_PGUP); newtFormAddHotKey(self->form, NEWT_KEY_PGDN); - newtFormAddHotKey(self->form, ' '); newtFormAddHotKey(self->form, NEWT_KEY_HOME); newtFormAddHotKey(self->form, NEWT_KEY_END); @@ -420,7 +419,6 @@ static int ui_browser__run(struct ui_browser *self, const char *title, } break; case NEWT_KEY_PGDN: - case ' ': if (self->first_visible_entry_idx + self->height > self->nr_entries - 1) break; diff --git a/trunk/tools/perf/util/symbol.c b/trunk/tools/perf/util/symbol.c index aaa51ba147df..96bff0e54863 100644 --- a/trunk/tools/perf/util/symbol.c +++ b/trunk/tools/perf/util/symbol.c @@ -11,7 +11,6 @@ #include #include #include -#include "build-id.h" #include "symbol.h" #include "strlist.h" @@ -1294,6 +1293,7 @@ int dso__load(struct dso *self, struct map *map, symbol_filter_t filter) int size = PATH_MAX; char *name; u8 build_id[BUILD_ID_SIZE]; + char build_id_hex[BUILD_ID_SIZE * 2 + 1]; int ret = -1; int fd; struct machine *machine; @@ -1325,8 +1325,15 @@ int dso__load(struct dso *self, struct map *map, symbol_filter_t filter) } self->origin = DSO__ORIG_BUILD_ID_CACHE; - if (dso__build_id_filename(self, name, size) != NULL) + + if (self->has_build_id) { + build_id__sprintf(self->build_id, sizeof(self->build_id), + build_id_hex); + snprintf(name, size, "%s/%s/.build-id/%.2s/%s", + getenv("HOME"), DEBUG_CACHE_DIR, + build_id_hex, build_id_hex + 2); goto open_file; + } more: do { self->origin++; @@ -1342,7 +1349,6 @@ int dso__load(struct dso *self, struct map *map, symbol_filter_t filter) case DSO__ORIG_BUILDID: if (filename__read_build_id(self->long_name, build_id, sizeof(build_id))) { - char build_id_hex[BUILD_ID_SIZE * 2 + 1]; build_id__sprintf(build_id, sizeof(build_id), build_id_hex); snprintf(name, size,