backup: Wire up qemu full pull backup commands over QMP
[libvirt/ericb.git] / tests / oomtrace.pl
blobf799262f2c1f48404ad77befb1d5a976783af671
1 #!/usr/bin/env perl
3 use strict;
4 use warnings;
6 (my $ME = $0) =~ s|.*/||;
7 # use File::Coda; # http://meyering.net/code/Coda/
8 END {
9 defined fileno STDOUT or return;
10 close STDOUT and return;
11 warn "$ME: failed to close standard output: $!\n";
12 $? ||= 1;
16 my @data = <>;
19 my %trace;
20 my %lines;
22 foreach (@data) {
23 if (/^\s*TRACE:\s+(\S+?)(?:\(.*\))?\s+\[0x(.*)\]\s*$/ ) {
24 $trace{$2} = $1;
28 foreach my $key (keys %trace) {
29 my $val = $trace{$key};
30 my $info = $val =~ /\?\?/ ? $val : `addr2line -e $val $key`;
31 $lines{$key} = $info;
35 foreach (@data) {
36 if (/^\s*TRACE:\s+(\S+?)(?:\(.*\))?\s+\[0x(.*)\]\s*$/ ) {
37 print $lines{$2};
38 } else {
39 print;