• Home
  • Raw
  • Download

Lines Matching refs:ptr

245 	struct intel_pt_recording *ptr =  in intel_pt_parse_snapshot_options()  local
259 ptr->snapshot_size = snapshot_size; in intel_pt_parse_snapshot_options()
303 struct intel_pt_recording *ptr = in intel_pt_info_priv_size() local
305 const char *filter = intel_pt_find_filter(evlist, ptr->intel_pt_pmu); in intel_pt_info_priv_size()
307 ptr->priv_size = (INTEL_PT_AUXTRACE_PRIV_MAX * sizeof(u64)) + in intel_pt_info_priv_size()
310 return ptr->priv_size; in intel_pt_info_priv_size()
327 struct intel_pt_recording *ptr = in intel_pt_info_fill() local
329 struct perf_pmu *intel_pt_pmu = ptr->intel_pt_pmu; in intel_pt_info_fill()
341 if (priv_size != ptr->priv_size) in intel_pt_info_fill()
361 filter = intel_pt_find_filter(session->evlist, ptr->intel_pt_pmu); in intel_pt_info_fill()
390 auxtrace_info->priv[INTEL_PT_HAVE_SCHED_SWITCH] = ptr->have_sched_switch; in intel_pt_info_fill()
391 auxtrace_info->priv[INTEL_PT_SNAPSHOT_MODE] = ptr->snapshot_mode; in intel_pt_info_fill()
623 struct intel_pt_recording *ptr = in intel_pt_recording_options() local
625 struct perf_pmu *intel_pt_pmu = ptr->intel_pt_pmu; in intel_pt_recording_options()
633 ptr->evlist = evlist; in intel_pt_recording_options()
634 ptr->snapshot_mode = opts->auxtrace_snapshot_mode; in intel_pt_recording_options()
826 ptr->have_sched_switch = 3; in intel_pt_recording_options()
831 ptr->have_sched_switch = 3; in intel_pt_recording_options()
833 ptr->have_sched_switch = 2; in intel_pt_recording_options()
842 ptr->have_sched_switch = 1; in intel_pt_recording_options()
896 if (!ptr->have_sched_switch && !perf_cpu_map__empty(cpus) && in intel_pt_recording_options()
906 struct intel_pt_recording *ptr = in intel_pt_snapshot_start() local
910 evlist__for_each_entry(ptr->evlist, evsel) { in intel_pt_snapshot_start()
911 if (evsel->core.attr.type == ptr->intel_pt_pmu->type) in intel_pt_snapshot_start()
919 struct intel_pt_recording *ptr = in intel_pt_snapshot_finish() local
923 evlist__for_each_entry(ptr->evlist, evsel) { in intel_pt_snapshot_finish()
924 if (evsel->core.attr.type == ptr->intel_pt_pmu->type) in intel_pt_snapshot_finish()
930 static int intel_pt_alloc_snapshot_refs(struct intel_pt_recording *ptr, int idx) in intel_pt_alloc_snapshot_refs() argument
933 int cnt = ptr->snapshot_ref_cnt, new_cnt = cnt * 2; in intel_pt_alloc_snapshot_refs()
946 memcpy(refs, ptr->snapshot_refs, cnt * sz); in intel_pt_alloc_snapshot_refs()
948 ptr->snapshot_refs = refs; in intel_pt_alloc_snapshot_refs()
949 ptr->snapshot_ref_cnt = new_cnt; in intel_pt_alloc_snapshot_refs()
954 static void intel_pt_free_snapshot_refs(struct intel_pt_recording *ptr) in intel_pt_free_snapshot_refs() argument
958 for (i = 0; i < ptr->snapshot_ref_cnt; i++) in intel_pt_free_snapshot_refs()
959 zfree(&ptr->snapshot_refs[i].ref_buf); in intel_pt_free_snapshot_refs()
960 zfree(&ptr->snapshot_refs); in intel_pt_free_snapshot_refs()
965 struct intel_pt_recording *ptr = in intel_pt_recording_free() local
968 intel_pt_free_snapshot_refs(ptr); in intel_pt_recording_free()
969 free(ptr); in intel_pt_recording_free()
972 static int intel_pt_alloc_snapshot_ref(struct intel_pt_recording *ptr, int idx, in intel_pt_alloc_snapshot_ref() argument
975 size_t ref_buf_size = ptr->snapshot_ref_buf_size; in intel_pt_alloc_snapshot_ref()
982 ptr->snapshot_refs[idx].ref_buf = ref_buf; in intel_pt_alloc_snapshot_ref()
983 ptr->snapshot_refs[idx].ref_offset = snapshot_buf_size - ref_buf_size; in intel_pt_alloc_snapshot_ref()
988 static size_t intel_pt_snapshot_ref_buf_size(struct intel_pt_recording *ptr, in intel_pt_snapshot_ref_buf_size() argument
994 if (ptr->snapshot_size <= 64 * 1024) in intel_pt_snapshot_ref_buf_size()
997 psb_period = intel_pt_psb_period(ptr->intel_pt_pmu, ptr->evlist); in intel_pt_snapshot_ref_buf_size()
1007 if (buf_size >= ptr->snapshot_size / 2) in intel_pt_snapshot_ref_buf_size()
1013 static int intel_pt_snapshot_init(struct intel_pt_recording *ptr, in intel_pt_snapshot_init() argument
1016 if (ptr->snapshot_init_done) in intel_pt_snapshot_init()
1019 ptr->snapshot_init_done = true; in intel_pt_snapshot_init()
1021 ptr->snapshot_ref_buf_size = intel_pt_snapshot_ref_buf_size(ptr, in intel_pt_snapshot_init()
1086 static bool intel_pt_wrapped(struct intel_pt_recording *ptr, int idx, in intel_pt_wrapped() argument
1090 struct intel_pt_snapshot_ref *ref = &ptr->snapshot_refs[idx]; in intel_pt_wrapped()
1094 ptr->snapshot_ref_buf_size, mm->len, in intel_pt_wrapped()
1097 intel_pt_copy_ref(ref->ref_buf, ptr->snapshot_ref_buf_size, mm->len, in intel_pt_wrapped()
1124 struct intel_pt_recording *ptr = in intel_pt_find_snapshot() local
1132 err = intel_pt_snapshot_init(ptr, mm->len); in intel_pt_find_snapshot()
1136 if (idx >= ptr->snapshot_ref_cnt) { in intel_pt_find_snapshot()
1137 err = intel_pt_alloc_snapshot_refs(ptr, idx); in intel_pt_find_snapshot()
1142 if (ptr->snapshot_ref_buf_size) { in intel_pt_find_snapshot()
1143 if (!ptr->snapshot_refs[idx].ref_buf) { in intel_pt_find_snapshot()
1144 err = intel_pt_alloc_snapshot_ref(ptr, idx, mm->len); in intel_pt_find_snapshot()
1148 wrapped = intel_pt_wrapped(ptr, idx, mm, data, *head); in intel_pt_find_snapshot()
1150 wrapped = ptr->snapshot_refs[idx].wrapped; in intel_pt_find_snapshot()
1152 ptr->snapshot_refs[idx].wrapped = true; in intel_pt_find_snapshot()
1193 struct intel_pt_recording *ptr; in intel_pt_recording_init() local
1203 ptr = zalloc(sizeof(struct intel_pt_recording)); in intel_pt_recording_init()
1204 if (!ptr) { in intel_pt_recording_init()
1209 ptr->intel_pt_pmu = intel_pt_pmu; in intel_pt_recording_init()
1210 ptr->itr.pmu = intel_pt_pmu; in intel_pt_recording_init()
1211 ptr->itr.recording_options = intel_pt_recording_options; in intel_pt_recording_init()
1212 ptr->itr.info_priv_size = intel_pt_info_priv_size; in intel_pt_recording_init()
1213 ptr->itr.info_fill = intel_pt_info_fill; in intel_pt_recording_init()
1214 ptr->itr.free = intel_pt_recording_free; in intel_pt_recording_init()
1215 ptr->itr.snapshot_start = intel_pt_snapshot_start; in intel_pt_recording_init()
1216 ptr->itr.snapshot_finish = intel_pt_snapshot_finish; in intel_pt_recording_init()
1217 ptr->itr.find_snapshot = intel_pt_find_snapshot; in intel_pt_recording_init()
1218 ptr->itr.parse_snapshot_options = intel_pt_parse_snapshot_options; in intel_pt_recording_init()
1219 ptr->itr.reference = intel_pt_reference; in intel_pt_recording_init()
1220 ptr->itr.read_finish = auxtrace_record__read_finish; in intel_pt_recording_init()
1225 ptr->itr.default_aux_sample_size = 4096; in intel_pt_recording_init()
1226 return &ptr->itr; in intel_pt_recording_init()