Ticket #390: 390-compatible-log.patch

File 390-compatible-log.patch, 1.5 KB (added by Olly Betts, 10 years ago)

Patch to produce log compatible with draw_positions.py

  • xapian-maintainer-tools/profiling/strace-analyse

    diff --git a/xapian-maintainer-tools/profiling/strace-analyse b/xapian-maintainer-tools/profiling/strace-analyse
    index 4c985b3..2a67277 100755
    a b while (<>) {  
    7272        my $block = $off / $blocksize;
    7373        $path //= $fd[$fd];
    7474        print "read $block from $path\n";
     75        $time_t = int($time_t * 1000000);
     76        $systime = int($systime * 1000000);
     77        print STDERR "r$1,$time_t,$systime,$off,$blocksize\n";
    7578    } elsif (/^pwrite(?:64)?\((\d+)(?:<(.*?)>)?, .*, (\d+), (\d+)\)/) {
    7679        my ($fd, $path, $blocksize, $off) = ($1, $2, $3, $4);
    7780        my $block = $off / $blocksize;
    7881        $path //= $fd[$fd];
    7982        print "write $block to $path\n";
     83        $time_t = int($time_t * 1000000);
     84        $systime = int($systime * 1000000);
     85        print STDERR "w$1,$time_t,$systime,$off,$blocksize\n";
    8086    } elsif (/^open\("(.*)".* = (\d+)$/) {
    8187        $fd[$2] = $1;
     88        $time_t = int($time_t * 1000000);
     89        $systime = int($systime * 1000000);
     90        print STDERR "o$2,$time_t,$systime,$1\n";
    8291    } elsif (/^close\((\d+)\)/) {
    8392        $fd[$1] = undef;
     93        $time_t = int($time_t * 1000000);
     94        $systime = int($systime * 1000000);
     95        print STDERR "c$1,$time_t,$systime,\n";
    8496    } elsif (/^dup[23]?\((\d+)[^<].* = (\d+)/) {
    8597        $fd[$2] = $fd[$1];
    8698    } elsif (/^f(?:data)?sync\((\d+)(?:<(.*?)>)?\)/) {
    8799        my $path = $2 // $fd[$1];
    88100        print "sync $path\n";
     101        $time_t = int($time_t * 1000000);
     102        $systime = int($systime * 1000000);
     103        print STDERR "s$1,$time_t,$systime,\n";
    89104    }
    90105}