import PULS_20160108
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / fs / fuse / fuse.h
1 #ifndef ___FUSE_H___
2 #define ___FUSE_H___
3 extern void fuse_request_send_background_ex(struct fuse_conn *fc,
4 struct fuse_req *req, __u32 size);
5 extern void fuse_request_send_ex(struct fuse_conn *fc, struct fuse_req *req,
6 __u32 size);
7
8 #ifndef USER_BUILD_KERNEL /* IO log is only enabled in eng load */
9 #define FUSEIO_TRACE
10 #endif
11
12 #ifdef MET_FUSEIO_TRACE
13 #define MET_FUSE_IOLOG_INIT() struct timespec met_fuse_start_time, met_fuse_end_time
14 #define MET_FUSE_IOLOG_START() get_monotonic_boottime(&met_fuse_start_time)
15 #define MET_FUSE_IOLOG_END() get_monotonic_boottime(&met_fuse_end_time)
16 #else
17 #define MET_FUSE_IOLOG_INIT(...)
18 #define MET_FUSE_IOLOG_START(...)
19 #define MET_FUSE_IOLOG_END(...)
20 #endif
21
22
23 #ifdef FUSEIO_TRACE
24 #include <linux/sched.h>
25 #include <linux/xlog.h>
26 #include <linux/kthread.h>
27
28 extern void fuse_time_diff(struct timespec *start,
29 struct timespec *end,
30 struct timespec *diff);
31
32 extern void fuse_iolog_add(__u32 io_bytes, int type,
33 struct timespec *start,
34 struct timespec *end);
35
36 extern __u32 fuse_iolog_timeus_diff(struct timespec *start,
37 struct timespec *end);
38
39 extern void fuse_iolog_exit(void);
40 extern void fuse_iolog_init(void);
41
42 struct fuse_rw_info
43 {
44 __u32 count;
45 __u32 bytes;
46 __u32 us;
47 };
48
49 struct fuse_proc_info
50 {
51 pid_t pid;
52 __u32 valid;
53 int misc_type;
54 struct fuse_rw_info read;
55 struct fuse_rw_info write;
56 struct fuse_rw_info misc;
57 };
58
59 #define FUSE_IOLOG_MAX 12
60 #define FUSE_IOLOG_BUFLEN 512
61 #define FUSE_IOLOG_LATENCY 1
62
63 #define FUSE_IOLOG_INIT() struct timespec _tstart, _tend
64 #define FUSE_IOLOG_START() get_monotonic_boottime(&_tstart)
65 #define FUSE_IOLOG_END() get_monotonic_boottime(&_tend)
66 #define FUSE_IOLOG_US() fuse_iolog_timeus_diff(&_tstart, &_tend)
67 #define FUSE_IOLOG_PRINT(iobytes, type) fuse_iolog_add(iobytes, type, &_tstart, &_tend)
68
69 #else
70
71 #define FUSE_IOLOG_INIT(...)
72 #define FUSE_IOLOG_START(...)
73 #define FUSE_IOLOG_END(...)
74 #define FUSE_IOLOG_PRINT(...)
75 #define fuse_iolog_init(...)
76 #define fuse_iolog_exit(...)
77
78 #endif
79
80 #endif