4 #include <sys/syscall.h> 36 PROT_READ|PROT_WRITE|PROT_EXEC,
37 MAP_SHARED|MAP_ANONYMOUS, -1, 0);
39 if (map == MAP_FAILED) {
40 perror(
"mmap failed");
61 ret = write(td->
ready[1], &go,
sizeof(
int));
62 if (ret !=
sizeof(
int)) {
63 pr_err(
"failed to notify\n");
87 ssize_t ret = read(td->
ready[0], &go,
sizeof(
int));
88 err = ret !=
sizeof(int);
107 for (i = 1; !err && i <
THREADS; i++)
123 for (i = 1; !err && i <
THREADS; i++)
171 err = synth(machine);
182 for (i = 0; i <
THREADS; i++) {
192 (
unsigned long) (td->
map + 1), &al);
197 pr_debug(
"failed, couldn't find map\n");
static int mmap_events(synth_cb synth)
static int synth_process(struct machine *machine)
struct map * thread__find_map(struct thread *thread, u8 cpumode, u64 addr, struct addr_location *al)
static int thread_init(struct thread_data *td)
#define TEST_ASSERT_VAL(text, cond)
static int thread_create(int i)
struct thread_map * thread_map__new_by_pid(pid_t pid)
static int threads_destroy(void)
int(* synth_cb)(struct machine *machine)
int perf_event__process(struct perf_tool *tool __maybe_unused, union perf_event *event, struct perf_sample *sample, struct machine *machine)
#define pr_debug(fmt,...)
int perf_event__synthesize_threads(struct perf_tool *tool, perf_event__handler_t process, struct machine *machine, bool mmap_data, unsigned int proc_map_timeout, unsigned int nr_threads_synthesize)
static void * thread_fn(void *arg)
void thread__put(struct thread *thread)
static int synth_all(struct machine *machine)
void machine__delete(struct machine *machine)
int perf_event__synthesize_thread_map(struct perf_tool *tool, struct thread_map *threads, perf_event__handler_t process, struct machine *machine, bool mmap_data, unsigned int proc_map_timeout)
static int threads_create(void)
struct machine * machine__new_host(void)
void thread_map__put(struct thread_map *map)
int test__mmap_thread_lookup(struct test *test __maybe_unused, int subtest __maybe_unused)
void machine__delete_threads(struct machine *machine)
struct thread * machine__findnew_thread(struct machine *machine, pid_t pid, pid_t tid)