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

Error showing value of type LinuxPerf.Counters #27

Closed
cuihantao opened this issue Nov 11, 2022 · 3 comments · Fixed by #28
Closed

Error showing value of type LinuxPerf.Counters #27

cuihantao opened this issue Nov 11, 2022 · 3 comments · Fixed by #28

Comments

@cuihantao
Copy link

cuihantao commented Nov 11, 2022

I tried to run the first test in my Julia and got the following error. It seems to do with PrettyTables. I'm using PrettyTables v2.1.2 and LinuxPerf 0.3.4.

I'm using a fresh installation of Ubuntu 22.04

I had the code working another day on a different computer but cannot reproduce it.

julia> counters(bench)
Error showing value of type LinuxPerf.Counters:
ERROR: MethodError: no method matching pretty_table(::IOContext{Base.TTY}, ::Matrix{String}, ::Vector{String}; row_names=LinuxPerf.EventType[hw:cycles, hw:cache_access, hw:cache_misses, hw:branches, hw:branch_mispredicts, hw:instructions, sw:ctx_switches, sw:page_faults, sw:minor_page_faults, sw:major_page_faults, sw:cpu_migrations], alignment=:l, crop=:none, body_hlines=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11])
Closest candidates are:
  pretty_table(::IO, ::Any; kwargs...) at /home/hacui/.julia/packages/PrettyTables/tUDry/src/print.jl:705
  pretty_table(::Type{String}, ::Any; color, kwargs...) at /home/hacui/.julia/packages/PrettyTables/tUDry/src/print.jl:707
  pretty_table(::Type{HTML}, ::Any; kwargs...) at /home/hacui/.julia/packages/PrettyTables/tUDry/src/print.jl:713
  ...
Stacktrace:
  [1] show(io::IOContext{Base.TTY}, c::LinuxPerf.Counters)
    @ LinuxPerf /home/hacui/.julia/packages/LinuxPerf/HOYkd/src/LinuxPerf.jl:370
  [2] show(io::IOContext{Base.TTY}, #unused#::MIME{Symbol("text/plain")}, x::LinuxPerf.Counters)
    @ Base.Multimedia ./multimedia.jl:47
  [3] (::REPL.var"#43#44"{REPL.REPLDisplay{REPL.LineEditREPL}, MIME{Symbol("text/plain")}, Base.RefValue{Any}})(io::Any)
    @ REPL /home/hacui/packages/julias/julia-1.8/share/julia/stdlib/v1.8/REPL/src/REPL.jl:267
  [4] with_repl_linfo(f::Any, repl::REPL.LineEditREPL)
    @ REPL /home/hacui/packages/julias/julia-1.8/share/julia/stdlib/v1.8/REPL/src/REPL.jl:521
  [5] display(d::REPL.REPLDisplay, mime::MIME{Symbol("text/plain")}, x::Any)
    @ REPL /home/hacui/packages/julias/julia-1.8/share/julia/stdlib/v1.8/REPL/src/REPL.jl:260
  [6] display(d::REPL.REPLDisplay, x::Any)
    @ REPL /home/hacui/packages/julias/julia-1.8/share/julia/stdlib/v1.8/REPL/src/REPL.jl:272
  [7] display(x::Any)
    @ Base.Multimedia ./multimedia.jl:328
  [8] #invokelatest#2
    @ ./essentials.jl:729 [inlined]
  [9] invokelatest
    @ ./essentials.jl:726 [inlined]
 [10] print_response(errio::IO, response::Any, show_value::Bool, have_color::Bool, specialdisplay::Union{Nothing, AbstractDisplay})
    @ REPL /home/hacui/packages/julias/julia-1.8/share/julia/stdlib/v1.8/REPL/src/REPL.jl:296
 [11] (::REPL.var"#45#46"{REPL.LineEditREPL, Pair{Any, Bool}, Bool, Bool})(io::Any)
    @ REPL /home/hacui/packages/julias/julia-1.8/share/julia/stdlib/v1.8/REPL/src/REPL.jl:278
 [12] with_repl_linfo(f::Any, repl::REPL.LineEditREPL)
    @ REPL /home/hacui/packages/julias/julia-1.8/share/julia/stdlib/v1.8/REPL/src/REPL.jl:521
 [13] print_response(repl::REPL.AbstractREPL, response::Any, show_value::Bool, have_color::Bool)
    @ REPL /home/hacui/packages/julias/julia-1.8/share/julia/stdlib/v1.8/REPL/src/REPL.jl:276
 [14] (::REPL.var"#do_respond#66"{Bool, Bool, REPL.var"#77#87"{REPL.LineEditREPL, REPL.REPLHistoryProvider}, REPL.LineEditREPL, REPL.LineEdit.Prompt})(s::REPL.LineEdit.MIState, buf::Any, ok::Bool)
    @ REPL /home/hacui/packages/julias/julia-1.8/share/julia/stdlib/v1.8/REPL/src/REPL.jl:857
 [15] #invokelatest#2
    @ ./essentials.jl:729 [inlined]
 [16] invokelatest
    @ ./essentials.jl:726 [inlined]
 [17] run_interface(terminal::REPL.Terminals.TextTerminal, m::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
    @ REPL.LineEdit /home/hacui/packages/julias/julia-1.8/share/julia/stdlib/v1.8/REPL/src/LineEdit.jl:2510
 [18] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
    @ REPL /home/hacui/packages/julias/julia-1.8/share/julia/stdlib/v1.8/REPL/src/REPL.jl:1248
 [19] (::REPL.var"#49#54"{REPL.LineEditREPL, REPL.REPLBackendRef})()
    @ REPL ./task.jl:484
@cuihantao
Copy link
Author

I downgraded PrettyTables to 1.3.1 and fixes it.

@vchuravy
Copy link
Member

@chriselrod could look into this?

@chriselrod
Copy link
Contributor

Oh, huh, my PrettyTables PR might've broken some things.
The only thing I ever use is @pstats, which worked fine.
All the tests also pass, but I see that

julia> @measure 1+2
Error showing value of type LinuxPerf.Counters:
ERROR: MethodError: no method matching pretty_table(::IOContext{Base.TTY}, ::Matrix{String}, ::Vector{String}; row_names=LinuxPerf.EventType[hw:cycles, hw:cache_access, hw:cache_misses, hw:branches, hw:branch_mispredicts, hw:instructions, sw:ctx_switches, sw:page_faults, sw:minor_page_faults, sw:major_page_faults, sw:cpu_migrations], alignment=:l, crop=:none, body_hlines=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11])
Closest candidates are:
  pretty_table(::IO, ::Any; kwargs...) at ~/.julia/packages/PrettyTables/ojIwn/src/print.jl:705
  pretty_table(::Type{String}, ::Any; color, kwargs...) at ~/.julia/packages/PrettyTables/ojIwn/src/print.jl:707
  pretty_table(::Type{HTML}, ::Any; kwargs...) at ~/.julia/packages/PrettyTables/ojIwn/src/print.jl:713
  ...
Stacktrace:
  [1] show(io::IOContext{Base.TTY}, c::LinuxPerf.Counters)
    @ LinuxPerf ~/.julia/packages/LinuxPerf/HOYkd/src/LinuxPerf.jl:370
  [2] show(io::IOContext{Base.TTY}, #unused#::MIME{Symbol("text/plain")}, x::LinuxPerf.Counters)
    @ Base.Multimedia ./multimedia.jl:47

is also broken.

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

Successfully merging a pull request may close this issue.

3 participants