firefox-devtools/profiler

Marker tooltip and sidebar should make it clear when a stack comes from another thread

Ouverte

#2 986 ouverte le 21 oct. 2020

 (10 commentaires) (0 réaction) (1 personne assignée)TypeScript (486 forks)auto 404
assignedhelp wantedmarkerspolishprofile dataready

Métriques du dépôt

Stars
 (1 515 étoiles)
Métriques de merge PR
 (Métriques PR en attente)

Description

Markers can include one stack (under 'data'), but that stack could possibly come from another thread than where the marker is recorded. The new Markers 2.0 API will make it even easier to do this, so this may become more frequent...

It would be great to show that clearly wherever the stack is displayed, e.g., instead of just "Stack:" we could show something like "Stack from thread 'name' (id):".

Tech note: This information is already present in the Gecko Profile coming from Firefox, in marker.data.stack.tid, e.g. here's a marker under the main thread (which has tid 930480) :

 [
  12792,
  717.3943,
  717.8658,
  1,
  1,
  { "stack":
    { "processType": "default",
      "name": "",
      "processName": "Parent Process",
      "registerTime": null,
      "unregisterTime": null,
      "samples": {"schema": {"stack": 0, "time": 1, "eventDelay": 2}, "data": [[43656, 717.9065]]},
      "markers": {"schema": {"name": 0, "startTime": 1, "endTime": 2, "phase": 3, "category": 4, "data": 5}, "data": []},
      "pid": 902252,
      "tid": 918636
    },
    "type": "Text",
    "name": "Thread 'QuotaManager IO' created by thread 918636"
  }
 ]

Notice that the marker's stack's tid is 918636. That other thread may or may not be present in this profile. Ideally the front-end should try to use the thread's name if known.

I don't think this marker.data.stack.tid is currently preserved during processing (I couldn't find it when downloading a profile json), so I guess this is unfortunately lost for old profiles. Maybe a first step would be to preserve it, so that new profiles will have this information ready for a later step, where the information will be shown as I suggested at the top.

┆Issue is synchronized with this Jira Task

Guide contributeur