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

When interacting with TimerOutputs.jl, only displays lowered code #362

Open
johnomotani opened this issue Feb 21, 2025 · 1 comment
Open

Comments

@johnomotani
Copy link

If I try to debug a function that I'm also timing using TimerOutputs, only lowered code is displayed, and I cannot step normally through the function.

MWE:

julia> using TimerOutputs

julia> using Debugger

julia> my_timer = TimerOutput()
────────────────────────────────────────────────────────────────────
                           Time                    Allocations      
                  ───────────────────────   ────────────────────────
Tot / % measured:     91.5ms /   0.0%           4.68MiB /   0.0%    

Section   ncalls     time    %tot     avg     alloc    %tot      avg
────────────────────────────────────────────────────────────────────
────────────────────────────────────────────────────────────────────

julia> @timeit my_timer foo() = begin
       println("hello")
       end
foo (generic function with 1 method)

julia> @enter foo()
In foo() at none:0
  3  │          Core.NewvarNode(:(b₀#233))
  4  │          Core.NewvarNode(:(accumulated_data#232))
  5  │          local_to#230 = Main.my_timer
  6%6  = local_to#230
> 7  │          enabled#231 = Base.getproperty(%6, :enabled)
  8%8  = enabled#231
  9  └───       goto #3 if not %8
 10  2 ── %10 = local_to#230
 11  └───       accumulated_data#232 = (push!)(%10, "foo")

About to run: <getproperty(─────────────────────────────...>
1|debug> n
hello
In foo() at none:0
 28  10%28 = @_8 === 1
 29  └───       goto #12 if not %28
 30  11 ─       Base.rethrow()
 31  12%31 = val#235
>32  └───       return %31

About to run: return
1|debug> 

julia> 

This using Julia-1.11.3, Debugger-0.7.10 and TimerOutputs-0.5.27.

Obvious workaround is to take out the timing while I'm debugging, but that's not ideal especially in a bigger code where there might be many timed functions.

@KristofferC
Copy link
Member

I think KristofferC/TimerOutputs.jl#164 made this slightly worse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants