Skip to content

Show each counter's owning process in profiler-cli - #6164

Merged
fatadel merged 3 commits into
firefox-devtools:mainfrom
fatadel:issue-6134
Jul 13, 2026
Merged

Show each counter's owning process in profiler-cli#6164
fatadel merged 3 commits into
firefox-devtools:mainfrom
fatadel:issue-6134

Conversation

@fatadel

@fatadel fatadel commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Main | Deploy preview

Counters listed by "pq counter list" gave no hint about which process they belonged to, so profiles with many identically-named counters (one "Process CPU" per process) were impossible to tell apart. Each counter line now carries its process handle, name, and pid, mirroring how "profile info" labels processes so the two outputs cross-reference:

c-2: Process CPU (CPU) [p-0 Parent Process, pid 47021] [2787 samples]

"counter info" gains a matching Process line. The handle is dropped when the owning process can't be resolved, leaving just the name and pid.

Closes #6134


Example profile

Main changes:

  1. pq counter list shows concise identifying information for the related process of each counter:
[Thread: t-18 (GeckoMain) | View: Full profile | Full: 14.017s]

Counters (22):
  c-0: Memory (Memory) [p-0 Parent Process, pid 80946] - memory range in graph: 3.58MB [6208 samples]
      ▇▇▇▇▇█████▆▇▁▁▁▁▁▁▁▂▂▂▂▂▂▂▂▂▄▄▄▆▆▆▆▆▆▆▆▆▆▆▅▅▅▅▅▅▅▇

  c-2: Memory (Memory) [p-1 socket, pid 80952] - memory range in graph: 148KB [10 samples]
      ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███████████

  1. pq counter info <handle> adds the same information under "Process:" line:
[Thread: t-18 (GeckoMain) | View: Full profile | Full: 14.017s]

Counter c-0: Memory
  Name: malloc
  Category: Memory
  Description: Amount of allocated memory
  Unit: bytes
  Graph type: line-accumulated
  Process: p-0 Parent Process [pid 80946]
  Main thread: t-0 (GeckoMain)
  Samples: 6208 total, 6208 in current range
  Time span: 445.71μs → 14.015s
  Stats (current range):
    memory range in graph: 3.58MB
  Memory over time:
...

Counters listed by "pq counter list" gave no hint about which process
they belonged to, so profiles with many identically-named counters (one
"Process CPU" per process) were impossible to tell apart. Each counter
line now carries its process handle, name, and pid, mirroring how
"profile info" labels processes so the two outputs cross-reference:

  c-2: Process CPU (CPU) [p-0 Parent Process, pid 47021] [2787 samples]

"counter info" gains a matching Process line. The handle is dropped when
the owning process can't be resolved, leaving just the name and pid.

Closes firefox-devtools#6134
@fatadel
fatadel requested review from canova and mstange and removed request for canova July 10, 2026 13:18
@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.55%. Comparing base (e8dbbcf) to head (ffae883).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main    #6164    +/-   ##
========================================
  Coverage   83.54%   83.55%            
========================================
  Files         343      343            
  Lines       36852    36853     +1     
  Branches    10350    10246   -104     
========================================
+ Hits        30789    30792     +3     
+ Misses       5635     5633     -2     
  Partials      428      428            

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread profiler-cli/src/formatters.ts Outdated
Comment thread src/profile-query/formatters/counter-info.ts Outdated
Comment thread src/profile-query/formatters/counter-info.ts Outdated
@fatadel

fatadel commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review, @canova! I've now addressed the issues.

@fatadel
fatadel requested a review from canova July 13, 2026 09:53

@canova canova left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@fatadel
fatadel merged commit a779b7d into firefox-devtools:main Jul 13, 2026
23 checks passed
@fatadel
fatadel deleted the issue-6134 branch July 13, 2026 10:14
@canova canova mentioned this pull request Jul 21, 2026
canova added a commit that referenced this pull request Jul 21, 2026
Changes:

[Sky Ning] Skip preview links for non-main PRs (#6161)
[spokodev] fix(gecko-upgrade): don't crash on a counter with empty
sample_groups (#6160)
[fatadel] Show counter values over time in profiler-cli (#6136)
[Markus Stange] Make profile-conversion snapshots more compact and
meaningful (#6152)
[Markus Stange] More typed arrays: sample + counter times, some
frametable columns (#6139)
[Nazım Can Altınova] Only render a marker url field as a link when the
whole value is a URL (#6163)
[fatadel] Show each counter's owning process in profiler-cli (#6164)
[Nazım Can Altınova] Document the pre-existing thread info and network
JSON schemas in the cli (#6171)
[Markus Stange] Copy column contents in
getRawSamplesTableBuilderFromExisting for consistency (#6168)
[Markus Stange] Convert eligible columns to typed arrays when outputting
from profiler-edit (#6167)
[Markus Stange] Remove unused samples.thread column (#6151)
[Markus Stange] Fixed botched merge which broke 'yarn ts' (#6174)
[Nazım Can Altınova] Add marker handles to `profiler-cli thread network`
(#6172)
[Markus Stange] Update json-slabs 0.3.0 → 0.4.0 (major) (#6176)
[Nazım Can Altınova] Surface network activity across profiler-cli
(#6175)
[Nazım Can Altınova] Add `profile meta` command to profiler-cli (#6177)
[Markus Stange] Allow raw marker table's `startTime` and `endTime`
columns to be Float64Array (#6169)
[nightcityblade] Fix light theme text selection colors (#6186)
[Nazım Can Altınova] Import source map URLs from Chrome DevTools traces
(#6190)
[Nazım Can Altınova] Rename yarn `build-profiler-cli` script to
`build-cli` (#6191)
[Nazım Can Altınova] Migrate husky to version 9 (#6201)
[Nazım Can Altınova] Fix horizontal overflow when the transform
navigator is long (#6199)
[fatadel] Add a 'hexadecimal' marker schema field format (#6197)
[Nazım Can Altınova] Bump source-map to 0.8.0 and remove the old type
workaround (#6202)
[Nazım Can Altınova] 🔃 Sync: l10n -> main (July 21, 2026) (#6209)


And special thanks to our localizers:

fr: parmegiani.thomas
fr: Théo Chevalier
sr: Марко Костић (Marko Kostić)
sv-SE: Luna Jernberg
tr: Grk
zh-CN: Ariel
zh-CN: Olvcpr423
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pq counter list should include which process the counter belongs to

2 participants