Lines Matching refs:pages
56 struct ksm_page *pages; member
180 qsort(kp.pages, kp.len, sizeof(*kp.pages), cmp_pages); in main()
262 if (kp->pages[k].hash == hash) break; in read_pages()
267 struct ksm_page *tmp = realloc(kp->pages, in read_pages()
268 (kp->size + GROWTH_FACTOR) * sizeof(*kp->pages)); in read_pages()
276 kp->pages = tmp; in read_pages()
279 rc = pm_kernel_count(ker, PM_PAGEMAP_PFN(pagemap[j]), &kp->pages[kp->len].count); in read_pages()
285 kp->pages[kp->len].hash = hash; in read_pages()
286 kp->pages[kp->len].pattern = in read_pages()
292 cur_page = &kp->pages[k]; in read_pages()
331 free(kp->pages[i].vaddr); in read_pages()
334 free(kp->pages); in read_pages()
349 if (kp->pages[i].pattern != NO_PATTERN) { in print_pages()
350 printf("0x%02x byte pattern: ", kp->pages[i].pattern); in print_pages()
352 printf("KSM CRC 0x%08x:", kp->pages[i].hash); in print_pages()
354 printf(" %4zu page", kp->pages[i].vaddr_count); in print_pages()
355 if (kp->pages[i].vaddr_count > 1) { in print_pages()
359 printf(" (%" PRIu64 " reference", kp->pages[i].count); in print_pages()
360 if (kp->pages[i].count > 1) { in print_pages()
369 while (j < kp->pages[i].vaddr_len) { in print_pages()
371 for (k = 0; k < 8 && j < kp->pages[i].vaddr_len; k++, j++) { in print_pages()
372 printf(" 0x%08lx", kp->pages[i].vaddr[j].addr); in print_pages()
375 kp->pages[i].vaddr[j].num_pages); in print_pages()
378 kp->pages[i].vaddr[j].pid); in print_pages()
393 free(kp->pages[i].vaddr); in free_pages()
396 free(kp->pages); in free_pages()