While it isn't too late and kvm_read_zpcpu() function isn't yet used
outside libkvm(3), change its order of arguments, so that it is the same as in kvm_read(). Sponsored by: Nginx, Inc.
This commit is contained in:
parent
4a6af12570
commit
19b5cffe0b
@ -88,7 +88,7 @@ kvm_t *kvm_open
|
||||
kvm_t *kvm_openfiles
|
||||
(const char *, const char *, const char *, int, char *);
|
||||
ssize_t kvm_read(kvm_t *, unsigned long, void *, size_t);
|
||||
ssize_t kvm_read_zpcpu(kvm_t *, void *, u_long, size_t, int);
|
||||
ssize_t kvm_read_zpcpu(kvm_t *, unsigned long, void *, size_t, int);
|
||||
ssize_t kvm_write(kvm_t *, unsigned long, const void *, size_t);
|
||||
__END_DECLS
|
||||
|
||||
|
@ -50,7 +50,7 @@
|
||||
.Ft void *
|
||||
.Fn kvm_getpcpu "kvm_t *kd" "int cpu"
|
||||
.Ft ssize_t
|
||||
.Fn kvm_read_zpcpu "kvm_t *kd" "void *buf" "u_long base" "size_t size" "int cpu"
|
||||
.Fn kvm_read_zpcpu "kvm_t *kd" "u_long base" "void *buf" "size_t size" "int cpu"
|
||||
.Ft uint64_t
|
||||
.Fn kvm_counter_u64_fetch "kvm_t *kd" "u_long base"
|
||||
.Sh DESCRIPTION
|
||||
|
@ -306,7 +306,7 @@ kvm_dpcpu_setcpu(kvm_t *kd, u_int cpu)
|
||||
* Obtain a per-CPU copy for given cpu from UMA_ZONE_PCPU allocation.
|
||||
*/
|
||||
ssize_t
|
||||
kvm_read_zpcpu(kvm_t *kd, void *buf, u_long base, size_t size, int cpu)
|
||||
kvm_read_zpcpu(kvm_t *kd, u_long base, void *buf, size_t size, int cpu)
|
||||
{
|
||||
|
||||
return (kvm_read(kd, (uintptr_t)(base + sizeof(struct pcpu) * cpu),
|
||||
@ -327,7 +327,7 @@ kvm_counter_u64_fetch(kvm_t *kd, u_long base)
|
||||
|
||||
r = 0;
|
||||
for (int i = 0; i < mp_ncpus; i++) {
|
||||
if (kvm_read_zpcpu(kd, &c, base, sizeof(c), i) != sizeof(c))
|
||||
if (kvm_read_zpcpu(kd, base, &c, sizeof(c), i) != sizeof(c))
|
||||
return (0);
|
||||
r += c;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user