From bc23dda642a299fb1380294f4e5940511bc512ef Mon Sep 17 00:00:00 2001 From: Richard Braun Date: Fri, 5 Aug 2016 15:00:07 +0200 Subject: Augment VM maps with task names This change improves the clarity of "no more room for ..." VM map allocation errors. * kern/task.c (task_init): Call vm_map_set_name for the kernel map. (task_create): Call vm_map_set_name where appropriate. * vm/vm_map.c (vm_map_setup): Set map name to NULL. (vm_map_find_entry_anywhere): Update error message to include map name. * vm/vm_map.h (struct vm_map): New `name' member. (vm_map_set_name): New inline function. --- vm/vm_map.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'vm/vm_map.c') diff --git a/vm/vm_map.c b/vm/vm_map.c index 4490878d..ccbe8f1a 100644 --- a/vm/vm_map.c +++ b/vm/vm_map.c @@ -195,6 +195,7 @@ void vm_map_setup( map->wait_for_space = FALSE; map->first_free = vm_map_to_entry(map); map->hint = vm_map_to_entry(map); + map->name = NULL; vm_map_lock_init(map); simple_lock_init(&map->ref_lock); simple_lock_init(&map->hint_lock); @@ -704,7 +705,7 @@ restart: return entry; error: - printf("no more room in %p\n", map); + printf("no more room in %p (%s)\n", map, map->name); return NULL; } -- cgit v1.2.3