41
|
1 |
------------TraceCompiler------------
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
----What is TraceCompiler?----
|
|
6 |
|
|
7 |
TraceCompiler will find OST (Open System Trace) traces from source files and generate needed headers and decode files for them
|
|
8 |
during component compilation time.
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
----What are OST traces?----
|
|
13 |
|
|
14 |
Open System Trace traces. Macros can be found from the header OpenSystemTrace.h. OST is a binary tracing concept for good performance
|
|
15 |
and run-time activation of traces.
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
----How to set up TraceCompiler?----
|
|
20 |
|
|
21 |
Remove comments before exports from group folder bld.inf
|
|
22 |
When compiled from the group folder, will export itself to /epoc32/tools folder.
|
|
23 |
|
|
24 |
Usually TraceCompiler is already integrated to Symbian build system, so there is no need to run TraceCompiler separately. Symbian build system calls
|
|
25 |
TraceCompiler automatically during component compilation.
|
|
26 |
|
|
27 |
If TraceCompiler is not integrated to build system but is needed to be run automatically when building a component
|
|
28 |
abld.pl in /epoc32/tools/ needs to be changed to call tracecompiler.pl file. Note that the change might already be there.
|
|
29 |
|
|
30 |
Change is done after a line like this:
|
|
31 |
"foreach $LoopBld (@Blds) {"
|
|
32 |
|
|
33 |
And the change is this: (First line is comment)
|
|
34 |
|
|
35 |
# Add the TraceCompiler once to the Calls array when TARGET is called
|
|
36 |
$Command eq "TARGET" and not scalar grep(/tracecompiler\.pl/,@Calls) and push @Calls, "perl /epoc32/tools/tracecompiler.pl $Plat $Program";
|
|
37 |
|
|
38 |
|
|
39 |
|
|
40 |
----How to use TraceCompiler?----
|
|
41 |
|
|
42 |
Usually TraceCompiler is already integrated to Symbian build system, so there is no need to run TraceCompiler separately. Symbian build system calls
|
|
43 |
TraceCompiler automatically during component compilation.
|
|
44 |
|
|
45 |
If there is need to run TraceCompiler manually, it can be done following way:
|
|
46 |
|
|
47 |
perl /epoc32/tools/tracecompiler.pl <platform> [program]
|
|
48 |
|
|
49 |
For example: perl /epoc32/tools/tracecompiler.pl armv5
|
|
50 |
|
|
51 |
|
|
52 |
|
|
53 |
----How to actually get the traces?----
|
|
54 |
Open System Trace macros use Symbian BTrace framework to forward the traces. To get these traces, you must implement a trace handler which will
|
|
55 |
register itself to the Symbian BTrace using command BTrace::SetHandler( MyHandler ). Then it's up to you what to do with the traces.
|
|
56 |
|
|
57 |
|
|
58 |
|
|
59 |
----What is happening in TraceCompiler?----
|
|
60 |
|
|
61 |
1. tracecompiler.pl first runs a Java check to ensure that Java 1.5 or newer is found from the system. If this fails, tracecompiler.pl will exit.
|
|
62 |
|
|
63 |
If Java check is OK, tracecompiler.pl opens a "abld.bat" file which is generated by command "bldmake bldfiles". From that file, a path to
|
|
64 |
MAKEFILE generated by "bldmake bldfiles" is searched. This MAKEFILE is then opened and is parsed for a list of project MMP files. These MMP
|
|
65 |
files are then forwarded to the tracecompiler_parse_mmp.pl script.
|
|
66 |
|
|
67 |
2. tracecompiler_parse_mmp.pl gets a MMP file as a parameter. It parses the MMP file for UID of the component and paths to all the source files.
|
|
68 |
NOTE that MACROS are NOT supported! If UID cannot be found from the MMP file, tracecompiler_parse_mmp.pl will exit. If UID is found,
|
|
69 |
TraceCompiler Java application is started and the component UID is given to it as a parameter. After it's started, component name, the path
|
|
70 |
to the MMP file of the component and a list of source paths are send to STDOUT of TraceCompiler Java application. When all source paths are
|
|
71 |
send, tracecompiler_parse_mmp.pl sends end tag "*ENDOFSOURCEFILES*" to TraceCompiler so it knows all the sources are then sent.
|
|
72 |
|
|
73 |
3. TraceCompiler Java application listens to STDIN for component name, MMP file path and the paths to the source files. When it receives
|
|
74 |
"*ENDOFSOURCEFILES*" tag, it starts processing the source files. It finds all OST traces from the source files and generates needed headers
|
|
75 |
for the application to compile properly. It also generates autogen header and Symbian Dictionary file from the traces.
|