perf tools: Export normalize_arch() function
[deliverable/linux.git] / tools / perf / util / unwind-libunwind.c
CommitLineData
f6d72532
HK
1#include "unwind.h"
2#include "thread.h"
3
4struct unwind_libunwind_ops __weak *local_unwind_libunwind_ops;
5
6static void unwind__register_ops(struct thread *thread,
7 struct unwind_libunwind_ops *ops)
8{
9 thread->unwind_libunwind_ops = ops;
10}
11
12int unwind__prepare_access(struct thread *thread)
13{
14 unwind__register_ops(thread, local_unwind_libunwind_ops);
15
16 return thread->unwind_libunwind_ops->prepare_access(thread);
17}
18
19void unwind__flush_access(struct thread *thread)
20{
21 if (thread->unwind_libunwind_ops)
22 thread->unwind_libunwind_ops->flush_access(thread);
23}
24
25void unwind__finish_access(struct thread *thread)
26{
27 if (thread->unwind_libunwind_ops)
28 thread->unwind_libunwind_ops->finish_access(thread);
29}
30
31int unwind__get_entries(unwind_entry_cb_t cb, void *arg,
32 struct thread *thread,
33 struct perf_sample *data, int max_stack)
34{
35 if (thread->unwind_libunwind_ops)
36 return thread->unwind_libunwind_ops->get_entries(cb, arg, thread, data, max_stack);
37 return 0;
38}
This page took 0.026492 seconds and 5 git commands to generate.