GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Sys::Trace(3) User Contributed Perl Documentation Sys::Trace(3)

Sys::Trace - Interface to system call tracing interfaces

  use Sys::Trace;

  my $trace = Sys::Trace->new(exec => [qw(ls foo)]);

  $trace->start; # Returns a PID which you can watch
  $trace->wait;  # Alternatively call this to wait on the PID

  my $result = $trace->results; # Returns a Sys::Trace::Results object

  use Cwd;
  print $result->files(getcwd . "/"); # Should show an attempt to look at "foo"
                                      # in the current directory (i.e. "ls
                                      # foo", above)

Provides a way to programmatically run or trace a program and see the system calls it makes.

This can be useful during testing as a way to ensure a particular file is actually opened, or another hard to test interaction actually occurs.

Currently supported tracing mechanisms are ktrace, strace and truss.

Keys in %args can be:
  • exec: Program and arguments to execute
  • pid: PID of program to trace
  • follow_forks: Follow child processes too (default is 1, set to 0 to disable)

Only one of exec or pid must be provided.

Start running the trace.

Wait for the trace to finish

Return a Sys::Trace::Results object populated with the results of the trace.

This does what I wanted, it is probably woefully incomplete in places.

See <http://github.com/dgl/perl-Sys-Trace>.

This program is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See http://sam.zoy.org/wtfpl/COPYING or Software::License::WTFPL_2 for more details.

David Leadbeater <dgl@dgl.cx>, 2010
2010-07-05 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.