-#! /usr/bin/perl\r
-\r
-# ------------------------------------------------\r
-# Copyright 2014 AT&T Intellectual Property\r
-# Licensed under the Apache License, Version 2.0 (the "License");\r
-# you may not use this file except in compliance with the License.\r
-# You may obtain a copy of the License at\r
-#\r
-# http://www.apache.org/licenses/LICENSE-2.0\r
-#\r
-# Unless required by applicable law or agreed to in writing, software\r
-# distributed under the License is distributed on an "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-# See the License for the specific language governing permissions and\r
-# limitations under the License.\r
-# -------------------------------------------\r
-\r
-\r
-$infl = "/var/log/gstrace";\r
-\r
-if(scalar(@ARGV)>0){\r
- $infl = $ARGV[0];\r
-}\r
-\r
-open I,$infl or die "Can't open input log file $infl\n";\r
-\r
-%rts_pids= ();\r
-%hfta_pids = ();\r
-while($line=<I>){\r
- if($line =~ /rts:\[.*\]: Started Logging/){\r
- %rts_pids= ();\r
- %hfta_pids = ();\r
- }\r
- if($line =~ /hfta_(\d+):\[(\d+)\]: Started Logging/){\r
- $name = "hfta_" . $1;\r
- $hfta_pids{$name} = $2;\r
- }\r
- if($line =~ /rts:\[(\d+)\]: Init LFTAs for (\w+)/){\r
- $name = "rts " . $2;\r
- $rts_pids{$name} = $1;\r
- }\r
-}\r
-\r
-#foreach $k (keys(%rts_pids)){\r
-# print "$k, ",$rts_pids{$k},"\n";\r
-#}\r
-#foreach $k (keys(%hfta_pids)){\r
-# print "$k, ",$hfta_pids{$k},"\n";\r
-#}\r
- \r
-open C,"pinning_info.csv" or die "Can't open pinning_info.csv\n";\r
-\r
-while($line=<C>){\r
- chomp($line);\r
- @flds = split /,/,$line;\r
- if(exists($rts_pids{$flds[0]})){\r
- $pinning_cmd = "taskset -pc $flds[1] ". $rts_pids{$flds[0]};\r
- }\r
- if(exists($hfta_pids{$flds[0]})){\r
- $pinning_cmd = "taskset -pc $flds[1] ". $hfta_pids{$flds[0]};\r
- }\r
- print "Executing $pinning_cmd\n";\r
- system($pinning_cmd);\r
-}\r
-\r
+#! /usr/bin/perl
+
+# ------------------------------------------------
+# Copyright 2014 AT&T Intellectual Property
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# -------------------------------------------
+
+
+$infl = "/var/log/gstrace";
+
+if(scalar(@ARGV)>0){
+ $infl = $ARGV[0];
+}
+
+open I,$infl or die "Can't open input log file $infl\n";
+
+%rts_pids= ();
+%hfta_pids = ();
+while($line=<I>){
+ if($line =~ /rts:\[.*\]: Started Logging/){
+ %rts_pids= ();
+ %hfta_pids = ();
+ }
+ if($line =~ /hfta_(\d+):\[(\d+)\]: Started Logging/){
+ $name = "hfta_" . $1;
+ $hfta_pids{$name} = $2;
+ }
+ if($line =~ /rts:\[(\d+)\]: Init LFTAs for (\w+)/){
+ $name = "rts " . $2;
+ $rts_pids{$name} = $1;
+ }
+}
+
+#foreach $k (keys(%rts_pids)){
+# print "$k, ",$rts_pids{$k},"\n";
+#}
+#foreach $k (keys(%hfta_pids)){
+# print "$k, ",$hfta_pids{$k},"\n";
+#}
+
+open C,"pinning_info.csv" or die "Can't open pinning_info.csv\n";
+
+while($line=<C>){
+ chomp($line);
+ @flds = split /,/,$line;
+ if(exists($rts_pids{$flds[0]})){
+ $pinning_cmd = "taskset -pc $flds[1] ". $rts_pids{$flds[0]};
+ }
+ if(exists($hfta_pids{$flds[0]})){
+ $pinning_cmd = "taskset -pc $flds[1] ". $hfta_pids{$flds[0]};
+ }
+ print "Executing $pinning_cmd\n";
+ system($pinning_cmd);
+}
+