firefox-devtools / firefox-devtools/profiler

Feature: Auto-classification/labeling of threads based on rules & shared library of thread func (general purpose profiler)

Open
#4,986 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.5k
Forks
491
Avg merge
3d 46m
Merged PRs (30d)
27

Description

(General purpose profiler feature)

On Windows especially, there are a lot of mystery unnamed threads in most processes that do interesting things. Many of these could at least be classified by examining the call stack of all the samples in the thread. For example:

```
...
fun_554920 [nvwgf2um.dll]
fun_554900 [nvwgf2um.dll]
fun_1da9764 [nvwgf2um.dll]
BaseThreadInitThunk [kernel32.dll]
RtlUserThreadStart [ntdll.dll]
```

this thread could be labeled as "nvidia goop".

```
...
fun_15cc90 [MessageBus.dll]
fun_180a60 [MessageBus.dll]
fun_3d6b50 [MessageBus.dll]
BaseThreadInitThunk [kernel32.dll]
RtlUserThreadStart [ntdll.dll]
```

this thread could be labeled as "MessageBus.dll thread".

Something like.. look at the samples in the thread, scanning from the top (on windows, `RtlUserThreadStart` or `LdrInitializeThunk`). Look at a list that has a regexp for the library name and/or symbol name, and a classification. If nothing matches, go down one level. If there are multiple paths in the call tree, stop. Maybe use the first DLL name outside of ntdll.dll. If there are multiple trees at the top (i.e. the user thread + init thunk), walk them separately, and only classify if they result in the same. A little hand-wavy but could be helpful.

┆Issue is synchronized with this [Jira Task](https://mozilla-hub.atlassian.net/browse/FP-760)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.