profiler icon indicating copy to clipboard operation
profiler copied to clipboard

Add a mechanism to name Workers

Open gregtatum opened this issue 8 years ago • 8 comments

Re-filed this issue from juj

Add a mechanism to name Workers

Working on profiling a large 3D engine, with several dedicated threads for audio, physics, statistics, particles, rendering, networking, file io, decompression, game logic and a generic task pool, it takes a lot of time to be able to identify which one is which. In Emscripten, Workers are always loaded from the same laucher url "pthread-main.js" (or from a blob url "blob://long-unreadable-uuid"), see below

In that image, see on the left, where each thread is name "DOM Worker 'pthread-...", which is difficult to identify the interesting thread.

It would be very useful if there was a way for JS code to assist the profiler by being able to call something like workerglobalscope.geckoProfiler.setCallingThreadName('audioThread');. I would then be able to hook these types of calls into the program I am profiling.

┆Issue is synchronized with this Jira Task

gregtatum avatar Aug 24 '17 14:08 gregtatum