Lines Matching defs:ptr

245 	struct intel_pt_recording *ptr =
259 ptr->snapshot_size = snapshot_size;
303 struct intel_pt_recording *ptr =
305 const char *filter = intel_pt_find_filter(evlist, ptr->intel_pt_pmu);
307 ptr->priv_size = (INTEL_PT_AUXTRACE_PRIV_MAX * sizeof(u64)) +
310 return ptr->priv_size;
327 struct intel_pt_recording *ptr =
329 struct perf_pmu *intel_pt_pmu = ptr->intel_pt_pmu;
341 if (priv_size != ptr->priv_size)
361 filter = intel_pt_find_filter(session->evlist, ptr->intel_pt_pmu);
390 auxtrace_info->priv[INTEL_PT_HAVE_SCHED_SWITCH] = ptr->have_sched_switch;
391 auxtrace_info->priv[INTEL_PT_SNAPSHOT_MODE] = ptr->snapshot_mode;
623 struct intel_pt_recording *ptr =
625 struct perf_pmu *intel_pt_pmu = ptr->intel_pt_pmu;
633 ptr->evlist = evlist;
634 ptr->snapshot_mode = opts->auxtrace_snapshot_mode;
820 ptr->have_sched_switch = 3;
825 ptr->have_sched_switch = 3;
827 ptr->have_sched_switch = 2;
836 ptr->have_sched_switch = 1;
890 if (!ptr->have_sched_switch && !perf_cpu_map__empty(cpus) &&
900 struct intel_pt_recording *ptr =
904 evlist__for_each_entry(ptr->evlist, evsel) {
905 if (evsel->core.attr.type == ptr->intel_pt_pmu->type)
913 struct intel_pt_recording *ptr =
917 evlist__for_each_entry(ptr->evlist, evsel) {
918 if (evsel->core.attr.type == ptr->intel_pt_pmu->type)
924 static int intel_pt_alloc_snapshot_refs(struct intel_pt_recording *ptr, int idx)
927 int cnt = ptr->snapshot_ref_cnt, new_cnt = cnt * 2;
940 memcpy(refs, ptr->snapshot_refs, cnt * sz);
942 ptr->snapshot_refs = refs;
943 ptr->snapshot_ref_cnt = new_cnt;
948 static void intel_pt_free_snapshot_refs(struct intel_pt_recording *ptr)
952 for (i = 0; i < ptr->snapshot_ref_cnt; i++)
953 zfree(&ptr->snapshot_refs[i].ref_buf);
954 zfree(&ptr->snapshot_refs);
959 struct intel_pt_recording *ptr =
962 intel_pt_free_snapshot_refs(ptr);
963 free(ptr);
966 static int intel_pt_alloc_snapshot_ref(struct intel_pt_recording *ptr, int idx,
969 size_t ref_buf_size = ptr->snapshot_ref_buf_size;
976 ptr->snapshot_refs[idx].ref_buf = ref_buf;
977 ptr->snapshot_refs[idx].ref_offset = snapshot_buf_size - ref_buf_size;
982 static size_t intel_pt_snapshot_ref_buf_size(struct intel_pt_recording *ptr,
988 if (ptr->snapshot_size <= 64 * 1024)
991 psb_period = intel_pt_psb_period(ptr->intel_pt_pmu, ptr->evlist);
1001 if (buf_size >= ptr->snapshot_size / 2)
1007 static int intel_pt_snapshot_init(struct intel_pt_recording *ptr,
1010 if (ptr->snapshot_init_done)
1013 ptr->snapshot_init_done = true;
1015 ptr->snapshot_ref_buf_size = intel_pt_snapshot_ref_buf_size(ptr,
1080 static bool intel_pt_wrapped(struct intel_pt_recording *ptr, int idx,
1084 struct intel_pt_snapshot_ref *ref = &ptr->snapshot_refs[idx];
1088 ptr->snapshot_ref_buf_size, mm->len,
1091 intel_pt_copy_ref(ref->ref_buf, ptr->snapshot_ref_buf_size, mm->len,
1118 struct intel_pt_recording *ptr =
1126 err = intel_pt_snapshot_init(ptr, mm->len);
1130 if (idx >= ptr->snapshot_ref_cnt) {
1131 err = intel_pt_alloc_snapshot_refs(ptr, idx);
1136 if (ptr->snapshot_ref_buf_size) {
1137 if (!ptr->snapshot_refs[idx].ref_buf) {
1138 err = intel_pt_alloc_snapshot_ref(ptr, idx, mm->len);
1142 wrapped = intel_pt_wrapped(ptr, idx, mm, data, *head);
1144 wrapped = ptr->snapshot_refs[idx].wrapped;
1146 ptr->snapshot_refs[idx].wrapped = true;
1187 struct intel_pt_recording *ptr;
1197 ptr = zalloc(sizeof(struct intel_pt_recording));
1198 if (!ptr) {
1203 ptr->intel_pt_pmu = intel_pt_pmu;
1204 ptr->itr.pmu = intel_pt_pmu;
1205 ptr->itr.recording_options = intel_pt_recording_options;
1206 ptr->itr.info_priv_size = intel_pt_info_priv_size;
1207 ptr->itr.info_fill = intel_pt_info_fill;
1208 ptr->itr.free = intel_pt_recording_free;
1209 ptr->itr.snapshot_start = intel_pt_snapshot_start;
1210 ptr->itr.snapshot_finish = intel_pt_snapshot_finish;
1211 ptr->itr.find_snapshot = intel_pt_find_snapshot;
1212 ptr->itr.parse_snapshot_options = intel_pt_parse_snapshot_options;
1213 ptr->itr.reference = intel_pt_reference;
1214 ptr->itr.read_finish = auxtrace_record__read_finish;
1219 ptr->itr.default_aux_sample_size = 4096;
1220 return &ptr->itr;