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

Profile.print: color Base/Core & packages. Make paths clickable #55335

Merged
merged 14 commits into from
Sep 4, 2024
6 changes: 3 additions & 3 deletions stdlib/Profile/src/Profile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ function print(io::IO,
end
any_nosamples = true
if format === :tree
Base.print(io, "Overhead ╎ [+additional indent] Count File:Line; Function\n")
Base.print(io, "Overhead ╎ [+additional indent] Count File:Line Function\n")
Base.print(io, "=========================================================\n")
end
if groupby == [:task, :thread]
Expand Down Expand Up @@ -990,7 +990,7 @@ function tree_format(frames::Vector{<:StackFrameTree}, level::Int, cols::Int, ma
link = editor_link(path, li.line)
styled"{link=$link:$styled_path}"
end
strs[i] = Base.annotatedstring(stroverhead, "╎", base, strcount, " ", rich_file, "; ", fname)
strs[i] = Base.annotatedstring(stroverhead, "╎", base, strcount, " ", rich_file, " ", fname)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit broke BenchmarkTools. What is the intended fix, here or in BenchmarkTools?
https://github.com/JuliaCI/BenchmarkTools.jl/actions/runs/11898803449/job/33156070523

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace the ; with a space in the regex in BenchmarkTools?

if frame.overhead > 0
strs[i] = styled"{bold:$(strs[i])}"
end
Expand Down Expand Up @@ -1160,7 +1160,7 @@ function print_tree(io::IO, bt::StackFrameTree{T}, cols::Int, fmt::ProfileFormat
filenamemap = FileNameMap()
worklist = [(bt, 0, 0, AnnotatedString(""))]
if !is_subsection
Base.print(io, "Overhead ╎ [+additional indent] Count File:Line; Function\n")
Base.print(io, "Overhead ╎ [+additional indent] Count File:Line Function\n")
Base.print(io, "=========================================================\n")
end
while !isempty(worklist)
Expand Down