D:\tmp>anyprogram.rex
1 D:\tmp\anyprogram.rex hello, world!
6 INTERNALTESTROUTINE
9 TESTROUTINE

====================================================================

D:\tmp>tracetool -ta anyprogram.rex
--> running [anyprogram.rex], arguments=[]

1 anyprogram.rex hello, world!
6 INTERNALTESTROUTINE
9 TESTROUTINE

--> tracelog written to: anyprogram.rex_trace.xml
--> msg~completed: 1 msg~hasError: 0

D:\tmp>dir
 Volume in drive D is root_d
 Volume Serial Number is 0509-DBAB

 Directory of D:\tmp

03.05.2025  15:48    <DIR>          .
03.05.2025  15:48    <DIR>          ..
03.05.2025  15:46               210 anyprogram.rex
03.05.2025  15:46            13 524 anyprogram.rex_trace.xml



====================================================================

D:\tmp>tracetool -s anyprogram.rex_trace.xml
       +++ tracetool.rex for [anyprogram.rex] (start collecting)
       >I> Routine "anyprogram.rex" in package "anyprogram.rex".
     1 *-* say .line .context~name 'hello, world!'
     2 *-* call internalTestRoutine
     5 *-*   internalTestRoutine:
     6 *-*   say .line .context~name
     7 *-*   return
     3 *-* call testRoutine
       >I> Routine "TESTROUTINE" in package "anyprogram.rex".
     9 *-* say .line .context~name
    10 *-* return
       <I< Routine "TESTROUTINE" in package "anyprogram.rex".
     4 *-* exit
       <I< Routine "anyprogram.rex" in package "anyprogram.rex".
       +++ tracetool.rex for [anyprogram.rex] (end collecting)

D:\tmp>tracetool -s -fs anyprogram.rex_trace.xml
[T0  I0 ]                      +++ tracetool.rex for [anyprogram.rex] (start collecting)
[T2  I3 ]                      >I> Routine "anyprogram.rex" in package "anyprogram.rex".
[T2  I3 ]                    1 *-* say .line .context~name 'hello, world!'
[T2  I3 ]                    2 *-* call internalTestRoutine
[T2  I4 ]                    5 *-*   internalTestRoutine:
[T2  I4 ]                    6 *-*   say .line .context~name
[T2  I4 ]                    7 *-*   return
[T2  I3 ]                    3 *-* call testRoutine
[T2  I5 ]                      >I> Routine "TESTROUTINE" in package "anyprogram.rex".
[T2  I5 ]                    9 *-* say .line .context~name
[T2  I5 ]                   10 *-* return
[T2  I5 ]                      <I< Routine "TESTROUTINE" in package "anyprogram.rex".
[T2  I3 ]                    4 *-* exit
[T2  I3 ]                      <I< Routine "anyprogram.rex" in package "anyprogram.rex".
[T0  I0 ]                      +++ tracetool.rex for [anyprogram.rex] (end collecting)

====================================================================

D:\tmp>tracetool -c -fj anyprogram.rex_trace.xml
... line # 548: [anyprogram.rex_trace.xml]: [15] traceObject items read

D:\tmp>dir
 Volume in drive D is root_d
 Volume Serial Number is 0509-DBAB

 Directory of D:\tmp

03.05.2025  15:50    <DIR>          .
03.05.2025  15:50    <DIR>          ..
03.05.2025  15:46               210 anyprogram.rex
03.05.2025  15:46            13 524 anyprogram.rex_trace.xml
03.05.2025  15:50             9 749 anyprogram.rex_trace.xml.converted.json

----------------
D:\tmp>type anyprogram.rex_trace.xml
<traceLog>
   <traceObject>
      <option>P</option>
      <number>1</number>
      <timestamp>2025-05-03T15:46:52.442000</timestamp>
      <interpreter>0</interpreter>
      <thread>0</thread>
      <invocation>0</invocation>
      <lineNr>398</lineNr>
      <stackFrame>
         <arguments></arguments>
         <executableId>FFFFFE81_C03BB9AF</executableId>
         <executablePackage>D:\tmp\tracetool.rex</executablePackage>
         <invocation>2</invocation>
         <line>398</line>
         <name>traceLogStart</name>
         <package>tracetool.rex</package>
         <target>.nil</target>
         <thread>1</thread>
         <traceLine>.nil</traceLine>
         <type>ROUTINE</type>
      </stackFrame>
      <traceLine>       +++ tracetool.rex for [anyprogram.rex] (start collecting)</traceLine>
   </traceObject>
   <traceObject>
      <option>P</option>
      <number>2</number>
      <timestamp>2025-05-03T15:46:52.442000</timestamp>
      <interpreter>1</interpreter>
      <thread>2</thread>
      <invocation>3</invocation>
      <lineNr>1</lineNr>
      <callerStackFrame>
         <arguments></arguments>
         <executableId>FFFFFE81_C05122AF</executableId>
         <executablePackage>REXX</executablePackage>
         <invocation>.nil</invocation>
         <line>.nil</line>
         <name>CALL</name>
         <package>REXX</package>
         <scope>Routine</scope>
         <scopeId>FFFFFE81_C0512F1F</scopeId>
         <scopePackage>REXX</scopePackage>
         <target>a Routine</target>
         <targetCanonicalName>a Routine</targetCanonicalName>
         <targetId>FFFFFE81_C00906AF</targetId>
         <targetPackage>REXX</targetPackage>
         <targetPackageId>FFFFFE81_C064A12F</targetPackageId>
         <traceLine>       *-* Compiled method "CALL" with scope "Routine".</traceLine>
         <type>METHOD</type>
      </callerStackFrame>
      <stackFrame>
         <arguments></arguments>
         <executableId>FFFFFE81_C00906AF</executableId>
         <executablePackage>anyprogram.rex</executablePackage>
         <invocation>3</invocation>
         <line>1</line>
         <name>anyprogram.rex</name>
         <package>anyprogram.rex</package>
         <target>.nil</target>
         <traceLine>     1 *-* say .line .context~name 'hello, world!'</traceLine>
         <type>ROUTINE</type>
      </stackFrame>
      <traceLine>       &gt;I&gt; Routine "anyprogram.rex" in package "anyprogram.rex".</traceLine>
   </traceObject>
   <traceObject>
      <option>P</option>
      <number>3</number>
      <timestamp>2025-05-03T15:46:52.442000</timestamp>
      <interpreter>1</interpreter>
      <thread>2</thread>
      <invocation>3</invocation>
      <lineNr>1</lineNr>
      <stackFrame>
         <arguments></arguments>
         <executableId>FFFFFE81_C00906AF</executableId>
         <executablePackage>anyprogram.rex</executablePackage>
         <invocation>3</invocation>
         <line>1</line>
         <name>anyprogram.rex</name>
         <package>anyprogram.rex</package>
         <target>.nil</target>
         <traceLine>     1 *-* say .line .context~name 'hello, world!'</traceLine>
         <type>ROUTINE</type>
      </stackFrame>
      <traceLine>     1 *-* say .line .context~name 'hello, world!'</traceLine>
   </traceObject>
   <traceObject>
      <option>P</option>
      <number>4</number>
      <timestamp>2025-05-03T15:46:52.442000</timestamp>
      <interpreter>1</interpreter>
      <thread>2</thread>
      <invocation>3</invocation>
      <lineNr>2</lineNr>
      <stackFrame>
         <arguments></arguments>
         <executableId>FFFFFE81_C00906AF</executableId>
         <executablePackage>anyprogram.rex</executablePackage>
         <invocation>3</invocation>
         <line>2</line>
         <name>anyprogram.rex</name>
         <package>anyprogram.rex</package>
         <target>.nil</target>
         <traceLine>     2 *-* call internalTestRoutine</traceLine>
         <type>ROUTINE</type>
      </stackFrame>
      <traceLine>     2 *-* call internalTestRoutine</traceLine>
   </traceObject>
... cut ...

------------------
D:\tmp>type anyprogram.rex_trace.xml.converted.json
[
   {
      "option": "P",
      "number": 1,
      "timestamp": "2025-05-03T15:46:52.442000",
      "interpreter": 0,
      "thread": 0,
      "invocation": 0,
      "lineNr": 398,
      "stackFrame": {
                 "arguments": "",
                 "executableId": "FFFFFE81_C03BB9AF",
                 "executablePackage": "D:\\tmp\\tracetool.rex",
                 "invocation": 2,
                 "line": 398,
                 "name": "traceLogStart",
                 "package": "tracetool.rex",
                 "target": null,
                 "thread": 1,
                 "traceLine": null,
                 "type": "ROUTINE"
                 },
      "traceLine": "       +++ tracetool.rex for [anyprogram.rex] (start collecting)"
   },
   {
      "option": "P",
      "number": 2,
      "timestamp": "2025-05-03T15:46:52.442000",
      "interpreter": 1,
      "thread": 2,
      "invocation": 3,
      "lineNr": 1,
      "callerStackFrame": {
                 "arguments": "",
                 "executableId": "FFFFFE81_C05122AF",
                 "executablePackage": "REXX",
                 "invocation": null,
                 "line": null,
                 "name": "CALL",
                 "package": "REXX",
                 "scope": "Routine",
                 "scopeId": "FFFFFE81_C0512F1F",
                 "scopePackage": "REXX",
                 "target": "a Routine",
                 "targetCanonicalName": "a Routine",
                 "targetId": "FFFFFE81_C00906AF",
                 "targetPackage": "REXX",
                 "targetPackageId": "FFFFFE81_C064A12F",
                 "traceLine": "       *-* Compiled method \"CALL\" with scope \"Routine\".",
                 "type": "METHOD"
                 },
      "stackFrame": {
                 "arguments": "",
                 "executableId": "FFFFFE81_C00906AF",
                 "executablePackage": "anyprogram.rex",
                 "invocation": 3,
                 "line": 1,
                 "name": "anyprogram.rex",
                 "package": "anyprogram.rex",
                 "target": null,
                 "traceLine": "     1 *-* say .line .context~name 'hello, world!'",
                 "type": "ROUTINE"
                 },
      "traceLine": "       >I> Routine \"anyprogram.rex\" in package \"anyprogram.rex\"."
   },
   {
      "option": "P",
      "number": 3,
      "timestamp": "2025-05-03T15:46:52.442000",
      "interpreter": 1,
      "thread": 2,
      "invocation": 3,
      "lineNr": 1,
      "stackFrame": {
                 "arguments": "",
                 "executableId": "FFFFFE81_C00906AF",
                 "executablePackage": "anyprogram.rex",
                 "invocation": 3,
                 "line": 1,
                 "name": "anyprogram.rex",
                 "package": "anyprogram.rex",
                 "target": null,
                 "traceLine": "     1 *-* say .line .context~name 'hello, world!'",
                 "type": "ROUTINE"
                 },
      "traceLine": "     1 *-* say .line .context~name 'hello, world!'"
   },
   {
      "option": "P",
      "number": 4,
      "timestamp": "2025-05-03T15:46:52.442000",
      "interpreter": 1,
      "thread": 2,
      "invocation": 3,
      "lineNr": 2,
      "stackFrame": {
                 "arguments": "",
                 "executableId": "FFFFFE81_C00906AF",
                 "executablePackage": "anyprogram.rex",
                 "invocation": 3,
                 "line": 2,
                 "name": "anyprogram.rex",
                 "package": "anyprogram.rex",
                 "target": null,
                 "traceLine": "     2 *-* call internalTestRoutine",
                 "type": "ROUTINE"
                 },
      "traceLine": "     2 *-* call internalTestRoutine"
   },
   {
      "option": "P",
      "number": 5,
      "timestamp": "2025-05-03T15:46:52.442000",
      "interpreter": 1,
      "thread": 2,
      "invocation": 4,
      "lineNr": 5,
      "stackFrame": {
                 "arguments": "",
                 "executableId": "FFFFFE81_C00906AF",
                 "executablePackage": "anyprogram.rex",
                 "invocation": 4,
                 "line": 5,
                 "name": "INTERNALTESTROUTINE",
                 "package": "anyprogram.rex",
                 "target": null,
                 "traceLine": "     5 *-*   internalTestRoutine:",
                 "type": "INTERNALCALL"
                 },
      "traceLine": "     5 *-*   internalTestRoutine:"
   },
... cut ...

====================================================================

D:\tmp>tracetool.rex -p anyprogram.rex_trace.xml
profiling needs to analyze 15 traceObjects ...
>>> ordered descendingly by duration of executables (% of total duration):
--------------------------------------------------------------------------
  0.00% 00:00:00.000000 called      1 times/calling   1 execs [anyprogram.rex (ROUTINE L# 1 in anyprogram.rex)]
  0.00% 00:00:00.000000 called      1 times/calling   0 execs [anyprogram.rex/INTERNALTESTROUTINE (INTERNALCALL L# 5 in anyprogram.rex)]
  0.00% 00:00:00.000000 called      1 times/calling   0 execs [TESTROUTINE (ROUTINE L# 9 in anyprogram.rex)]

>>> aggregated duration call tree (% of global total duration):
---------------------------------------------------------------
  0.00% 00:00:00.000000 called      1 times/calling   1 execs [anyprogram.rex (ROUTINE L# 1 in anyprogram.rex)]
      0.00% 00:00:00.000000 called      1 times/calling   0 execs [TESTROUTINE (ROUTINE L# 9 in anyprogram.rex)]

>>> averaged duration call tree (% of global total duration):
-------------------------------------------------------------
  0.00% 00:00:00.000000 called      1 times 00:00:00.000000/calling   1 execs [anyprogram.rex (ROUTINE L# 1 in anyprogram.rex)]
      0.00% 00:00:00.000000 called      1 times 00:00:00.000000/calling   0 execs [TESTROUTINE (ROUTINE L# 9 in anyprogram.rex)]

>>> aggregated duration call tree (% of group's total duration):
----------------------------------------------------------------
  0.00% 00:00:00.000000 called      1 times/calling   1 execs [anyprogram.rex (ROUTINE L# 1 in anyprogram.rex)]
      0.00% 00:00:00.000000 called      1 times/calling   0 execs [TESTROUTINE (ROUTINE L# 9 in anyprogram.rex)]

>>> averaged duration call tree (% of group's total duration):
--------------------------------------------------------------
  0.00% 00:00:00.000000 called      1 times 00:00:00.000000/calling   1 execs [anyprogram.rex (ROUTINE L# 1 in anyprogram.rex)]
      0.00% 00:00:00.000000 called      1 times 00:00:00.000000/calling   0 execs [TESTROUTINE (ROUTINE L# 9 in anyprogram.rex)]

>>> aggregated duration call tree (% of group's total duration relative to caller):
-----------------------------------------------------------------------------------
  0.00% 00:00:00.000000 called      1 times/calling   1 execs [anyprogram.rex (ROUTINE L# 1 in anyprogram.rex)]
      0.00% 00:00:00.000000 called      1 times/calling   0 execs [TESTROUTINE (ROUTINE L# 9 in anyprogram.rex)]

>>> averaged duration call tree (% of group's total duration relative to caller):
---------------------------------------------------------------------------------
  0.00% 00:00:00.000000 called      1 times 00:00:00.000000/calling   1 execs [anyprogram.rex (ROUTINE L# 1 in anyprogram.rex)]
      0.00% 00:00:00.000000 called      1 times 00:00:00.000000/calling   0 execs [TESTROUTINE (ROUTINE L# 9 in anyprogram.rex)]

---

D:\tmp>tracetool.rex -p -sl anyprogram.rex_trace.xml
profiling needs to analyze 15 traceObjects ...
>>> ordered descendingly by duration of executables (% of total duration):
--------------------------------------------------------------------------
  0.00% 00:00:00.000000 called      1 times/calling   1 execs [anyprogram.rex (ROUTINE L# 1 in anyprogram.rex)]
  0.00% 00:00:00.000000 called      1 times/calling   0 execs [anyprogram.rex/INTERNALTESTROUTINE (INTERNALCALL L# 5 in anyprogram.rex)]
  0.00% 00:00:00.000000 called      1 times/calling   0 execs [TESTROUTINE (ROUTINE L# 9 in anyprogram.rex)]

>>> aggregated duration call tree (% of global total duration):
---------------------------------------------------------------
  0.00% 00:00:00.000000 called      1 times/calling   1 execs [anyprogram.rex (ROUTINE L# 1 in anyprogram.rex)]
      0.00% 00:00:00.000000 called      1 times/calling   0 execs [TESTROUTINE (ROUTINE L# 9 in anyprogram.rex)]

>>> averaged duration call tree (% of global total duration):
-------------------------------------------------------------
  0.00% 00:00:00.000000 called      1 times 00:00:00.000000/calling   1 execs [anyprogram.rex (ROUTINE L# 1 in anyprogram.rex)]
      0.00% 00:00:00.000000 called      1 times 00:00:00.000000/calling   0 execs [TESTROUTINE (ROUTINE L# 9 in anyprogram.rex)]

>>> aggregated duration call tree (% of group's total duration):
----------------------------------------------------------------
  0.00% 00:00:00.000000 called      1 times/calling   1 execs [anyprogram.rex (ROUTINE L# 1 in anyprogram.rex)]
      0.00% 00:00:00.000000 called      1 times/calling   0 execs [TESTROUTINE (ROUTINE L# 9 in anyprogram.rex)]

>>> averaged duration call tree (% of group's total duration):
--------------------------------------------------------------
  0.00% 00:00:00.000000 called      1 times 00:00:00.000000/calling   1 execs [anyprogram.rex (ROUTINE L# 1 in anyprogram.rex)]
      0.00% 00:00:00.000000 called      1 times 00:00:00.000000/calling   0 execs [TESTROUTINE (ROUTINE L# 9 in anyprogram.rex)]

>>> aggregated duration call tree (% of group's total duration relative to caller):
-----------------------------------------------------------------------------------
  0.00% 00:00:00.000000 called      1 times/calling   1 execs [anyprogram.rex (ROUTINE L# 1 in anyprogram.rex)]
      0.00% 00:00:00.000000 called      1 times/calling   0 execs [TESTROUTINE (ROUTINE L# 9 in anyprogram.rex)]

>>> averaged duration call tree (% of group's total duration relative to caller):
---------------------------------------------------------------------------------
  0.00% 00:00:00.000000 called      1 times 00:00:00.000000/calling   1 execs [anyprogram.rex (ROUTINE L# 1 in anyprogram.rex)]
      0.00% 00:00:00.000000 called      1 times 00:00:00.000000/calling   0 execs [TESTROUTINE (ROUTINE L# 9 in anyprogram.rex)]

3181: CREATESQL - depending on the size of the tracelog (15 items) this may take a while ...

created sql script [anyprogram_rex_trace_20250503_154652_db.sql] for database [anyprogram_rex_trace_20250503_154652_db] based on [anyprogram.rex_trace.xml]
    sqlite3 anyprogram_rex_trace_20250503_154652_db.db < anyprogram_rex_trace_20250503_154652_db.sql

D:\tmp>

---


D:\tmp>dir
 Volume in drive D is root_d
 Volume Serial Number is 0509-DBAB

 Directory of D:\tmp

03.05.2025  15:56    <DIR>          .
03.05.2025  15:56    <DIR>          ..
03.05.2025  15:46               210 anyprogram.rex
03.05.2025  15:46            13 524 anyprogram.rex_trace.xml
03.05.2025  15:50             9 749 anyprogram.rex_trace.xml.converted.json
03.05.2025  15:56            33 907 anyprogram_rex_trace_20250503_154652_db.sql


====================================================================



====================================================================
====================================================================
====================================================================
====================================================================
