MCPcopy Create free account
hub / github.com/F-Stack/f-stack / vmm_stat_copy

Function vmm_stat_copy

freebsd/amd64/vmm/vmm_stat.c:84–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82}
83
84int
85vmm_stat_copy(struct vm *vm, int vcpu, int *num_stats, uint64_t *buf)
86{
87 struct vmm_stat_type *vst;
88 uint64_t *stats;
89 int i;
90
91 if (vcpu < 0 || vcpu >= vm_get_maxcpus(vm))
92 return (EINVAL);
93
94 /* Let stats functions update their counters */
95 for (i = 0; i < vst_num_types; i++) {
96 vst = vsttab[i];
97 if (vst->func != NULL)
98 (*vst->func)(vm, vcpu, vst);
99 }
100
101 /* Copy over the stats */
102 stats = vcpu_stats(vm, vcpu);
103 for (i = 0; i < vst_num_elems; i++)
104 buf[i] = stats[i];
105 *num_stats = vst_num_elems;
106 return (0);
107}
108
109void *
110vmm_stat_alloc(void)

Callers 1

vmmdev_ioctlFunction · 0.85

Calls 2

vm_get_maxcpusFunction · 0.85
vcpu_statsFunction · 0.85

Tested by

no test coverage detected