From 2cf980488c7ffafae4036dddefa92d9a8cf2b0db Mon Sep 17 00:00:00 2001 From: Maksym Planeta Date: Mon, 8 Oct 2012 16:38:31 +0200 Subject: Update debugging functions to make them inform caller about memory advice. * include/mach_debug/vm_info.h (vm_region_info_t): Add memory advice that is applied to region's information structure. (vm_object_info_t): Add memory advice that is applied to object's information structure. * vm/vm_debug.c (mach_vm_region_info): Function changed to inform caller about memory advice. (mach_vm_object_info): Likewise. --- include/mach_debug/vm_info.h | 2 ++ vm/vm_debug.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/include/mach_debug/vm_info.h b/include/mach_debug/vm_info.h index 70ba8878..35ac528f 100644 --- a/include/mach_debug/vm_info.h +++ b/include/mach_debug/vm_info.h @@ -52,6 +52,7 @@ typedef struct vm_region_info { /*vm_prot_t*/natural_t vri_protection; /* protection code */ /*vm_prot_t*/natural_t vri_max_protection; /* maximum protection */ /*vm_inherit_t*/natural_t vri_inheritance; /* inheritance */ +/*vm_advice_t*/natural_t vri_advice; /* advice */ natural_t vri_wired_count; /* number of times wired */ natural_t vri_user_wired_count; /* number of times user has wired */ @@ -90,6 +91,7 @@ typedef struct vm_object_info { vm_offset_t voi_paging_offset; /* offset into memory object */ /*memory_object_copy_strategy_t*/integer_t voi_copy_strategy; /* how to handle data copy */ +/*vm_advice_t*/natural_t voi_advice; /* how to handle data copy */ vm_offset_t voi_last_alloc; /* offset of last allocation */ natural_t voi_paging_in_progress; /* paging references */ vm_object_info_state_t voi_state; /* random state bits */ diff --git a/vm/vm_debug.c b/vm/vm_debug.c index 0af58b69..3527ef63 100644 --- a/vm/vm_debug.c +++ b/vm/vm_debug.c @@ -157,6 +157,7 @@ mach_vm_region_info(map, address, regionp, portp) regionp->vri_protection = entry->protection; regionp->vri_max_protection = entry->max_protection; regionp->vri_inheritance = entry->inheritance; + regionp->vri_advice = entry->advice; regionp->vri_wired_count = entry->wired_count; regionp->vri_user_wired_count = entry->user_wired_count; @@ -229,6 +230,7 @@ mach_vm_object_info(object, infop, shadowp, copyp) info.voi_shadow_offset = object->shadow_offset; info.voi_paging_offset = object->paging_offset; info.voi_copy_strategy = object->copy_strategy; + info.voi_advice = object->advice; info.voi_last_alloc = object->last_alloc; info.voi_paging_in_progress = object->paging_in_progress; -- cgit v1.2.3