Jaegeuk Kim | 63f92dd | 2014-12-17 19:45:05 -0800 | [diff] [blame] | 1 | /* |
| 2 | * f2fs IO tracer |
| 3 | * |
| 4 | * Copyright (c) 2014 Motorola Mobility |
| 5 | * Copyright (c) 2014 Jaegeuk Kim <jaegeuk@kernel.org> |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License version 2 as |
| 9 | * published by the Free Software Foundation. |
| 10 | */ |
| 11 | #ifndef __F2FS_TRACE_H__ |
| 12 | #define __F2FS_TRACE_H__ |
| 13 | |
| 14 | #ifdef CONFIG_F2FS_IO_TRACE |
| 15 | #include <trace/events/f2fs.h> |
| 16 | |
Jaegeuk Kim | 0e689d0 | 2014-12-17 19:51:57 -0800 | [diff] [blame] | 17 | enum file_type { |
| 18 | __NORMAL_FILE, |
| 19 | __DIR_FILE, |
| 20 | __NODE_FILE, |
| 21 | __META_FILE, |
| 22 | __ATOMIC_FILE, |
| 23 | __VOLATILE_FILE, |
| 24 | __MISC_FILE, |
| 25 | }; |
| 26 | |
| 27 | struct last_io_info { |
| 28 | int major, minor; |
| 29 | pid_t pid; |
| 30 | enum file_type type; |
| 31 | struct f2fs_io_info fio; |
| 32 | block_t len; |
| 33 | }; |
| 34 | |
Jaegeuk Kim | 63f92dd | 2014-12-17 19:45:05 -0800 | [diff] [blame] | 35 | extern void f2fs_trace_pid(struct page *); |
| 36 | extern void f2fs_trace_ios(struct page *, struct f2fs_io_info *, int); |
Jaegeuk Kim | c050865 | 2015-01-07 14:07:36 -0800 | [diff] [blame] | 37 | extern void f2fs_build_trace_ios(void); |
Jaegeuk Kim | 351f4fb | 2015-01-07 14:09:48 -0800 | [diff] [blame] | 38 | extern void f2fs_destroy_trace_ios(void); |
Jaegeuk Kim | 63f92dd | 2014-12-17 19:45:05 -0800 | [diff] [blame] | 39 | #else |
| 40 | #define f2fs_trace_pid(p) |
| 41 | #define f2fs_trace_ios(p, i, n) |
Jaegeuk Kim | c050865 | 2015-01-07 14:07:36 -0800 | [diff] [blame] | 42 | #define f2fs_build_trace_ios() |
Jaegeuk Kim | 351f4fb | 2015-01-07 14:09:48 -0800 | [diff] [blame] | 43 | #define f2fs_destroy_trace_ios() |
Jaegeuk Kim | 63f92dd | 2014-12-17 19:45:05 -0800 | [diff] [blame] | 44 | |
| 45 | #endif |
| 46 | #endif /* __F2FS_TRACE_H__ */ |