summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/map_groups.h
diff options
context:
space:
mode:
authorJohn Keeping <john@metanate.com>2019-08-15 11:01:45 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-10-05 13:13:39 +0200
commitb251e979c97911bd6c5e40bec16c2eb4d8ca2e6d (patch)
treedc28723552be997f794f16aaf3fe7d7a0acfe2b1 /tools/perf/util/map_groups.h
parent2bc1f53cc46a4d286869d2e955be84678d455bd1 (diff)
downloadlinux-stable-b251e979c97911bd6c5e40bec16c2eb4d8ca2e6d.tar.gz
linux-stable-b251e979c97911bd6c5e40bec16c2eb4d8ca2e6d.tar.bz2
linux-stable-b251e979c97911bd6c5e40bec16c2eb4d8ca2e6d.zip
perf unwind: Fix libunwind when tid != pid
[ Upstream commit e8ba2906f6b9054102ad035ac9cafad9d4168589 ] Commit e5adfc3e7e77 ("perf map: Synthesize maps only for thread group leader") changed the recording side so that we no longer get mmap events for threads other than the thread group leader (when synthesising these events for threads which exist before perf is started). When a file recorded after this change is loaded, the lack of mmap records mean that unwinding is not set up for any other threads. This can be seen in a simple record/report scenario: perf record --call-graph=dwarf -t $TID perf report If $TID is a process ID then the report will show call graphs, but if $TID is a secondary thread the output is as if --call-graph=none was specified. Following the rationale in that commit, move the libunwind fields into struct map_groups and update the libunwind functions to take this instead of the struct thread. This is only required for unwind__finish_access which must now be called from map_groups__delete and the others are changed for symmetry. Note that unwind__get_entries keeps the thread argument since it is required for symbol lookup and the libdw unwind provider uses the thread ID. Signed-off-by: John Keeping <john@metanate.com> Reviewed-by: Jiri Olsa <jolsa@kernel.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Konstantin Khlebnikov <khlebnikov@yandex-team.ru> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Fixes: e5adfc3e7e77 ("perf map: Synthesize maps only for thread group leader") Link: http://lkml.kernel.org/r/20190815100146.28842-2-john@metanate.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools/perf/util/map_groups.h')
-rw-r--r--tools/perf/util/map_groups.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/perf/util/map_groups.h b/tools/perf/util/map_groups.h
index 4dcda33e0fdf..db1e4ffc2276 100644
--- a/tools/perf/util/map_groups.h
+++ b/tools/perf/util/map_groups.h
@@ -31,6 +31,10 @@ struct map_groups {
struct maps maps;
struct machine *machine;
refcount_t refcnt;
+#ifdef HAVE_LIBUNWIND_SUPPORT
+ void *addr_space;
+ struct unwind_libunwind_ops *unwind_libunwind_ops;
+#endif
};
#define KMAP_NAME_LEN 256