Skip to content

Commit 78ed775

Browse files
IanButterworthKristofferC
authored andcommitted
Profile: Fix stdlib paths (#55327)
(cherry picked from commit b759fe2)
1 parent 2b31eab commit 78ed775

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

src/signals-mach.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -717,16 +717,16 @@ void *mach_profile_listener(void *arg)
717717
#endif
718718
jl_ptls_t ptls = jl_atomic_load_relaxed(&jl_all_tls_states)[i];
719719

720-
// store threadid but add 1 as 0 is preserved to indicate end of block
720+
// META_OFFSET_THREADID store threadid but add 1 as 0 is preserved to indicate end of block
721721
bt_data_prof[bt_size_cur++].uintptr = ptls->tid + 1;
722722

723-
// store task id (never null)
723+
// META_OFFSET_TASKID store task id (never null)
724724
bt_data_prof[bt_size_cur++].jlvalue = (jl_value_t*)jl_atomic_load_relaxed(&ptls->current_task);
725725

726-
// store cpu cycle clock
726+
// META_OFFSET_CPUCYCLECLOCK store cpu cycle clock
727727
bt_data_prof[bt_size_cur++].uintptr = cycleclock();
728728

729-
// store whether thread is sleeping but add 1 as 0 is preserved to indicate end of block
729+
// META_OFFSET_SLEEPSTATE store whether thread is sleeping but add 1 as 0 is preserved to indicate end of block
730730
bt_data_prof[bt_size_cur++].uintptr = jl_atomic_load_relaxed(&ptls->sleep_check_state) + 1;
731731

732732
// Mark the end of this block with two 0's

src/signals-unix.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -914,16 +914,16 @@ static void *signal_listener(void *arg)
914914

915915
jl_ptls_t ptls2 = jl_atomic_load_relaxed(&jl_all_tls_states)[i];
916916

917-
// store threadid but add 1 as 0 is preserved to indicate end of block
917+
// META_OFFSET_THREADID store threadid but add 1 as 0 is preserved to indicate end of block
918918
bt_data_prof[bt_size_cur++].uintptr = ptls2->tid + 1;
919919

920-
// store task id (never null)
920+
// META_OFFSET_TASKID store task id (never null)
921921
bt_data_prof[bt_size_cur++].jlvalue = (jl_value_t*)jl_atomic_load_relaxed(&ptls2->current_task);
922922

923-
// store cpu cycle clock
923+
// META_OFFSET_CPUCYCLECLOCK store cpu cycle clock
924924
bt_data_prof[bt_size_cur++].uintptr = cycleclock();
925925

926-
// store whether thread is sleeping but add 1 as 0 is preserved to indicate end of block
926+
// META_OFFSET_SLEEPSTATE store whether thread is sleeping but add 1 as 0 is preserved to indicate end of block
927927
bt_data_prof[bt_size_cur++].uintptr = jl_atomic_load_relaxed(&ptls2->sleep_check_state) + 1;
928928

929929
// Mark the end of this block with two 0's

src/signals-win.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -420,16 +420,16 @@ static DWORD WINAPI profile_bt( LPVOID lparam )
420420

421421
jl_ptls_t ptls = jl_atomic_load_relaxed(&jl_all_tls_states)[0]; // given only profiling hMainThread
422422

423-
// store threadid but add 1 as 0 is preserved to indicate end of block
423+
// META_OFFSET_THREADID store threadid but add 1 as 0 is preserved to indicate end of block
424424
bt_data_prof[bt_size_cur++].uintptr = ptls->tid + 1;
425425

426-
// store task id (never null)
426+
// META_OFFSET_TASKID store task id (never null)
427427
bt_data_prof[bt_size_cur++].jlvalue = (jl_value_t*)jl_atomic_load_relaxed(&ptls->current_task);
428428

429-
// store cpu cycle clock
429+
// META_OFFSET_CPUCYCLECLOCK store cpu cycle clock
430430
bt_data_prof[bt_size_cur++].uintptr = cycleclock();
431431

432-
// store whether thread is sleeping but add 1 as 0 is preserved to indicate end of block
432+
// META_OFFSET_SLEEPSTATE store whether thread is sleeping but add 1 as 0 is preserved to indicate end of block
433433
bt_data_prof[bt_size_cur++].uintptr = jl_atomic_load_relaxed(&ptls->sleep_check_state) + 1;
434434

435435
// Mark the end of this block with two 0's

stdlib/Profile/src/Profile.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ end
507507
# based on the package ecosystem
508508
function short_path(spath::Symbol, filenamecache::Dict{Symbol, String})
509509
return get!(filenamecache, spath) do
510-
path = string(spath)
510+
path = Base.fixup_stdlib_path(string(spath))
511511
if isabspath(path)
512512
if ispath(path)
513513
# try to replace the file-system prefix with a short "@Module" one,
@@ -683,7 +683,7 @@ function add_fake_meta(data; threadid = 1, taskid = 0xf0f0f0f0)
683683
for i = 1:length(data)
684684
val = data[i]
685685
if iszero(val)
686-
# (threadid, taskid, cpu_cycle_clock, thread_sleeping)
686+
# META_OFFSET_THREADID, META_OFFSET_TASKID, META_OFFSET_CPUCYCLECLOCK, META_OFFSET_SLEEPSTATE
687687
push!(data_with_meta, threadid, taskid, cpu_clock_cycle+=1, false+1, 0, 0)
688688
else
689689
push!(data_with_meta, val)

0 commit comments

Comments
 (0)