Fix decoding of statfs family syscalls

Fix decoders of fstatfs, fstatfs64, statfs, and statfs64 syscalls
by rewriting them using mpers infrastructure.

* fetch_struct_statfs.c: New file.
* fstatfs.c: Likewise.
* fstatfs64.c: Likewise.
* print_statfs.c: Likewise.
* statfs.h: Likewise.
* statfs64.c: Likewise.
* statfs.c: Remove everything except SYS_FUNC(statfs).
* configure.ac: Remove the check for struct statfs64 in <sys/vfs.h>.
Add checks for struct statfs and struct statfs64 in <asm/statfs.h>.
Add checks for f_frsize and f_flags members of these structures.
* defs.h (struct strace_statfs): New forward declaration.
(print_struct_statfs, print_struct_statfs64): New prototypes.
* Makefile.am (libstrace_a_SOURCES): Add fstatfs.c, fstatfs64.c,
statfs.c, and statfs64.c.
(strace_SOURCES): Add fetch_struct_statfs.c, print_statfs.c,
and statfs.h.
* NEWS: Mention this fix.
* tests/fstatfs.c: New file.
* tests/fstatfs64.c: Likewise.
* tests/statfs64.c: Likewise.
* tests/xstatfs.c: Likewise.
* tests/xstatfs64.c: Likewise.
* tests/xstatfsx.c: Likewise.
* tests/fstatfs.test: New test.
* tests/fstatfs64.test: Likewise.
* tests/statfs64.test: Likewise.
* tests/statfs.c: Rewrite using xstatfs.c.
* tests/statfs.test: Update.
* tests/.gitignore: Add fstatfs, fstatfs64, and statfs64.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add  fstatfs.test, fstatfs64.test, and statfs64.test.
(EXTRA_DIST): Add xstatfs.c, xstatfs64.c, and xstatfsx.c.
24 files changed
tree: 46f90d5eeeb5a21f6126628f534274a9d6a88e59
  1. .gitignore
  2. .mailmap
  3. .travis.yml
  4. AUTHORS
  5. COPYING
  6. CREDITS.in
  7. ChangeLog-CVS
  8. HACKING-scripts
  9. INSTALL
  10. Makefile.am
  11. NEWS
  12. README
  13. README-hacking
  14. README-linux-ptrace
  15. README-mpers
  16. README.md
  17. access.c
  18. affinity.c
  19. aio.c
  20. alpha.c
  21. bjm.c
  22. block.c
  23. bootstrap
  24. bpf.c
  25. build_static_example.sh
  26. cacheflush.c
  27. capability.c
  28. caps0.h
  29. caps1.h
  30. chdir.c
  31. chmod.c
  32. clone.c
  33. configure.ac
  34. copy_file_range.c
  35. count.c
  36. debian/
  37. defs.h
  38. desc.c
  39. dirent.c
  40. dirent64.c
  41. empty.h
  42. epoll.c
  43. errnoent.sh
  44. evdev.c
  45. eventfd.c
  46. execve.c
  47. exit.c
  48. fadvise.c
  49. fallocate.c
  50. fanotify.c
  51. fchownat.c
  52. fcntl.c
  53. fetch_seccomp_fprog.c
  54. fetch_struct_flock.c
  55. fetch_struct_statfs.c
  56. file.c
  57. file_handle.c
  58. flock.c
  59. flock.h
  60. fstatfs.c
  61. fstatfs64.c
  62. futex.c
  63. gcc_compat.h
  64. generate_mpers_am.sh
  65. generate_sen.sh
  66. generate_xlat_in.sh
  67. get_robust_list.c
  68. getcpu.c
  69. getcwd.c
  70. getrandom.c
  71. git-set-file-times
  72. git-version-gen
  73. gitlog-to-changelog
  74. hostname.c
  75. inotify.c
  76. io.c
  77. ioctl.c
  78. ioctlsort.c
  79. ioperm.c
  80. iopl.c
  81. ioprio.c
  82. ipc_defs.h
  83. ipc_msg.c
  84. ipc_msgctl.c
  85. ipc_sem.c
  86. ipc_shm.c
  87. ipc_shmctl.c
  88. kcmp.c
  89. kernel_types.h
  90. kexec.c
  91. keyctl.c
  92. ldt.c
  93. link.c
  94. linux/
  95. lookup_dcookie.c
  96. loop.c
  97. lseek.c
  98. m4/
  99. maint/
  100. make-dist
  101. mem.c
  102. membarrier.c
  103. memfd_create.c
  104. mknod.c
  105. mount.c
  106. mpers.awk
  107. mpers.sh
  108. mpers_test.sh
  109. mpers_type.h
  110. mq.c
  111. mtd.c
  112. native_defs.h
  113. net.c
  114. open.c
  115. or1k_atomic.c
  116. pathtrace.c
  117. perf.c
  118. personality.c
  119. poll.c
  120. prctl.c
  121. print_mq_attr.c
  122. print_msgbuf.c
  123. print_sigevent.c
  124. print_statfs.c
  125. print_time.c
  126. print_timex.c
  127. printmode.c
  128. printrusage.c
  129. printsiginfo.c
  130. printsiginfo.h
  131. printstat.h
  132. process.c
  133. process_vm.c
  134. ptp.c
  135. ptrace.h
  136. qemu_multiarch_testing/
  137. quota.c
  138. readahead.c
  139. readlink.c
  140. reboot.c
  141. regs.h
  142. renameat.c
  143. resource.c
  144. rtc.c
  145. sched.c
  146. scsi.c
  147. seccomp.c
  148. seccomp_fprog.h
  149. sendfile.c
  150. sigaltstack.c
  151. sigevent.h
  152. signal.c
  153. signalent.sh
  154. signalfd.c
  155. sigreturn.c
  156. sock.c
  157. socketutils.c
  158. sram_alloc.c
  159. statfs.c
  160. statfs.h
  161. statfs64.c
  162. strace-graph
  163. strace-log-merge
  164. strace.1
  165. strace.c
  166. strace.spec
  167. swapon.c
  168. sync_file_range.c
  169. sync_file_range2.c
  170. syscall.c
  171. syscallent.sh
  172. sysctl.c
  173. sysinfo.c
  174. syslog.c
  175. sysmips.c
  176. term.c
  177. test/
  178. tests/
  179. time.c
  180. times.c
  181. travis-ci.sh
  182. truncate.c
  183. uid.c
  184. uid16.c
  185. umask.c
  186. umount.c
  187. uname.c
  188. unwind.c
  189. upeek.c
  190. userfaultfd.c
  191. util.c
  192. utime.c
  193. utimes.c
  194. v4l2.c
  195. vsprintf.c
  196. wait.c
  197. xattr.c
  198. xlat.h
  199. xlat/
  200. xlate.el
  201. xmalloc.c
README.md

This is strace -- a diagnostic, debugging and instructional userspace utility for Linux. It is used to monitor interactions between processes and the Linux kernel, which include system calls, signal deliveries, and changes of process state. The operation of strace is made possible by the kernel feature known as ptrace.

strace is released under a Berkeley-style license at the request of Paul Kranenburg; see the file COPYING for details.

See the file NEWS for information on what has changed in recent versions.

Please send bug reports and enhancements to the strace mailing list.

Build Status Code Coverage