From 845ee0e7ce70dedf1ab228e279dca28430f5ab3c Mon Sep 17 00:00:00 2001 From: Ole Tange Date: Wed, 2 Mar 2016 20:50:53 +0100 Subject: [PATCH] tracefile -p --- tracefile/tracefile | 2 ++ tracefile/tracefile.pod | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/tracefile/tracefile b/tracefile/tracefile index 19898f9..ea2e49a 100755 --- a/tracefile/tracefile +++ b/tracefile/tracefile @@ -13,6 +13,7 @@ if(not ($opt::exists or $opt::nonexists or $opt::all)) { my @cmd = shell_quote(@ARGV); my $dir = "."; +my $pid = $opt::pid ? "-p $pid" : ""; open(IN, "-|", "strace -ff -e trace=file @cmd 2>&1") || die; while() { @@ -49,6 +50,7 @@ sub options_hash { "exists|exist|e" => \$opt::exists, "nonexists|nonexist|non-exists|non-exist|n" => \$opt::nonexists, "all|a" => \$opt::all, + "pid|p=i" => $opt::pid, ); } diff --git a/tracefile/tracefile.pod b/tracefile/tracefile.pod index cdb151c..04cac03 100644 --- a/tracefile/tracefile.pod +++ b/tracefile/tracefile.pod @@ -8,6 +8,8 @@ tracefile - list files being accessed B [-aenu] I +B [-aenu] -p I + =head1 DESCRIPTION B will print the files being accessed by the command. @@ -35,6 +37,10 @@ List only existing files. List only non-existing files. +=item B<-p> I + +Trace process id. + =item B<-u>