decode_packet_trace.py (9706:fbb19814adbc) decode_packet_trace.py (10065:58bf21ca88de)
1#!/usr/bin/env python
2
1#!/usr/bin/env python
2
3# Copyright (c) 2013 ARM Limited
3# Copyright (c) 2013-2014 ARM Limited
4# All rights reserved
5#
6# The license below extends only to copyright in the software and shall
7# not be construed as granting a license to any other intellectual
8# property including but not limited to intellectual property relating
9# to a hardware implementation of the functionality of the software
10# licensed hereunder. You may use the software subject to the license
11# terms below provided that you ensure that this notice is replicated

--- 75 unchanged lines hidden (view full) ---

87try:
88 import packet_pb2
89except:
90 print "Did not find packet proto definitions, attempting to generate"
91 from subprocess import call
92 error = call(['protoc', '--python_out=util', '--proto_path=src/proto',
93 'src/proto/packet.proto'])
94 if not error:
4# All rights reserved
5#
6# The license below extends only to copyright in the software and shall
7# not be construed as granting a license to any other intellectual
8# property including but not limited to intellectual property relating
9# to a hardware implementation of the functionality of the software
10# licensed hereunder. You may use the software subject to the license
11# terms below provided that you ensure that this notice is replicated

--- 75 unchanged lines hidden (view full) ---

87try:
88 import packet_pb2
89except:
90 print "Did not find packet proto definitions, attempting to generate"
91 from subprocess import call
92 error = call(['protoc', '--python_out=util', '--proto_path=src/proto',
93 'src/proto/packet.proto'])
94 if not error:
95 import packet_pb2
96 print "Generated packet proto definitions"
95 print "Generated packet proto definitions"
96
97 try:
98 import google.protobuf
99 except:
100 print "Please install Python protobuf module"
101 exit(-1)
102
103 import packet_pb2
97 else:
98 print "Failed to import packet proto definitions"
99 exit(-1)
100
101def DecodeVarint(in_file):
102 """
103 The decoding of the Varint32 is copied from
104 google.protobuf.internal.decoder and is only repeated here to

--- 101 unchanged lines hidden ---
104 else:
105 print "Failed to import packet proto definitions"
106 exit(-1)
107
108def DecodeVarint(in_file):
109 """
110 The decoding of the Varint32 is copied from
111 google.protobuf.internal.decoder and is only repeated here to

--- 101 unchanged lines hidden ---