@@ -143,6 +143,14 @@ const window_wrefs = WeakKeyDict{Gtk4.GtkWindowLeaf,Nothing}()
143
143
const tabname_allthreads = Symbol (" All Threads" )
144
144
const tabname_alltasks = Symbol (" All Tasks" )
145
145
146
+ function get_thread_label (threadid:: Int )
147
+ @static if isdefined (Threads, :threadpooldescription )
148
+ return Symbol (string (threadid , " (" , Threads. threadpooldescription (threadid), " )" ))
149
+ else
150
+ return Symbol (string (threadid , " (" , Threads. threadpool (threadid), " )" ))
151
+ end
152
+ end
153
+
146
154
NestedGraphDict = Dict{Symbol,Dict{Symbol,Node{NodeData}}}
147
155
"""
148
156
ProfileView.view([fcolor], data=Profile.fetch(); lidict=nothing, C=false, recur=:off, fontsize=14, windowname="Profile", kwargs...)
@@ -184,7 +192,8 @@ function view(fcolor, data::Vector{UInt64}; lidict=nothing, C=false, combine=tru
184
192
end
185
193
end
186
194
end
187
- gdict[Symbol (threadid)] = gdict_inner
195
+ thread_label = get_thread_label (threadid)
196
+ gdict[thread_label] = gdict_inner
188
197
end
189
198
end
190
199
return view (fcolor, gdict; data= data, lidict= lidict, kwargs... )
@@ -236,12 +245,12 @@ function viewgui(fcolor, gdict::NestedGraphDict; data=nothing, lidict=nothing, w
236
245
nb_threads = GtkNotebook () # for holding the per-thread pages
237
246
Gtk4. scrollable (nb_threads, true )
238
247
Gtk4. show_tabs (nb_threads, length (thread_tabs) > 1 )
239
- sort! (thread_tabs, by = s -> something ( tryparse (Int, string (s)), 0 )) # sorts thread_tabs as [all threads, 1, 2, 3 ....]
248
+ sort! (thread_tabs, by = s -> s == tabname_allthreads ? " 000 " : string (s)) # sorts thread_tabs as [all threads, 1, 2, 3 ....]
240
249
241
250
for thread_tab in thread_tabs
242
251
gdict_thread = gdict[thread_tab]
243
252
task_tabs = collect (keys (gdict_thread))
244
- sort! (task_tabs, by = s -> s == tabname_alltasks ? " " : string (s)) # sorts thread_tabs as [all threads, 0xds ....]
253
+ sort! (task_tabs, by = s -> s == tabname_alltasks ? " 000 " : string (s)) # sorts thread_tabs as [all threads, 0xds ....]
245
254
246
255
nb_tasks = GtkNotebook () # for holding the per-task pages
247
256
Gtk4. scrollable (nb_tasks, true )
0 commit comments