Nishad Kamdar | d29fbcd | 2020-04-25 18:49:08 +0530 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Jaegeuk Kim | 63f92dd | 2014-12-17 19:45:05 -0800 | [diff] [blame] | 2 | /* |
| 3 | * f2fs IO tracer |
| 4 | * |
| 5 | * Copyright (c) 2014 Motorola Mobility |
| 6 | * Copyright (c) 2014 Jaegeuk Kim <jaegeuk@kernel.org> |
Jaegeuk Kim | 63f92dd | 2014-12-17 19:45:05 -0800 | [diff] [blame] | 7 | */ |
| 8 | #ifndef __F2FS_TRACE_H__ |
| 9 | #define __F2FS_TRACE_H__ |
| 10 | |
| 11 | #ifdef CONFIG_F2FS_IO_TRACE |
| 12 | #include <trace/events/f2fs.h> |
| 13 | |
Jaegeuk Kim | 0e689d03 | 2014-12-17 19:51:57 -0800 | [diff] [blame] | 14 | enum file_type { |
| 15 | __NORMAL_FILE, |
| 16 | __DIR_FILE, |
| 17 | __NODE_FILE, |
| 18 | __META_FILE, |
| 19 | __ATOMIC_FILE, |
| 20 | __VOLATILE_FILE, |
| 21 | __MISC_FILE, |
| 22 | }; |
| 23 | |
| 24 | struct last_io_info { |
| 25 | int major, minor; |
| 26 | pid_t pid; |
| 27 | enum file_type type; |
| 28 | struct f2fs_io_info fio; |
| 29 | block_t len; |
| 30 | }; |
| 31 | |
Jaegeuk Kim | 63f92dd | 2014-12-17 19:45:05 -0800 | [diff] [blame] | 32 | extern void f2fs_trace_pid(struct page *); |
Jaegeuk Kim | 05ca363 | 2015-04-23 14:38:15 -0700 | [diff] [blame] | 33 | extern void f2fs_trace_ios(struct f2fs_io_info *, int); |
Jaegeuk Kim | c050865 | 2015-01-07 14:07:36 -0800 | [diff] [blame] | 34 | extern void f2fs_build_trace_ios(void); |
Jaegeuk Kim | 351f4fb | 2015-01-07 14:09:48 -0800 | [diff] [blame] | 35 | extern void f2fs_destroy_trace_ios(void); |
Jaegeuk Kim | 63f92dd | 2014-12-17 19:45:05 -0800 | [diff] [blame] | 36 | #else |
| 37 | #define f2fs_trace_pid(p) |
Jaegeuk Kim | 05ca363 | 2015-04-23 14:38:15 -0700 | [diff] [blame] | 38 | #define f2fs_trace_ios(i, n) |
Jaegeuk Kim | c050865 | 2015-01-07 14:07:36 -0800 | [diff] [blame] | 39 | #define f2fs_build_trace_ios() |
Jaegeuk Kim | 351f4fb | 2015-01-07 14:09:48 -0800 | [diff] [blame] | 40 | #define f2fs_destroy_trace_ios() |
Jaegeuk Kim | 63f92dd | 2014-12-17 19:45:05 -0800 | [diff] [blame] | 41 | |
| 42 | #endif |
| 43 | #endif /* __F2FS_TRACE_H__ */ |