Skip to content

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

Open
fatadel wants to merge 1 commit into
firefox-devtools:mainfrom
fatadel:issue-6134
Open

Show each counter's owning process in profiler-cli#6164
fatadel wants to merge 1 commit 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.52%. Comparing base (625c2f6) to head (8f502d3).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6164      +/-   ##
==========================================
+ Coverage   83.50%   83.52%   +0.02%     
==========================================
  Files         342      342              
  Lines       36522    36623     +101     
  Branches    10125    10163      +38     
==========================================
+ Hits        30497    30590      +93     
- Misses       5597     5606       +9     
+ Partials      428      427       -1     

☔ 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.

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

1 participant