Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F4096647
kcov_test.c
tuexen (Michael Tuexen)
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
tuexen
Dec 26 2018, 1:22 PM
2018-12-26 13:22:45 (UTC+0)
Size
511 B
Referenced Files
None
Subscribers
None
kcov_test.c
View Options
#include
<sys/kcov.h>
#include
<fcntl.h>
#include
<stdio.h>
#include
<unistd.h>
int
main
(
void
)
{
int
fd
;
int
CoverSize
=
256
<<
10
;
int
mode
=
KCOV_MODE_TRACE_PC
;
if
((
fd
=
open
(
"/dev/kcov"
,
O_RDWR
))
<
0
)
{
perror
(
"open"
);
}
if
(
ioctl
(
fd
,
KIOSETBUFSIZE
,
CoverSize
))
{
perror
(
"KIOSETBUFSIZE"
);
}
if
(
ioctl
(
fd
,
KIOENABLE
,
mode
))
{
perror
(
"KIOENABLE"
);
}
sleep
(
1
);
#if 0
if (ioctl(fd, KIODISABLE, mode)) {
perror("KIODISABLE");
}
#endif
if
(
close
(
fd
))
{
perror
(
"close"
);
}
return
(
0
);
}
File Metadata
Details
Attached
Mime Type
text/x-c
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1697212
Default Alt Text
kcov_test.c (511 B)
Attached To
Mode
D14599: Implement kernel code coverage (kcov)
Attached
Detach File
Event Timeline
Log In to Comment