diff options
| author | Meizu OpenSource <patchwork@meizu.com> | 2016-08-15 10:19:42 +0800 |
|---|---|---|
| committer | Meizu OpenSource <patchwork@meizu.com> | 2016-08-15 10:19:42 +0800 |
| commit | d2e1446d81725c351dc73a03b397ce043fb18452 (patch) | |
| tree | 4dbc616b7f92aea39cd697a9084205ddb805e344 /fs/fuse/fuse.h | |
first commit
Diffstat (limited to 'fs/fuse/fuse.h')
| -rw-r--r-- | fs/fuse/fuse.h | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/fs/fuse/fuse.h b/fs/fuse/fuse.h new file mode 100644 index 000000000..9d2c68f53 --- /dev/null +++ b/fs/fuse/fuse.h @@ -0,0 +1,70 @@ +#ifndef ___FUSE_H___ +#define ___FUSE_H___ +extern void fuse_request_send_background_ex(struct fuse_conn *fc, + struct fuse_req *req, __u32 size); +extern void fuse_request_send_ex(struct fuse_conn *fc, struct fuse_req *req, + __u32 size); + +#if defined(CONFIG_MT_ENG_BUILD) /* IO log is only enabled in eng load */ +#define FUSEIO_TRACE +#endif + + +#ifdef FUSEIO_TRACE +#include <linux/sched.h> +#include <linux/xlog.h> +#include <linux/kthread.h> + +extern void fuse_time_diff(struct timespec *start, + struct timespec *end, + struct timespec *diff); + +extern void fuse_iolog_add(__u32 io_bytes, int type, + struct timespec *start, + struct timespec *end); + +extern __u32 fuse_iolog_timeus_diff(struct timespec *start, + struct timespec *end); + +extern void fuse_iolog_exit(void); +extern void fuse_iolog_init(void); + +struct fuse_rw_info +{ + __u32 count; + __u32 bytes; + __u32 us; +}; + +struct fuse_proc_info +{ + pid_t pid; + __u32 valid; + int misc_type; + struct fuse_rw_info read; + struct fuse_rw_info write; + struct fuse_rw_info misc; +}; + +#define FUSE_IOLOG_MAX 12 +#define FUSE_IOLOG_BUFLEN 512 +#define FUSE_IOLOG_LATENCY 1 + +#define FUSE_IOLOG_INIT() struct timespec _tstart, _tend +#define FUSE_IOLOG_START() get_monotonic_boottime(&_tstart) +#define FUSE_IOLOG_END() get_monotonic_boottime(&_tend) +#define FUSE_IOLOG_US() fuse_iolog_timeus_diff(&_tstart, &_tend) +#define FUSE_IOLOG_PRINT(iobytes, type) fuse_iolog_add(iobytes, type, &_tstart, &_tend) + +#else + +#define FUSE_IOLOG_INIT(...) +#define FUSE_IOLOG_START(...) +#define FUSE_IOLOG_END(...) +#define FUSE_IOLOG_PRINT(...) +#define fuse_iolog_init(...) +#define fuse_iolog_exit(...) + +#endif + +#endif |
