Home | History | Annotate | Download | only in util

Lines Matching refs:cpu_data

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