summaryrefslogtreecommitdiffstats
path: root/useful/ultrastrace.php
diff options
context:
space:
mode:
Diffstat (limited to 'useful/ultrastrace.php')
-rwxr-xr-xuseful/ultrastrace.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/useful/ultrastrace.php b/useful/ultrastrace.php
index 46df34a5..7ec755e9 100755
--- a/useful/ultrastrace.php
+++ b/useful/ultrastrace.php
@@ -35,22 +35,22 @@ foreach ($argv as $fname) {
$lastLine = $line;
$lastTime = $time;
}
- if (preg_match('#^(\d+:\d+:\d+\.\d+\s+)?open\("(?<lib>[^"]*[^"]*[^/])".*\)\s+=\s+(?<ret>\S+)(\s+(?<err>\S+)\s+|$)#', $line, $out) < 1) continue;
+ if (preg_match('#^(\d+:\d+:\d+\.\d+\s+)?(?<action>open|execve)\("(?<lib>[^"]*[^"]*[^/])".*\)\s+=\s+(?<ret>\S+)(\s+(?<err>\S+)\s+|$)#', $line, $out) < 1) continue;
//echo "Match: {$out['lib']} -> {$out['ret']} ({$out['err']})\n";
$file = basename($out['lib']);
$file = preg_replace('/\.so(\.\d+)*$/', '', $file);
if ($out['ret'] < 0) {
if (isset($found[$file])) {
- $found[$file][] = ':-( ' . $out['lib'] . ' *** (' . (isset($out['err']) ? $out['err'] : 'Unknown Error') . ')';
+ $found[$file][] = ':-( ' . $out['lib'] . ' *** (' . (isset($out['err']) ? $out['err'] : 'Unknown Error') . ') (' . $out['action'] . ')';
} else {
- $failed[$file][] = ':-( ' . $out['lib'] . ' *** (' . (isset($out['err']) ? $out['err'] : 'Unknown Error') . ')';
+ $failed[$file][] = ':-( ' . $out['lib'] . ' *** (' . (isset($out['err']) ? $out['err'] : 'Unknown Error') . ') (' . $out['action'] . ')';
}
} else {
if (isset($failed[$file])) {
$found[$file] = $failed[$file];
unset($failed[$file]);
}
- $found[$file][] = ':-) ' . $out['lib'];
+ $found[$file][] = ':-) ' . $out['lib'] . ' (' . $out['action'] . ')';
}
}
fclose($fh);