2 #include <linux/compiler.h> 3 #include <linux/types.h> 10 #include "../util/unwind.h" 11 #include "perf_regs.h" 16 #if defined (__x86_64__) || defined (__i386__) || defined (__powerpc__) 17 #include "arch-tests.h" 57 unsigned long *cnt = (
unsigned long *) arg;
60 "test__arch_unwind_sample",
61 "test_dwarf_unwind__thread",
62 "test_dwarf_unwind__compare",
64 "test_dwarf_unwind__krava_3",
65 "test_dwarf_unwind__krava_2",
66 "test_dwarf_unwind__krava_1",
82 pr_debug(
"failed: got unresolved address 0x%" PRIx64
"\n",
88 pr_debug(
"got: %s 0x%" PRIx64
", expecting %s\n",
89 symbol, entry->
ip, funcs[idx]);
90 return strcmp((
const char *) symbol, funcs[idx]);
96 unsigned long cnt = 0;
99 memset(&sample, 0,
sizeof(sample));
102 pr_debug(
"failed to get unwind sample\n");
111 pr_debug(
"got wrong number of stack entries %lu != %d\n",
127 struct thread *thread = *(
struct thread **)p1;
145 struct thread *
array[2] = {thread, thread};
153 void *(*
volatile _bsearch)(
void *,
void *,
size_t,
154 size_t,
int (*)(
void *,
void *));
157 _bsearch(array, &thread, 2,
sizeof(
struct thread **),
175 struct thread *thread;
180 pr_err(
"Could not get machine\n");
185 pr_err(
"Failed to create kernel maps\n");
193 pr_err(
"Could not init machine\n");
202 pr_err(
"Could not get thread\n");
int machine__process_mmap2_event(struct machine *machine, union perf_event *event, struct perf_sample *sample)
int perf_event__synthesize_mmap_events(struct perf_tool *tool, union perf_event *event, pid_t pid, pid_t tgid, perf_event__handler_t process, struct machine *machine, bool mmap_data, unsigned int proc_map_timeout)
int machine__create_kernel_maps(struct machine *machine)
static int global_unwind_retval
enum perf_call_graph_mode record_mode
x86 movsq based memset() in arch/x86/lib/memset_64.S") MEMSET_FN(memset_erms
int unwind__get_entries(unwind_entry_cb_t cb, void *arg, struct thread *thread, struct perf_sample *data, int max_stack)
struct thread * machine__find_thread(struct machine *machine, pid_t pid, pid_t tid)
bool dwarf_callchain_users
#define pr_debug(fmt,...)
static int entry(u64 ip, struct unwind_info *ui)
struct regs_dump user_regs
static struct perf_tool tool
int test_dwarf_unwind__thread(struct thread *thread)
int test__dwarf_unwind(struct test *test __maybe_unused, int subtest __maybe_unused)
int test_dwarf_unwind__krava_3(struct thread *thread)
static int mmap_handler(struct perf_tool *tool __maybe_unused, union perf_event *event, struct perf_sample *sample, struct machine *machine)
void thread__put(struct thread *thread)
int test_dwarf_unwind__krava_2(struct thread *thread)
int test_dwarf_unwind__krava_1(struct thread *thread)
static int init_live_machine(struct machine *machine)
void machine__delete(struct machine *machine)
struct machine * machine__new_host(void)
int test__arch_unwind_sample(struct perf_sample *sample, struct thread *thread)
int test_dwarf_unwind__compare(void *p1, void *p2)
void machine__delete_threads(struct machine *machine)
struct stack_dump user_stack
size_t machine__fprintf(struct machine *machine, FILE *fp)
static int unwind_entry(struct unwind_entry *entry, void *arg)