26 #include <asm/unistd.h>
29 #include <sys/ioctl.h>
40 _perf_config.type = PERF_TYPE_HARDWARE;
41 _perf_config.size =
sizeof(perf_event_attr);
44 _perf_config.disabled = 1;
47 _perf_config.inherit = 1;
49 _perf_config.inherit_stat = 1;
65 _perf_config.config = config;
72 _fd = syscall(__NR_perf_event_open, &perf_config, 0, -1, -1, 0);
76 const int result = ioctl(_fd, PERF_EVENT_IOC_ENABLE, 0);
94 const int result = ioctl(_fd, PERF_EVENT_IOC_RESET, 0);