• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 /* This line is generated to truncate the original file */
17 
18 #ifndef FSTRACE_TYPES_H
19 #define FSTRACE_TYPES_H
20 
21 #include "hiebpf_macros.h"
22 
23 struct sys_openat2_args_t {
24     int dfd;
25     const char __user* filename;
26     struct open_how* how;
27 };
28 
29 struct sys_read_args_t {
30     unsigned int fd;
31     char __user* buf;
32     size_t count;
33 };
34 
35 struct sys_write_args_t {
36     unsigned int fd;
37     const char __user* buf;
38     size_t count;
39 };
40 
41 struct sys_pread64_args_t {
42     unsigned int fd;
43     char __user* buf;
44     size_t count;
45     loff_t pos;
46 };
47 
48 struct sys_pwrite64_args_t {
49     unsigned int fd;
50     const char __user* buf;
51     size_t count;
52     loff_t pos;
53 };
54 
55 struct sys_readv_args_t {
56     unsigned long fd;
57     const struct iovec __user* vec;
58     unsigned long vlen;
59     rwf_t flags;
60 };
61 
62 struct sys_writev_args_t {
63     unsigned long fd;
64     const struct iovec __user* vec;
65     unsigned long vlen;
66     rwf_t flags;
67 };
68 
69 struct sys_preadv_args_t {
70     unsigned long fd;
71     const struct iovec __user* vec;
72     unsigned long vlen;
73     loff_t pos;
74     rwf_t flags;
75 };
76 
77 struct sys_pwritev_args_t {
78     unsigned long fd;
79     const struct iovec __user* vec;
80     unsigned long vlen;
81     loff_t pos;
82     rwf_t flags;
83 };
84 
85 struct sys_close_args_t {
86     struct files_struct* files;
87     unsigned fd;
88 };
89 
90 struct fstrace_start_event_t {
91     __u32 type;
92     __u64 stime;
93     union {
94         struct sys_openat2_args_t openat2_args;
95         struct sys_read_args_t read_args;
96         struct sys_write_args_t write_args;
97         struct sys_pread64_args_t pread64_args;
98         struct sys_pwrite64_args_t pwrite64_args;
99         struct sys_readv_args_t readv_args;
100         struct sys_writev_args_t writev_args;
101         struct sys_preadv_args_t preadv_args;
102         struct sys_pwritev_args_t pwritev_args;
103         struct sys_close_args_t close_args;
104     };
105 };
106 
107 enum FSTraceEventType:__u32 {
108     SYS_OPENAT2 = 1,
109     SYS_READ,
110     SYS_WRITE,
111     SYS_PREAD64,
112     SYS_PWRITE64,
113     SYS_READV,
114     SYS_WRITEV,
115     SYS_PREADV,
116     SYS_PWRITEV,
117     SYS_CLOSE,
118 };
119 #endif