diff options
-rwxr-xr-x | useful/ultrastrace.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/useful/ultrastrace.php b/useful/ultrastrace.php index f0a3f0da..727d18d3 100755 --- a/useful/ultrastrace.php +++ b/useful/ultrastrace.php @@ -49,7 +49,7 @@ foreach ($argv as $fname) { $lastLine = $line; $lastTime = $time; } - if (preg_match('#^(\d+\s+)?(\d+:\d+:\d+\.?\d*\s+|\d+\.\d+\s+)?(?<action>access|stat|lstat|stat64|lstat64|readlink|open|openat|execve)\("(?<lib>[^"]*[^"]*[^/])".*\)\s+=\s+(?<ret>\S+)(\s+(?<err>\S+)\s+|$)#', $line, $out) < 1) continue; + if (preg_match('#^(\d+\s+)?(\d+:\d+:\d+\.?\d*\s+|\d+\.\d+\s+)?(?<action>access|stat|lstat|statat|stat64|lstat64|readlink|open|openat|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); @@ -57,19 +57,19 @@ foreach ($argv as $fname) { $str = ':-( ' . $out['lib'] . ' *** (' . (isset($out['err']) ? $out['err'] : 'Unknown Error') . ') (' . $out[ 'action'] . ')'; if (isset($found[$file])) { if (!$unique || !in_array($str, $found[$file])) - $found[$file][] = $str; + $found[$file][$str] = $str; } else { if (!$unique || !isset($failed[$file]) || !in_array($str, $failed[$file])) - $failed[$file][] = $str; + $failed[$file][$str] = $str; } } else { if (isset($failed[$file])) { - $found[$file] = $failed[$file]; + $found[$file] =& $failed[$file]; unset($failed[$file]); } $str = ':-) ' . $out['lib'] . ' (' . $out['action'] . ')'; if (!$unique || !isset($found[$file]) || !in_array($str, $found[$file])) - $found[$file][] = $str; + $found[$file][$str] = $str; } } fclose($fh); |