-
Notifications
You must be signed in to change notification settings - Fork 2
/
probe.c
85 lines (81 loc) · 2.36 KB
/
probe.c
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#include <stdio.h>
#include <stdlib.h>
#include <sys/utsname.h>
#include <liburing.h>
#include <liburing/io_uring.h>
static const char *op_strs[] = {
"IORING_OP_NOP",
"IORING_OP_READV",
"IORING_OP_WRITEV",
"IORING_OP_FSYNC",
"IORING_OP_READ_FIXED",
"IORING_OP_WRITE_FIXED",
"IORING_OP_POLL_ADD",
"IORING_OP_POLL_REMOVE",
"IORING_OP_SYNC_FILE_RANGE",
"IORING_OP_SENDMSG",
"IORING_OP_RECVMSG",
"IORING_OP_TIMEOUT",
"IORING_OP_TIMEOUT_REMOVE",
"IORING_OP_ACCEPT",
"IORING_OP_ASYNC_CANCEL",
"IORING_OP_LINK_TIMEOUT",
"IORING_OP_CONNECT",
"IORING_OP_FALLOCATE",
"IORING_OP_OPENAT",
"IORING_OP_CLOSE",
"IORING_OP_FILES_UPDATE",
"IORING_OP_STATX",
"IORING_OP_READ",
"IORING_OP_WRITE",
"IORING_OP_FADVISE",
"IORING_OP_MADVISE",
"IORING_OP_SEND",
"IORING_OP_RECV",
"IORING_OP_OPENAT2",
"IORING_OP_EPOLL_CTL",
"IORING_OP_SPLICE",
"IORING_OP_PROVIDE_BUFFERS",
"IORING_OP_REMOVE_BUFFERS",
"IORING_OP_TEE",
"IORING_OP_SHUTDOWN",
"IORING_OP_RENAMEAT",
"IORING_OP_UNLINKAT",
"IORING_OP_MKDIRAT",
"IORING_OP_SYMLINKAT",
"IORING_OP_LINKAT",
"IORING_OP_MSG_RING",
"IORING_OP_FSETXATTR",
"IORING_OP_SETXATTR",
"IORING_OP_FGETXATTR",
"IORING_OP_GETXATTR",
"IORING_OP_SOCKET",
"IORING_OP_URING_CMD",
"IORING_OP_SEND_ZC",
"IORING_OP_SENDMSG_ZC",
"IORING_OP_READ_MULTISHOT",
"IORING_OP_WAITID",
"IORING_OP_FUTEX_WAIT",
"IORING_OP_FUTEX_WAKE",
"IORING_OP_FUTEX_WAITV",
"IORING_OP_FIXED_FD_INSTALL",
"IORING_OP_FTRUNCATE",
};
int main() {
struct utsname u;
uname(&u);
printf("You are running kernel version: %s\n", u.release);
struct io_uring_probe *probe = io_uring_get_probe();
printf("Report of your kernel's list of supported io_uring operations:\n");
for (char i = 0; i < IORING_OP_LAST; i++ ) {
if(io_uring_opcode_supported(probe, i)) {
//printf("%s: ", op_strs[i]);
//printf("yes.\n");
} else {
printf("%s: ", op_strs[i]);
printf("no.\n");
}
}
//free(probe);
return 0;
}