Changeset View
Changeset View
Standalone View
Standalone View
sys/amd64/vmm/vmm_stat.c
Show First 20 Lines • Show All 82 Lines • ▼ Show 20 Lines | |||||
int | int | ||||
vmm_stat_copy(struct vm *vm, int vcpu, int *num_stats, uint64_t *buf) | vmm_stat_copy(struct vm *vm, int vcpu, int *num_stats, uint64_t *buf) | ||||
{ | { | ||||
struct vmm_stat_type *vst; | struct vmm_stat_type *vst; | ||||
uint64_t *stats; | uint64_t *stats; | ||||
int i; | int i; | ||||
if (vcpu < 0 || vcpu >= VM_MAXCPU) | if (vcpu < 0 || vcpu >= vm_get_maxcpus(vm)) | ||||
return (EINVAL); | return (EINVAL); | ||||
/* Let stats functions update their counters */ | /* Let stats functions update their counters */ | ||||
for (i = 0; i < vst_num_types; i++) { | for (i = 0; i < vst_num_types; i++) { | ||||
vst = vsttab[i]; | vst = vsttab[i]; | ||||
if (vst->func != NULL) | if (vst->func != NULL) | ||||
(*vst->func)(vm, vcpu, vst); | (*vst->func)(vm, vcpu, vst); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 73 Lines • Show Last 20 Lines |