HomeFreeBSD

libpmc: Use known pmc_cpuid buffer size

Description

libpmc: Use known pmc_cpuid buffer size

Use the existing PMC_CPUID_LEN to size pmc_cpuid in the kernel and various
buffers for reading it in libpmc. This avoids some extra syscalls and
malloc/frees.

While in here, use strlcpy to copy a user-provided cpuid string instead of
memcpy, to make sure we terminate the buffer.

Reviewed by: mav
MFC after: 1 week
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D25679

Details

Provenance
freqlabsAuthored on
Reviewer
mav
Differential Revision
D25679: libpmc: Use known pmc_cpuid buffer size
Parents
rS363629: MFC r363206:
Branches
Unknown
Tags
Unknown