Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
simonis opened this issue Jan 1, 2025 · 0 comments
Assignees
Labels
bug tools Relating to Truffle Tools (CPUSampler, Coverage tool, etc)

Comments

@simonis
Copy link
Contributor

simonis commented Jan 1, 2025

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.

@simonis simonis added the tools Relating to Truffle Tools (CPUSampler, Coverage tool, etc) label Jan 1, 2025
@oubidar-Abderrahim oubidar-Abderrahim changed the title The Truffle Profiler somtimes incorrectly skips tiers in calltree mode [GR-60806] The Truffle Profiler somtimes incorrectly skips tiers in calltree mode Jan 3, 2025
@oubidar-Abderrahim oubidar-Abderrahim self-assigned this Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug tools Relating to Truffle Tools (CPUSampler, Coverage tool, etc)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants