trace.h 862 字节
Newer Older
1
/* SPDX-License-Identifier: GPL-2.0 */
J
Jaegeuk Kim 已提交
2 3 4 5 6 7 8 9 10 11 12 13
/*
 * f2fs IO tracer
 *
 * Copyright (c) 2014 Motorola Mobility
 * Copyright (c) 2014 Jaegeuk Kim <jaegeuk@kernel.org>
 */
#ifndef __F2FS_TRACE_H__
#define __F2FS_TRACE_H__

#ifdef CONFIG_F2FS_IO_TRACE
#include <trace/events/f2fs.h>

14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
enum file_type {
	__NORMAL_FILE,
	__DIR_FILE,
	__NODE_FILE,
	__META_FILE,
	__ATOMIC_FILE,
	__VOLATILE_FILE,
	__MISC_FILE,
};

struct last_io_info {
	int major, minor;
	pid_t pid;
	enum file_type type;
	struct f2fs_io_info fio;
	block_t len;
};

J
Jaegeuk Kim 已提交
32
extern void f2fs_trace_pid(struct page *);
33
extern void f2fs_trace_ios(struct f2fs_io_info *, int);
34
extern void f2fs_build_trace_ios(void);
35
extern void f2fs_destroy_trace_ios(void);
J
Jaegeuk Kim 已提交
36 37
#else
#define f2fs_trace_pid(p)
38
#define f2fs_trace_ios(i, n)
39
#define f2fs_build_trace_ios()
40
#define f2fs_destroy_trace_ios()
J
Jaegeuk Kim 已提交
41 42 43

#endif
#endif /* __F2FS_TRACE_H__ */