30#include <sys/sysctl.h>
66 if (attr == NULL || ret_buf == NULL || maxlen < 1)
71 if (!strcmp(attr,
"vendor_id")) {
72 name =
"machdep.cpu.vendor";
74 }
else if (!strcmp(attr,
"model")) {
75 name =
"machdep.cpu.model";
77 }
else if (!strcmp(attr,
"cpu family")) {
78 name =
"machdep.cpu.family";
83 ret = sysctlnametomib(
name, mib, &mib_len);
88 ret = sysctl(mib, mib_len, &value, &len, NULL, 0);
93 strncpy(ret_buf, value.str, maxlen);
95 snprintf(ret_buf, maxlen,
"%d", value.val);
int __pfm_getcpuinfo_attr(const char *attr, char *ret_buf, size_t maxlen)
void pfm_init_syscalls(void)
void __pfm_vbprintf(const char *fmt,...)