]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r363630:
authorRyan Moeller <freqlabs@FreeBSD.org>
Tue, 4 Aug 2020 12:04:47 +0000 (12:04 +0000)
committerRyan Moeller <freqlabs@FreeBSD.org>
Tue, 4 Aug 2020 12:04:47 +0000 (12:04 +0000)
commit83fbe66ef7255fa4d1223ea0bd82fc54e1e8122d
tree417f9f035edf3a162c30dd2b1c4638edf81d67b7
parent338a24fd6c0adac829db078732dd88a02f35242f
MFC r363630:

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
Sponsored by:   iXsystems, Inc.
Differential Revision:  https://reviews.freebsd.org/D25679
lib/libpmc/libpmc_pmu_util.c
sys/dev/hwpmc/hwpmc_mod.c