From: Peter Dinda Date: Mon, 30 Jun 2014 22:35:59 +0000 (-0500) Subject: Minor cleanup in memory tracking X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=commitdiff_plain;h=6fa605075d1944da0a88a389122ea24bbc583329;p=palacios.git Minor cleanup in memory tracking --- diff --git a/linux_module/memtrack.c b/linux_module/memtrack.c index 367a473..b64ab29 100644 --- a/linux_module/memtrack.c +++ b/linux_module/memtrack.c @@ -89,15 +89,15 @@ static int memtrack_snap(struct v3_guest *guest, header_size = (uint64_t)&(temp.core[0]) - (uint64_t)&temp; core_header_size = (uint64_t)&(ctemp.access_bitmap) - (uint64_t)&ctemp; - INFO("offset_to_num_cores=%llu header_size=%llu core_header_size=%llu\n", - offset_to_num_cores, header_size, core_header_size); + // INFO("offset_to_num_cores=%llu header_size=%llu core_header_size=%llu\n", + // offset_to_num_cores, header_size, core_header_size); if (copy_from_user(&num_cores,((void __user *)arg) + offset_to_num_cores,sizeof(num_cores))) { ERROR("palacios: cannot copy number of cores from user\n"); goto fail; } - INFO("num_cores=%u",num_cores); + //INFO("num_cores=%u",num_cores); if (!(user_snap=palacios_alloc(sizeof(v3_mem_track_snapshot) + num_cores * sizeof(struct v3_core_mem_track)))) { ERROR("palacios: cannot allocate memory for copying user snapshot\n"); @@ -116,8 +116,8 @@ static int memtrack_snap(struct v3_guest *guest, goto fail; } - INFO("snapshot: numcores=%u, core[0].num_pages=%llu, request_numcores=%u\n", - sys_snap->num_cores, sys_snap->core[0].num_pages, num_cores); + //INFO("snapshot: numcores=%u, core[0].num_pages=%llu, request_numcores=%u\n", + // sys_snap->num_cores, sys_snap->core[0].num_pages, num_cores); // Copy the meta data if (copy_to_user((void __user *)arg, sys_snap, header_size)) { diff --git a/palacios/src/palacios/vmm_mem_track.c b/palacios/src/palacios/vmm_mem_track.c index 864f74d..cf73daf 100644 --- a/palacios/src/palacios/vmm_mem_track.c +++ b/palacios/src/palacios/vmm_mem_track.c @@ -341,12 +341,14 @@ v3_mem_track_snapshot *v3_mem_track_take_snapshot(struct v3_vm_info *vm) s->core[i].num_pages=vm->cores[i].memtrack_state.num_pages; memcpy(s->core[i].access_bitmap,vm->cores[i].memtrack_state.access_bitmap,CEIL_DIV(vm->cores[i].memtrack_state.num_pages,8)); PrintDebug(vm,VCORE_NONE,"memtrack: copied %llu bytes\n",CEIL_DIV(vm->cores[i].memtrack_state.num_pages,8)); +#ifdef V3_CONFIG_DEBUG_MEM_TRACK uint64_t j, sum; sum=0; for (j=0;jcores[i].memtrack_state.num_pages,8);j++) { - sum+=!!vm->cores[i].memtrack_state.access_bitmap[i]; + sum+=!!vm->cores[i].memtrack_state.access_bitmap[j]; } PrintDebug(vm,VCORE_NONE,"memtrack: have %llu nonzero bytes\n",sum); +#endif } return s;