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. debian/
  2. linux/
  3. m4/
  4. maint/
  5. qemu_multiarch_testing/
  6. test/
  7. tests/
  8. xlat/
  9. .gitignore
  10. .mailmap
  11. .travis.yml
  12. access.c
  13. affinity.c
  14. aio.c
  15. alpha.c
  16. AUTHORS
  17. bjm.c
  18. block.c
  19. bootstrap
  20. bpf.c
  21. build_static_example.sh
  22. cacheflush.c
  23. capability.c
  24. caps0.h
  25. caps1.h
  26. ChangeLog-CVS
  27. chdir.c
  28. chmod.c
  29. clone.c
  30. configure.ac
  31. copy_file_range.c
  32. COPYING
  33. count.c
  34. CREDITS.in
  35. defs.h
  36. desc.c
  37. dirent.c
  38. dirent64.c
  39. empty.h
  40. epoll.c
  41. errnoent.sh
  42. evdev.c
  43. eventfd.c
  44. execve.c
  45. exit.c
  46. fadvise.c
  47. fallocate.c
  48. fanotify.c
  49. fchownat.c
  50. fcntl.c
  51. fetch_seccomp_fprog.c
  52. fetch_struct_flock.c
  53. fetch_struct_statfs.c
  54. file.c
  55. file_handle.c
  56. flock.c
  57. flock.h
  58. fstatfs.c
  59. fstatfs64.c
  60. futex.c
  61. gcc_compat.h
  62. generate_mpers_am.sh
  63. generate_sen.sh
  64. generate_xlat_in.sh
  65. get_robust_list.c
  66. getcpu.c
  67. getcwd.c
  68. getrandom.c
  69. git-set-file-times
  70. git-version-gen
  71. gitlog-to-changelog
  72. HACKING-scripts
  73. hostname.c
  74. inotify.c
  75. INSTALL
  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. lookup_dcookie.c
  95. loop.c
  96. lseek.c
  97. make-dist
  98. Makefile.am
  99. mem.c
  100. membarrier.c
  101. memfd_create.c
  102. mknod.c
  103. mount.c
  104. mpers.awk
  105. mpers.sh
  106. mpers_test.sh
  107. mpers_type.h
  108. mq.c
  109. mtd.c
  110. native_defs.h
  111. net.c
  112. NEWS
  113. open.c
  114. or1k_atomic.c
  115. pathtrace.c
  116. perf.c
  117. personality.c
  118. poll.c
  119. prctl.c
  120. print_mq_attr.c
  121. print_msgbuf.c
  122. print_sigevent.c
  123. print_statfs.c
  124. print_time.c
  125. print_timex.c
  126. printmode.c
  127. printrusage.c
  128. printsiginfo.c
  129. printsiginfo.h
  130. printstat.h
  131. process.c
  132. process_vm.c
  133. ptp.c
  134. ptrace.h
  135. quota.c
  136. readahead.c
  137. readlink.c
  138. README
  139. README-hacking
  140. README-linux-ptrace
  141. README-mpers
  142. README.md
  143. reboot.c
  144. regs.h
  145. renameat.c
  146. resource.c
  147. rtc.c
  148. sched.c
  149. scsi.c
  150. seccomp.c
  151. seccomp_fprog.h
  152. sendfile.c
  153. sigaltstack.c
  154. sigevent.h
  155. signal.c
  156. signalent.sh
  157. signalfd.c
  158. sigreturn.c
  159. sock.c
  160. socketutils.c
  161. sram_alloc.c
  162. statfs.c
  163. statfs.h
  164. statfs64.c
  165. strace-graph
  166. strace-log-merge
  167. strace.1
  168. strace.c
  169. strace.spec
  170. swapon.c
  171. sync_file_range.c
  172. sync_file_range2.c
  173. syscall.c
  174. syscallent.sh
  175. sysctl.c
  176. sysinfo.c
  177. syslog.c
  178. sysmips.c
  179. term.c
  180. time.c
  181. times.c
  182. travis-ci.sh
  183. truncate.c
  184. uid.c
  185. uid16.c
  186. umask.c
  187. umount.c
  188. uname.c
  189. unwind.c
  190. upeek.c
  191. userfaultfd.c
  192. util.c
  193. utime.c
  194. utimes.c
  195. v4l2.c
  196. vsprintf.c
  197. wait.c
  198. xattr.c
  199. xlat.h
  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