Lines Matching refs:cpu_data
282 struct cpu_data { struct
293 static struct cpu_data *cpu_data; argument
297 cpu_data[cpu].offset += page_size; in update_cpu_data_index()
298 cpu_data[cpu].size -= page_size; in update_cpu_data_index()
299 cpu_data[cpu].index = 0; in update_cpu_data_index()
307 if (!cpu_data[cpu].page) in get_next_page()
311 if (cpu_data[cpu].size <= page_size) { in get_next_page()
312 free(cpu_data[cpu].page); in get_next_page()
313 cpu_data[cpu].page = NULL; in get_next_page()
322 ret = lseek(input_fd, cpu_data[cpu].offset, SEEK_SET); in get_next_page()
325 ret = read(input_fd, cpu_data[cpu].page, page_size); in get_next_page()
335 munmap(cpu_data[cpu].page, page_size); in get_next_page()
336 cpu_data[cpu].page = NULL; in get_next_page()
338 if (cpu_data[cpu].size <= page_size) in get_next_page()
343 cpu_data[cpu].page = mmap(NULL, page_size, PROT_READ, MAP_PRIVATE, in get_next_page()
344 input_fd, cpu_data[cpu].offset); in get_next_page()
345 if (cpu_data[cpu].page == MAP_FAILED) in get_next_page()
347 cpu, cpu_data[cpu].offset); in get_next_page()
368 return (unsigned long)ptr - (unsigned long)cpu_data[cpu].page; in calc_index()
374 void *page = cpu_data[cpu].page; in trace_peek_data()
375 int idx = cpu_data[cpu].index; in trace_peek_data()
383 if (cpu_data[cpu].next) in trace_peek_data()
384 return cpu_data[cpu].next; in trace_peek_data()
393 cpu_data[cpu].timestamp = data2host8(ptr); in trace_peek_data()
397 cpu_data[cpu].page_size = data2host4(ptr); in trace_peek_data()
401 cpu_data[cpu].page_size = data2host8(ptr); in trace_peek_data()
407 ptr = cpu_data[cpu].page + header_page_data_offset; in trace_peek_data()
413 if (idx >= cpu_data[cpu].page_size) { in trace_peek_data()
439 cpu_data[cpu].timestamp += extend; in trace_peek_data()
455 cpu_data[cpu].timestamp += delta; in trace_peek_data()
460 data->ts = cpu_data[cpu].timestamp; in trace_peek_data()
465 cpu_data[cpu].index = calc_index(ptr, cpu); in trace_peek_data()
466 cpu_data[cpu].next = data; in trace_peek_data()
476 cpu_data[cpu].next = NULL; in trace_read_data()