Skip to content

Commit 299f2e4

Browse files
fixes
1 parent 3f90bba commit 299f2e4

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

stdlib/Profile/Project.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ StyledStrings = "1.11.0"
1010

1111
[extras]
1212
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
13+
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
1314
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
1415
Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
1516
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1617

1718
[targets]
18-
test = ["Base64", "Logging", "Serialization", "Test"]
19+
test = ["Base64", "InteractiveUtils", "Logging", "Serialization", "Test"]

stdlib/Profile/src/Profile.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -554,8 +554,8 @@ function short_path(spath::Symbol, filenamecache::Dict{Symbol, Tuple{String,Stri
554554
elseif startswith(path_norm, lib_dir)
555555
remainder = only(split(path_norm, lib_dir, keepempty=false))
556556
return (isfile(path_norm) ? path_norm : ""), "@julialib", remainder
557-
elseif startswith(path, COMPILER_DIR)
558-
remainder = only(split(path, COMPILER_DIR, keepempty=false))
557+
elseif contains(path, COMPILER_DIR)
558+
remainder = split(path, COMPILER_DIR, keepempty=false)[end]
559559
possible_compiler_path = normpath(joinpath(Sys.BINDIR, Base.DATAROOTDIR, "julia", "Compiler", remainder))
560560
return (isfile(possible_compiler_path) ? possible_compiler_path : ""), "@Compiler", remainder
561561
elseif isabspath(path)

stdlib/Profile/test/runtests.jl

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -204,19 +204,21 @@ end
204204
@test getline(values(fdictc)) == getline(values(fdict0)) + 2
205205
end
206206

207+
import InteractiveUtils
208+
207209
@testset "Module short names" begin
208210
Profile.clear()
209-
@profile peakflops()
211+
@profile InteractiveUtils.peakflops()
210212
io = IOBuffer()
211-
IOContext(io, :displaysize=>(1000,1000))
213+
ioc = IOContext(io, :displaysize=>(1000,1000))
212214
Profile.print(ioc, C=true)
213215
str = String(take!(io))
214-
@test occursin("@Compiler/src", str)
215-
@test occursin("@Base/src", str)
216-
@test occursin("@InteractiveUtils/src", str)
217-
@test occursin("@LinearAlgebra/src", str)
218-
@test occursin("@juliasrc", str)
219-
@test occursin("@julialib", str)
216+
@test occursin("@Compiler/src/", str)
217+
@test occursin("@Base/", str)
218+
@test occursin("@InteractiveUtils/src/", str)
219+
@test occursin("@LinearAlgebra/src/", str)
220+
@test occursin("@juliasrc/", str)
221+
@test occursin("@julialib/", str)
220222
end
221223

222224
# Profile deadlocking in compilation (debuginfo registration)

0 commit comments

Comments
 (0)