[project @ 1996-07-19 18:36:04 by partain]
[ghc-hetmet.git] / ghc / utils / parallel / gr2qp.pl
1 while(<>) {
2     chop;
3     ($PE, $pe, $time, $act, $tid, $rest) = split;
4     next if $act eq 'REPLY';
5     chop($tid) if $act eq 'END';
6     $from = $queue{$tid};
7     $extra = "";
8     if ($act eq 'START') {
9         $from = '*';
10         $to = 'G';
11     } elsif ($act eq 'START(Q)') {
12         $from = '*';
13         $to = 'A';
14     } elsif ($act eq 'STEALING') {
15         $to = 'C';
16     } elsif ($act eq 'STOLEN') {
17         $to = 'G';
18     } elsif ($act eq 'STOLEN(Q)') {
19         $to = 'A';
20     } elsif ($act eq 'FETCH') {
21         $to = 'Y';
22     } elsif ($act eq 'BLOCK') {
23         $to = 'R';
24     } elsif ($act eq 'RESUME') {
25         $to = 'G';
26         $extra = " 0 0x0";
27     } elsif ($act eq 'RESUME(Q)') {
28         $to = 'A';
29         $extra = " 0 0x0";
30     } elsif ($act eq 'END') {
31         $to = '*';
32     } elsif ($act eq 'SCHEDULE') {
33         $to = 'G';
34     } elsif ($act eq 'DESCHEDULE') {
35         $to = 'A';
36     }
37     $queue{$tid} = $to;
38
39     if ($to ne $from) {
40         print substr($time,1,length($time)-3), " ", 
41           $from, $to, " 0 0x", $tid, $extra, "\n";
42     }
43     delete $queue{$tid} if $to eq '*';
44     
45 }