Lines Matching refs:tinfo
279 perf_event_read_bts (btrace_target_info *tinfo, const uint8_t *begin,
291 reg_buffer_common *regcache = get_thread_regcache_for_ptid (tinfo->ptid);
522 std::unique_ptr<linux_btrace_target_info> tinfo
525 tinfo->conf.format = BTRACE_FORMAT_BTS;
527 tinfo->attr.size = sizeof (tinfo->attr);
528 tinfo->attr.type = PERF_TYPE_HARDWARE;
529 tinfo->attr.config = PERF_COUNT_HW_BRANCH_INSTRUCTIONS;
530 tinfo->attr.sample_period = 1;
533 tinfo->attr.sample_type = PERF_SAMPLE_IP | PERF_SAMPLE_ADDR;
535 tinfo->attr.exclude_kernel = 1;
536 tinfo->attr.exclude_hv = 1;
537 tinfo->attr.exclude_idle = 1;
544 scoped_fd fd (syscall (SYS_perf_event_open, &tinfo->attr, pid, -1, -1, 0));
612 tinfo->pev.size = size;
613 tinfo->pev.data_head = &header->data_head;
614 tinfo->pev.mem = (const uint8_t *) data.release () + data_offset;
615 tinfo->pev.last_head = 0ull;
616 tinfo->header = header;
617 tinfo->file = fd.release ();
619 tinfo->conf.bts.size = (unsigned int) size;
620 return tinfo.release ();
671 std::unique_ptr<linux_btrace_target_info> tinfo
674 tinfo->conf.format = BTRACE_FORMAT_PT;
676 tinfo->attr.size = sizeof (tinfo->attr);
677 tinfo->attr.type = perf_event_pt_event_type ();
679 tinfo->attr.exclude_kernel = 1;
680 tinfo->attr.exclude_hv = 1;
681 tinfo->attr.exclude_idle = 1;
685 tinfo->attr.config |= linux_read_pt_config_bitmask ("ptw");
686 tinfo->conf.pt.ptwrite = true;
693 tinfo->attr.config |= linux_read_pt_config_bitmask ("event");
694 tinfo->conf.pt.event_tracing = true;
701 scoped_fd fd (syscall (SYS_perf_event_open, &tinfo->attr, pid, -1, -1, 0));
761 tinfo->pev.size = aux.size ();
762 tinfo->pev.mem = (const uint8_t *) aux.release ();
763 tinfo->pev.data_head = &header->aux_head;
764 tinfo->header = (struct perf_event_mmap_page *) data.release ();
765 gdb_assert (tinfo->header == header);
766 tinfo->file = fd.release ();
768 tinfo->conf.pt.size = (unsigned int) tinfo->pev.size;
769 return tinfo.release ();
806 linux_disable_bts (struct linux_btrace_target_info *tinfo)
808 munmap ((void *) tinfo->header, tinfo->pev.size + PAGE_SIZE);
809 close (tinfo->file);
815 linux_disable_pt (struct linux_btrace_target_info *tinfo)
817 munmap ((void *) tinfo->pev.mem, tinfo->pev.size);
818 munmap ((void *) tinfo->header, PAGE_SIZE);
819 close (tinfo->file);
827 linux_btrace_target_info *tinfo
830 switch (tinfo->conf.format)
836 linux_disable_bts (tinfo);
837 delete tinfo;
841 linux_disable_pt (tinfo);
842 delete tinfo;
849 /* Read branch trace data in BTS format for the thread given by TINFO into
853 linux_read_bts (btrace_data_bts *btrace, linux_btrace_target_info *tinfo,
863 if (type == BTRACE_READ_NEW && !perf_event_new_data (&tinfo->pev))
866 buffer_size = tinfo->pev.size;
867 data_tail = tinfo->pev.last_head;
872 data_head = *tinfo->pev.data_head;
910 begin = tinfo->pev.mem;
916 end = begin + tinfo->pev.size;
918 btrace->blocks = perf_event_read_bts (tinfo, begin, end, start, size);
925 if (data_head == *tinfo->pev.data_head)
929 tinfo->pev.last_head = data_head;
949 given by TINFO into BTRACE using the TYPE reading method. */
952 linux_read_pt (btrace_data_pt *btrace, linux_btrace_target_info *tinfo,
965 if (!perf_event_new_data (&tinfo->pev))
969 perf_event_read_all (&tinfo->pev, &btrace->data, &btrace->size);
983 linux_btrace_target_info *tinfo
986 switch (tinfo->conf.format)
996 return linux_read_bts (&btrace->variant.bts, tinfo, type);
1004 return linux_read_pt (&btrace->variant.pt, tinfo, type);
1013 linux_btrace_conf (const struct btrace_target_info *tinfo)
1015 return &tinfo->conf;
1031 linux_disable_btrace (struct btrace_target_info *tinfo)
1040 struct btrace_target_info *tinfo,
1049 linux_btrace_conf (const struct btrace_target_info *tinfo)