Skip to content

Commit eefa8f6

Browse files
committed
explicit split to importers and exporters
small bugfix
1 parent 6f9e3c1 commit eefa8f6

13 files changed

Lines changed: 1694 additions & 1484 deletions

File tree

‎buildall.py‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ def GetJDKPath():
8585
if err or not path:
8686
return None
8787
if sys.platform == 'darwin':
88-
return "/System/Library/Frameworks/JavaVM.framework/Headers"
88+
path = "/System/Library/Frameworks/JavaVM.framework/Headers"
89+
return (path if os.path.exists(path) else None)
8990
else:
9091
matches = []
9192
for root, dirnames, filenames in os.walk('/usr/lib/jvm'):
@@ -107,11 +108,13 @@ def main():
107108
yocto = get_yocto()
108109
if not yocto:
109110
target_bits = ['64']
110-
if sys.platform != 'darwin': #on MAC OSX we produce FAT library including both 32 and 64 bits
111+
if (sys.platform != 'darwin') or args.android: #on MAC OSX we produce FAT library including both 32 and 64 bits
111112
target_bits.append('32')
112113
else:
113114
target_bits = [yocto['bits']]
114115

116+
print "target_bits", target_bits
117+
115118
jdk_path = GetJDKPath()
116119
print "Found JDK:", jdk_path
117120

‎java/IntelSEAPI.java‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*********************************************************************************************************************************************************************************************************************************************************************************************
2+
# Intel® Single Event API
3+
#
4+
# This file is provided under a dual BSD 3-Clause license.
5+
# Copyright (c) 2015, Intel Corporation
6+
# All rights reserved.
7+
#
8+
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
9+
# Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
10+
# Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
11+
# Neither the name of the Intel Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
12+
#
13+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
14+
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
15+
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16+
#
17+
**********************************************************************************************************************************************************************************************************************************************************************************************/
18+
119
package com.intel.sea;
220
import java.util.*;
321
import java.io.File;
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
from sea_runtool import TaskCombiner
2+
3+
###################################
4+
# TODO: add OS events (sched/vsync)
5+
class BestTraceFormat(TaskCombiner):
6+
"""Writer for Best Trace Format.
7+
8+
Specs for BTF v2.1.3: https://wiki.eclipse.org/images/e/e6/TA_BTF_Specification_2.1.3_Eclipse_Auto_IWG.pdf
9+
"""
10+
11+
def __init__(self, args, tree):
12+
"""Open the .btf file and write its header."""
13+
TaskCombiner.__init__(self, tree)
14+
self.args = args
15+
self.file = open(self.get_targets()[-1], "w+b")
16+
self.file.write('#version 2.1.3\n')
17+
self.file.write('#creator GDP-SEA\n')
18+
self.file.write('#creationDate 2014-02-19T11:39:20Z\n')
19+
self.file.write('#timeScale ns\n')
20+
21+
def get_targets(self):
22+
return [self.args.output + ".btf"]
23+
24+
def complete_task(self, type, b, e):
25+
"""
26+
type -- task type : {"task", "frame", "counter"}
27+
b -- { 'thread_name': '0x6296', 'domain': 'gles.trace.ergs', 'str': 'glPopMatrix', 'time': 1443097648250368731, 'tid': 25238, 'pid': 25238}
28+
e -- { 'tid': 25238, 'thread_name': '0x6296', 'domain': 'gles.trace.ergs', 'pid': 25238, 'time': 1443097648250548143}
29+
"""
30+
# <Time>,<Source>,<SourceInstance >,<TargetType>,<Target>,<TargetInstance>,<Event>,<Note>
31+
if 'str' in b and type == "task":
32+
self.file.write("%d,%s,0,R,%s,-1,start\n" % (b['time'], b['str'], b['str']))
33+
self.file.write("%d,%s,0,R,%s,-1,terminate\n" % (e['time'], b['str'], b['str']))
34+
35+
def finish(self):
36+
""" Close the .btf file"""
37+
self.file.close()
38+
39+
@staticmethod
40+
def join_traces(traces, output):
41+
with open(output + ".btf", 'wb') as outfile:
42+
for file in traces:
43+
with open(file, 'rb') as infile:
44+
for line in infile:
45+
outfile.write(line)
46+
return output + ".btf"
47+
48+
EXPORTER_DESCRIPTORS = [{
49+
'format': 'btf',
50+
'available': True,
51+
'exporter': BestTraceFormat
52+
}]

0 commit comments

Comments
 (0)