trace.h 1013 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. #ifdef CONFIG_F2FS_IO_TRACE
  14. #include <trace/events/f2fs.h>
  15. enum file_type {
  16. __NORMAL_FILE,
  17. __DIR_FILE,
  18. __NODE_FILE,
  19. __META_FILE,
  20. __ATOMIC_FILE,
  21. __VOLATILE_FILE,
  22. __MISC_FILE,
  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. extern void f2fs_trace_pid(struct page *);
  32. extern void f2fs_trace_ios(struct f2fs_io_info *, int);
  33. extern void f2fs_build_trace_ios(void);
  34. extern void f2fs_destroy_trace_ios(void);
  35. #else
  36. #define f2fs_trace_pid(p)
  37. #define f2fs_trace_ios(i, n)
  38. #define f2fs_build_trace_ios()
  39. #define f2fs_destroy_trace_ios()
  40. #endif
  41. #endif /* __F2FS_TRACE_H__ */