Skip to content

[GR-60806] The Truffle Profiler somtimes incorrectly skips tiers in calltree mode #10393

Closed
@simonis

Description

@simonis

The Truffle Profiler somtimes incorrectly skips tiers in calltree mode. Taking a "calltree" profile of the Truffle program from ProfilerCLITest::runSampler() currently looks as follows:

Sampling Call Tree. Recorded 113 samples with period 10ms. Missed 40 samples.
  Self Time: Time spent on the top of the stack.
  Total Time: Time spent somewhere on the stack.
  T0: Percent of time spent in interpreter.
  T2: Percent of time spent in code compiled by tier 2 compiler.
----------------------------------------------------------------------------------------------------------------------------------
 Name       ||             Total Time    |   T0   |   T2   ||              Self Time    |   T0   |   T2   || Location             
----------------------------------------------------------------------------------------------------------------------------------
            ||             1130ms 100.0% | 100.0% |   0.0% ||                0ms   0.0% |   0.0% |   0.0% || test~1:0-161
  baz       ||             1030ms  91.2% |  32.0% |  58.3% ||                0ms   0.0% |   0.0% |   0.0% || test~1:98-139
   bar      ||             1030ms  91.2% |   4.9% |  93.2% ||                0ms   0.0% |   0.0% |   0.0% || test~1:43-84
    foo     ||             1030ms  91.2% |   0.0% |  99.0% ||             1030ms  91.2% |   0.0% |  99.0% || test~1:16-29
  bar       ||              100ms   8.8% |   0.0% | 100.0% ||                0ms   0.0% |   0.0% |   0.0% || test~1:43-84
   foo      ||              100ms   8.8% |   0.0% | 100.0% ||              100ms   8.8% |   0.0% | 100.0% || test~1:16-29
----------------------------------------------------------------------------------------------------------------------------------

As you can see, the profile doesn't contain a column for time spent in code compiled by the tier 1 compiler. This is wrong and manifests e.g. in the line:

 baz       ||             1030ms  91.2% |  32.0% |  58.3% ||                0ms   0.0% |   0.0% |   0.0% || test~1:98-139

Where the time spent in the interpreter (32.0%) and the time spent in code compiled by the tier 2 compiler (58.3%) only add up to 90.3% instead of 100% if there was really no time spent in code compiled by the tier 1 compiler.

Metadata

Metadata

Labels

bugtoolsRelating to Truffle Tools (CPUSampler, Coverage tool, etc)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions