From 548e0c3a743c9ef4477c6305fea1ea1b7d3dab2d Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 14 May 2013 16:37:19 +0200 Subject: ultrastracke update --- useful/ultrastrace.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'useful') diff --git a/useful/ultrastrace.php b/useful/ultrastrace.php index eeff80c2..ea8161ea 100755 --- a/useful/ultrastrace.php +++ b/useful/ultrastrace.php @@ -5,6 +5,7 @@ if ($argc < 2) die("$argv[0] \n"); function parseTime($time) { + if (isset($time['ts'])) return $time['ts']; return $time['h'] * 3600 + $time['m'] * 60 + $time['s']; } @@ -24,7 +25,7 @@ foreach ($argv as $fname) { $lineNo++; $line = fgets($fh); // open("/lib/x86_64-linux-gnu/tls/x86_64/libkdeui.so.5", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) - if (preg_match('#^(\d+\s+)?(?\d+):(?\d+):(?\d+(\.\d+)?)\s#', $line, $out) >= 1) { + if (preg_match('#^(\d+\s+)?((?\d+):(?\d+):(?\d+(\.\d+)?)|(?\d+\.\d+))\s#', $line, $out) >= 1) { $time = parseTime($out); if (isset($lastLine)) { if ($time < $lastTime) $lastTime -= 86400; @@ -35,7 +36,7 @@ foreach ($argv as $fname) { $lastLine = $line; $lastTime = $time; } - if (preg_match('#^(\d+\s+)?(\d+:\d+:\d+\.?\d*\s+)?(?access|stat|lstat|stat64|lstat64|readlink|open|openat|execve)\("(?[^"]*[^"]*[^/])".*\)\s+=\s+(?\S+)(\s+(?\S+)\s+|$)#', $line, $out) < 1) continue; + if (preg_match('#^(\d+\s+)?(\d+:\d+:\d+\.?\d*\s+|\d+\.\d+\s+)?(?access|stat|lstat|stat64|lstat64|readlink|open|openat|execve)\("(?[^"]*[^"]*[^/])".*\)\s+=\s+(?\S+)(\s+(?\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); -- cgit v1.2.3-55-g7522