提交 41c10799 编写于 作者: M minqiyang

Port tools

上级 0dc5d9c2
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from __future__ import print_function
import sys import sys
import re import re
...@@ -46,7 +48,7 @@ Diff: set(['test_parallel_executor_crf']) ...@@ -46,7 +48,7 @@ Diff: set(['test_parallel_executor_crf'])
start_parts = escape(l).split(" ") start_parts = escape(l).split(" ")
m = re.search("Start\s+[0-9]+\:\s([a-z0-9_]+)", escape(l)) m = re.search("Start\s+[0-9]+\:\s([a-z0-9_]+)", escape(l))
started.add(m.group(1)) started.add(m.group(1))
print "Diff: ", started - passed print("Diff: ", started - passed)
if __name__ == "__main__": if __name__ == "__main__":
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
import argparse import argparse
import json import json
import six
import sys import sys
import unittest import unittest
...@@ -124,7 +125,7 @@ class Timeline(object): ...@@ -124,7 +125,7 @@ class Timeline(object):
return cur_pid return cur_pid
def _allocate_pids(self): def _allocate_pids(self):
for k, profile_pb in self._profile_dict.iteritems(): for k, profile_pb in six.iteritems(self._profile_dict):
for event in profile_pb.events: for event in profile_pb.events:
if event.type == profiler_pb2.Event.CPU: if event.type == profiler_pb2.Event.CPU:
if (k, event.device_id, "CPU") not in self._devices: if (k, event.device_id, "CPU") not in self._devices:
...@@ -140,7 +141,7 @@ class Timeline(object): ...@@ -140,7 +141,7 @@ class Timeline(object):
(k, event.device_id), pid) (k, event.device_id), pid)
def _allocate_events(self): def _allocate_events(self):
for k, profile_pb in self._profile_dict.iteritems(): for k, profile_pb in six.iteritems(self._profile_dict):
for event in profile_pb.events: for event in profile_pb.events:
if event.type == profiler_pb2.Event.CPU: if event.type == profiler_pb2.Event.CPU:
type = "CPU" type = "CPU"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册