README
1NAME
2 Sys::Trace - Interface to system call tracing interfaces
3
4SYNOPSIS
5 use Sys::Trace;
6
7 my $trace = Sys::Trace->new(exec => [qw(ls foo)]);
8
9 $trace->start; # Returns a PID which you can watch
10 $trace->wait; # Alternatively call this to wait on the PID
11
12 my $result = $trace->results; # Returns a Sys::Trace::Results object
13
14 use Cwd;
15 print $result->files(getcwd . "/"); # Should show an attempt to look at "foo"
16 # in the current directory (i.e. "ls
17 # foo", above)
18
19DESCRIPTION
20 Provides a way to programmatically run or trace a program and see the
21 system calls it makes.
22
23 This can be useful during testing as a way to ensure a particular file
24 is actually opened, or another hard to test interaction actually occurs.
25
26 Currently supported tracing mechanisms are strace and ktrace.
27
28METHODS
29 new(%args)
30 Keys in %args can be:
31
32 * exec: Program and arguments to execute
33
34 * pid: PID of program to trace
35
36 Only one of exec or pid must be provided.
37
38 start
39 Start running the trace.
40
41 wait
42 Wait for the trace to finish
43
44 results
45 Return a Sys::Trace::Results object populated with the results of the
46 trace.
47
48BUGS
49 This does what I wanted, it is probably woefully incomplete in places.
50
51 See <http://github.com/dgl/perl-Sys-Trace>.
52
53LICENSE
54 This program is free software. It comes without any warranty, to the
55 extent permitted by applicable law. You can redistribute it and/or
56 modify it under the terms of the Do What The Fuck You Want To Public
57 License, Version 2, as published by Sam Hocevar. See
58 http://sam.zoy.org/wtfpl/COPYING or Software::License::WTFPL_2 for more
59 details.
60
61AUTHOR
62 David Leadbeater <dgl@dgl.cx>, 2010
63
64