summaryrefslogtreecommitdiffstats
path: root/useful
diff options
context:
space:
mode:
authorSimon Rettberg2013-05-14 16:41:56 +0200
committerSimon Rettberg2013-05-14 16:41:56 +0200
commit113ce521770232a6d99cdb07dd55d8879214c213 (patch)
treec1233152bfb18b8bd427cf3a1178900bfd768d8c /useful
parentultrastracke 2 (diff)
parentultrastracke update (diff)
downloadtm-scripts-113ce521770232a6d99cdb07dd55d8879214c213.tar.gz
tm-scripts-113ce521770232a6d99cdb07dd55d8879214c213.tar.xz
tm-scripts-113ce521770232a6d99cdb07dd55d8879214c213.zip
Merge branch 'master' of openslx:openslx-ng/tm-scripts
Diffstat (limited to 'useful')
-rwxr-xr-xuseful/ultrastrace.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/useful/ultrastrace.php b/useful/ultrastrace.php
index 8c826ee5..0caaf64a 100755
--- a/useful/ultrastrace.php
+++ b/useful/ultrastrace.php
@@ -5,6 +5,7 @@ if ($argc < 2) die("$argv[0] <tracefile>\n");
function parseTime($time)
{
+ if (isset($time['ts'])) return $time['ts'];
return $time['h'] * 3600 + $time['m'] * 60 + $time['s'];
}
@@ -30,7 +31,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+)?(?<h>\d+):(?<m>\d+):(?<s>\d+(\.\d+)?)\s#', $line, $out) >= 1) {
+ if (preg_match('#^(\d+\s+)?((?<h>\d+):(?<m>\d+):(?<s>\d+(\.\d+)?)|(?<ts>\d+\.\d+))\s#', $line, $out) >= 1) {
$time = parseTime($out);
if (isset($lastLine)) {
if ($time < $lastTime) $lastTime -= 86400;
@@ -41,7 +42,7 @@ foreach ($argv as $fname) {
$lastLine = $line;
$lastTime = $time;
}
- if (preg_match('#^(\d+\s+)?(\d+:\d+:\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|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);