summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/util/thread.c2
-rw-r--r--tools/perf/util/unwind-libunwind.c11
-rw-r--r--tools/perf/util/unwind.h9
3 files changed, 16 insertions, 6 deletions
diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c
index f30f9566fddc..2439b122a4e4 100644
--- a/tools/perf/util/thread.c
+++ b/tools/perf/util/thread.c
@@ -202,7 +202,7 @@ int thread__insert_map(struct thread *thread, struct map *map)
{
int ret;
- ret = unwind__prepare_access(thread, map);
+ ret = unwind__prepare_access(thread, map, NULL);
if (ret)
return ret;
diff --git a/tools/perf/util/unwind-libunwind.c b/tools/perf/util/unwind-libunwind.c
index 854711966cad..6d542a4e0648 100644
--- a/tools/perf/util/unwind-libunwind.c
+++ b/tools/perf/util/unwind-libunwind.c
@@ -14,15 +14,19 @@ static void unwind__register_ops(struct thread *thread,
thread->unwind_libunwind_ops = ops;
}
-int unwind__prepare_access(struct thread *thread, struct map *map)
+int unwind__prepare_access(struct thread *thread, struct map *map,
+ bool *initialized)
{
const char *arch;
enum dso_type dso_type;
struct unwind_libunwind_ops *ops = local_unwind_libunwind_ops;
+ int err;
if (thread->addr_space) {
pr_debug("unwind: thread map already set, dso=%s\n",
map->dso->name);
+ if (initialized)
+ *initialized = true;
return 0;
}
@@ -51,7 +55,10 @@ int unwind__prepare_access(struct thread *thread, struct map *map)
out_register:
unwind__register_ops(thread, ops);
- return thread->unwind_libunwind_ops->prepare_access(thread);
+ err = thread->unwind_libunwind_ops->prepare_access(thread);
+ if (initialized)
+ *initialized = err ? false : true;
+ return err;
}
void unwind__flush_access(struct thread *thread)
diff --git a/tools/perf/util/unwind.h b/tools/perf/util/unwind.h
index 84c6d44d52f9..61fb1e90ff51 100644
--- a/tools/perf/util/unwind.h
+++ b/tools/perf/util/unwind.h
@@ -42,12 +42,14 @@ int unwind__get_entries(unwind_entry_cb_t cb, void *arg,
#endif
int LIBUNWIND__ARCH_REG_ID(int regnum);
-int unwind__prepare_access(struct thread *thread, struct map *map);
+int unwind__prepare_access(struct thread *thread, struct map *map,
+ bool *initialized);
void unwind__flush_access(struct thread *thread);
void unwind__finish_access(struct thread *thread);
#else
static inline int unwind__prepare_access(struct thread *thread __maybe_unused,
- struct map *map __maybe_unused)
+ struct map *map __maybe_unused,
+ bool *initialized __maybe_unused)
{
return 0;
}
@@ -67,7 +69,8 @@ unwind__get_entries(unwind_entry_cb_t cb __maybe_unused,
}
static inline int unwind__prepare_access(struct thread *thread __maybe_unused,
- struct map *map __maybe_unused)
+ struct map *map __maybe_unused,
+ bool *initialized __maybe_unused)
{
return 0;
}