.. | .. |
---|
1 | 1 | // SPDX-License-Identifier: GPL-2.0 |
---|
2 | 2 | #include <linux/compiler.h> |
---|
3 | 3 | #include <linux/types.h> |
---|
| 4 | +#include <linux/zalloc.h> |
---|
4 | 5 | #include <inttypes.h> |
---|
| 6 | +#include <limits.h> |
---|
5 | 7 | #include <unistd.h> |
---|
6 | 8 | #include "tests.h" |
---|
7 | 9 | #include "debug.h" |
---|
.. | .. |
---|
10 | 12 | #include "../util/unwind.h" |
---|
11 | 13 | #include "perf_regs.h" |
---|
12 | 14 | #include "map.h" |
---|
| 15 | +#include "symbol.h" |
---|
13 | 16 | #include "thread.h" |
---|
14 | 17 | #include "callchain.h" |
---|
| 18 | +#include "util/synthetic-events.h" |
---|
15 | 19 | |
---|
16 | 20 | #if defined (__x86_64__) || defined (__i386__) || defined (__powerpc__) |
---|
17 | 21 | #include "arch-tests.h" |
---|
.. | .. |
---|
33 | 37 | union perf_event event; |
---|
34 | 38 | pid_t pid = getpid(); |
---|
35 | 39 | |
---|
| 40 | + memset(&event, 0, sizeof(event)); |
---|
36 | 41 | return perf_event__synthesize_mmap_events(NULL, &event, pid, pid, |
---|
37 | | - mmap_handler, machine, true, 500); |
---|
| 42 | + mmap_handler, machine, true); |
---|
38 | 43 | } |
---|
39 | 44 | |
---|
40 | 45 | /* |
---|
.. | .. |
---|
55 | 60 | static int unwind_entry(struct unwind_entry *entry, void *arg) |
---|
56 | 61 | { |
---|
57 | 62 | unsigned long *cnt = (unsigned long *) arg; |
---|
58 | | - char *symbol = entry->sym ? entry->sym->name : NULL; |
---|
| 63 | + char *symbol = entry->ms.sym ? entry->ms.sym->name : NULL; |
---|
59 | 64 | static const char *funcs[MAX_STACK] = { |
---|
60 | 65 | "test__arch_unwind_sample", |
---|
61 | 66 | "test_dwarf_unwind__thread", |
---|
.. | .. |
---|
114 | 119 | } |
---|
115 | 120 | |
---|
116 | 121 | out: |
---|
117 | | - free(sample.user_stack.data); |
---|
118 | | - free(sample.user_regs.regs); |
---|
| 122 | + zfree(&sample.user_stack.data); |
---|
| 123 | + zfree(&sample.user_regs.regs); |
---|
119 | 124 | return err; |
---|
120 | 125 | } |
---|
121 | 126 | |
---|