]> granicus.if.org Git - strace/commit
Add ability to print file descriptor paths and filter by those paths
authorGrant Edwards <grant.b.edwards@gmail.com>
Thu, 7 Apr 2011 20:25:40 +0000 (20:25 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Fri, 8 Apr 2011 20:47:56 +0000 (20:47 +0000)
commit8a08277d13d0378c2ff3ce851534c3bf7e31defa
tree3bf9bb239f86ccde9b8b285fc7683def48943ff3
parent4cee0af77b0275740f7f97ae5d778f60d5ac7f88
Add ability to print file descriptor paths and filter by those paths

* pathtrace.c: New file, implements matching syscall arguments to
user-specified file paths.
* Makefile.am (strace_SOURCES): Add pathtrace.c.
* defs.h (TCB_FILTERED, filtered): New defines.
(getfdpath, pathtrace_select, pathtrace_match, show_fd_path,
tracing_paths): New declarations.
* strace.c (show_fd_path, tracing_paths): New global variables.
(usage, main): Implement handling of -y and -P options.
* strace.1: Add descriptions of -y and -P options.
* syscall.c (trace_syscall_entering): Add path matching logic to the
print/noprint decision and set the TCB_FILTERED bit appropriately.
(trace_syscall_exiting): Use filtered() macro that checks the
TCB_FILTERED bit to determine print/noprint status.
* util.c (printfd): Use getfdpath().
Makefile.am
defs.h
pathtrace.c [new file with mode: 0644]
strace.1
strace.c
syscall.c
util.c