Lines Matching refs:trace_data
58 static void FreePtrs(TraceDataType* trace_data) { in FreePtrs() argument
59 for (size_t i = 0; i < trace_data->num_ptrs; i++) { in FreePtrs()
60 void* ptr = trace_data->ptrs[i]; in FreePtrs()
63 trace_data->ptrs[i] = nullptr; in FreePtrs()
68 static void FreeTraceData(TraceDataType* trace_data) { in FreeTraceData() argument
69 if (trace_data->ptrs == nullptr) { in FreeTraceData()
73 munmap(trace_data->ptrs, sizeof(void*) * trace_data->num_ptrs); in FreeTraceData()
74 FreeEntries(trace_data->entries, trace_data->num_entries); in FreeTraceData()
77 static void GetTraceData(const std::string& filename, TraceDataType* trace_data) { in GetTraceData() argument
82 *trace_data = cached_trace_data; in GetTraceData()
89 GetUnwindInfo(filename.c_str(), &trace_data->entries, &trace_data->num_entries); in GetTraceData()
98 trace_data->num_ptrs = 0; in GetTraceData()
101 for (size_t i = 0; i < trace_data->num_entries; i++) { in GetTraceData()
102 AllocEntry* entry = &trace_data->entries[i]; in GetTraceData()
107 size_t idx = GetIndex(free_indices, &trace_data->num_ptrs); in GetTraceData()
123 size_t idx = GetIndex(free_indices, &trace_data->num_ptrs); in GetTraceData()
143 …void* map = mmap(nullptr, sizeof(void*) * trace_data->num_ptrs, PROT_READ | PROT_WRITE, MAP_ANON |… in GetTraceData()
147 trace_data->ptrs = reinterpret_cast<void**>(map); in GetTraceData()
149 cached_trace_data = *trace_data; in GetTraceData()
152 static void RunTrace(benchmark::State& state, TraceDataType* trace_data) { in RunTrace() argument
156 void** ptrs = trace_data->ptrs; in RunTrace()
157 for (size_t i = 0; i < trace_data->num_entries; i++) { in RunTrace()
159 const AllocEntry& entry = trace_data->entries[i]; in RunTrace()
246 FreePtrs(trace_data); in RunTrace()
262 TraceDataType trace_data; in BenchmarkTrace() local
263 GetTraceData(full_filename, &trace_data); in BenchmarkTrace()
266 RunTrace(state, &trace_data); in BenchmarkTrace()