Beispiel #1
0
static void __insert_vm_struct(struct mm_struct *mm, struct vm_area_struct *vma)
{
	struct vm_area_struct *__vma, *prev;
	struct rb_node **rb_link, *rb_parent;

	__vma = find_vma_prepare(mm, vma->vm_start,&prev, &rb_link, &rb_parent);
	BUG_ON(__vma && __vma->vm_start < vma->vm_end);
	__vma_link(mm, vma, prev, rb_link, rb_parent);
	mm->map_count++;
}
Beispiel #2
0
char *task_mem(struct mm_struct *mm, char *buffer)
{
	unsigned long data, text, lib;
#ifdef CONFIG_REALTEK_SHOW_MALLOC_SIZE
	struct vm_area_struct * vma, * prev;
	unsigned long addr, size;

	size = mm->brk-mm->start_brk;
	addr = my_get_unmapped_area(mm, 0, 256*1024, 0, MAP_PRIVATE|MAP_ANONYMOUS);
//	printk("addr: %x \n", addr);
	if (addr > 0) {
		vma = find_vma_prepare(mm, addr, &prev);
		if ((prev) && !(prev->vm_flags & VM_EXEC))
			size += prev->vm_end-prev->vm_start;
//		printk("malloc size: %x \n", size);
	}
#endif
	data = mm->total_vm - mm->shared_vm - mm->stack_vm;
	text = (PAGE_ALIGN(mm->end_code) - (mm->start_code & PAGE_MASK)) >> 10;
	lib = (mm->exec_vm << (PAGE_SHIFT-10)) - text;
	buffer += sprintf(buffer,
		"sbrk:\t%x \n"
		"ebrk:\t%x \n"
#ifdef CONFIG_REALTEK_SHOW_MALLOC_SIZE
		"malloc:\t%8lu kb\n"
#endif
		"VmSize:\t%8lu kB\n"
		"VmLck:\t%8lu kB\n"
		"VmRSS:\t%8lu kB\n"
		"VmARSS:\t%8lu kB\n"
		"VmData:\t%8lu kB\n"
		"VmStk:\t%8lu kB\n"
		"VmExe:\t%8lu kB\n"
		"VmLib:\t%8lu kB\n"
		"VmPTE:\t%8lu kB\n",
		mm->start_brk,
		mm->brk,
#ifdef CONFIG_REALTEK_SHOW_MALLOC_SIZE
		size >> (PAGE_SHIFT-2),
#endif
		(mm->total_vm - mm->reserved_vm) << (PAGE_SHIFT-10),
		mm->locked_vm << (PAGE_SHIFT-10),
		get_mm_counter(mm, rss) << (PAGE_SHIFT-10),
		get_mm_counter(mm, anon_rss) << (PAGE_SHIFT-10),
		data << (PAGE_SHIFT-10),
		mm->stack_vm << (PAGE_SHIFT-10), text, lib,
		(PTRS_PER_PTE*sizeof(pte_t)*mm->nr_ptes) >> 10);
	return buffer;
}