# Copyright 2018 syzkaller project authors. All rights reserved.
# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
# Autogenerated by sys2syz

include <dev/tprof/tprof_ioctl.h>

resource fd_tprof[fd]

openat$tprof(fd const[AT_FDCWD], file ptr[in, string["/dev/tprof"]], flags flags[open_flags], mode const[0]) fd_tprof

ioctl$TPROF_IOC_GETINFO(fd fd_tprof, cmd const[TPROF_IOC_GETINFO], arg ptr[out, tprof_info])
ioctl$TPROF_IOC_START(fd fd_tprof, cmd const[TPROF_IOC_START], arg ptr[in, tprof_param])
ioctl$TPROF_IOC_STOP(fd fd_tprof, cmd const[TPROF_IOC_STOP])
ioctl$TPROF_IOC_GETSTAT(fd fd_tprof, cmd const[TPROF_IOC_GETSTAT], arg ptr[out, tprof_stat])

tprof_info {
	ti_version	int32
	ti_ident	int32
}

tprof_param {
	p_event	intptr
	p_unit	intptr
	p_flags	flags[p_flags_flag, intptr]
}

tprof_stat {
	ts_sample		intptr
	ts_overflow		intptr
	ts_buf			intptr
	ts_emptybuf		intptr
	ts_dropbuf		intptr
	ts_dropbuf_sample	intptr
}

p_flags_flag = TPROF_PARAM_KERN, TPROF_PARAM_USER
