RFC: path display and path filtering features.

Grant Edwards grant.b.edwards at gmail.com
Mon Mar 28 15:42:53 UTC 2011


On 2011-03-22, Dmitry V. Levin <ldv at altlinux.org> wrote:
> On Wed, Mar 16, 2011 at 07:43:36AM -0500, Grant Edwards wrote:
>> Attached are updated diffs against git HEAD as of a few minutes ago...
>
> I've made a few minor corrections, most essential of them are early
> include of "defs.h" (due to config.h), and check for tcp->scno
> before pathtrace_match() call (because the latter uses tcp->scno).
>
> Would you like to prepare a commit message?

How about this:

------------------------------------------------------------------------
Add ability to print file descriptor paths and filter by those paths.

* pathrace.c (pathmatch, upathmatch, fdmatch, storepath,
pathtrace_select, pathtrace_match): New functions to handle 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.1 Add descriptions of -y and -P options.

* strace.c (show_fd_path, tracing_paths): New global
variables. (usage, main): Add handling 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 to check the TCB_FILTERED
bit to determine print/noprint status.
------------------------------------------------------------------------





More information about the Strace-devel mailing list