Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Simple tools for analyzing palacios serial output file
[palacios.git] / utils / output_analysis / guest_kernel_calls.pl
1 #!/usr/bin/perl -w
2
3 $#ARGV==0 or die "Decodes guest RIP addresses against a guest kernel dissassembly file\nThis tells you which functions in the guest kernel are being used\nusage: guest_kernel_calls.pl disassmfile < RIPS\n";
4
5 open(K,shift);
6
7 @k = <K>;
8
9 close(K);
10
11 while (<STDIN>) { 
12   if (/RIP Linear: (\S+)/) { 
13     $addr=$1;
14     chomp($addr);
15     print join("\t",$addr,findit($addr)),"\n";
16   }
17 }
18
19
20 sub findit {
21   my $addr=shift;
22   my $i;
23   my $line=-1;
24   my $funcline=-1;
25   my $funcaddr;
26   my $funcname;
27
28   if (substr($addr,0,1) eq "0") { 
29     return "USER";
30   } else {
31     # search forward
32     for ($i=0;$i<=$#k;$i++) { 
33       if ($k[$i] =~ /^(\S+):/) {
34         $x=$1;
35         if ($x eq $addr) { 
36           $line=$i;
37           last;
38         }
39       }
40     }
41     if ($line<0) {
42       return "CANNOT FIND IN DISASSEMBLY";
43     } else {
44       # search backward
45       for ($i=$line;$i>=0;$i--) { 
46         if ($k[$i] =~ /^(\S+)\s\<(\S+)\>:/) {
47           $funcline=$i;
48           $funcname=$2; 
49           $funcaddr=$1;
50           last;
51         }
52       } 
53       if ($funcline<0) { 
54         return "CANNOT FIND FUNCTION IN DISASSEMBLY";
55       } else {
56         return $funcname." at ".$funcaddr;
57       }
58     }
59   }
60 }
61       
62           
63     
64   
65