summaryrefslogtreecommitdiffstats
path: root/util/reset.c
blob: 125a2b60f54bc1d3060bffd9a773614d2f23512f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include "cachepc/uapi.h"

#include <sys/ioctl.h>
#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>
#include <stdint.h>
#include <err.h>
#include <fcntl.h>
#include <unistd.h>

int
main(int argc, const char **argv)
{
	uint64_t arg;
	int fd, ret;

	fd = open("/dev/kvm", O_RDONLY);
	if (fd < 0) err(1, "open");

	ret = ioctl(fd, KVM_CPC_RESET_TRACKING);
	if (ret) warn("ioctl RESET_TRACKING");

	arg = 0;
	ret = ioctl(fd, KVM_CPC_ACK_EVENT, &arg);
	if (ret) warn("ioctl ACK_EVENT");

	close(fd);
}