}
 
 static int read_object_code(u64 addr, size_t len, u8 cpumode,
-                           struct thread *thread, struct machine *machine,
-                           struct state *state)
+                           struct thread *thread, struct state *state)
 {
        struct addr_location al;
        unsigned char buf1[BUFSZ];
                len = al.map->end - addr;
 
        /* Read the object code using perf */
-       ret_len = dso__data_read_offset(al.map->dso, machine, al.addr, buf1,
-                                       len);
+       ret_len = dso__data_read_offset(al.map->dso, thread->mg->machine,
+                                       al.addr, buf1, len);
        if (ret_len != len) {
                pr_debug("dso__data_read_offset failed\n");
                return -1;
 
        cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK;
 
-       return read_object_code(sample.ip, READLEN, cpumode, thread, machine,
-                               state);
+       return read_object_code(sample.ip, READLEN, cpumode, thread, state);
 }
 
 static int process_event(struct machine *machine, struct perf_evlist *evlist,