commit | 74b530d0087a737827d9750bdf0724f9f0cb009e | [log] [tgz] |
---|---|---|
author | Jorge Acereda <jacereda@gmail.com> | Mon May 30 22:23:48 2016 +0200 |
committer | Jorge Acereda <jacereda@gmail.com> | Mon May 30 22:23:48 2016 +0200 |
tree | 7966c3319829cd64cf68f4bea1466c0a1a7e3bac | |
parent | fee6072e3e8b582c4263165a1f0ef1cbccb2a11b [diff] |
Use interpose on darwin
This tool injects code into other applications in order to trace file accesses.
This can be useful for things like build systems, since it allows to automatically generate dependencies in a toolchain-agnostic way or to ensure declared dependencies match the real ones.
On Unix, type make
to generate the fsatrace
executable and the fsatrace.so
shared library.
On Windows, you'll need recent 64-bit and 32-bit versions of mingw
. You can either adapt the Makefile
to point to your compilers or, alternatively, install https://github.com/commercialhaskell/stack and run the following sequence to get the required compilers:
stack setup 7.10.2 --arch=i386 stack setup 7.10.2 --arch=x86_64
After that, invoke make
. That should generate fsatrace.exe
, fsatracehelper.exe
, fsatrace32.dll
and fsatrace64.dll
.
Make sure the .dll or .so files are in the same path as the fsatrace
executable and run:
fsatrace <options> <output-file> -- <command>
Options is a combination of the following characters:
v
: print args vectorr
: dump read operationsw
: dump write operationsm
: dump file move operationsd
: dump file delete operationsq
: dump file stat operationst
: dump touch operationsNewline-separated sequence with the following possibilities:
r
|path-to-file-opened-for-write
w
|path-to-file-opened-for-read
m
|path-to-destination-of-move
|path-to-source-of-move
d
|path-to-deleted-file
q
|path-to-queried-file
t
|path-to-touched-file