Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide the pid in global tracks if it is 0. #5361

Merged
merged 2 commits into from
Feb 13, 2025

Conversation

fqueze
Copy link
Contributor

@fqueze fqueze commented Feb 7, 2025

This will make size profiles look nicer.

Example profile: https://share.firefox.dev/42MdeHQ

@fqueze fqueze requested a review from mstange February 7, 2025 16:51
Copy link

codecov bot commented Feb 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.84%. Comparing base (7f30744) to head (10f6f0a).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5361   +/-   ##
=======================================
  Coverage   85.84%   85.84%           
=======================================
  Files         312      312           
  Lines       29827    29829    +2     
  Branches     8213     8215    +2     
=======================================
+ Hits        25605    25607    +2     
  Misses       3627     3627           
  Partials      595      595           

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

@mstange
Copy link
Contributor

mstange commented Feb 7, 2025

Here's a profile from samply import perf.data where perf.data was gathered with simpleperf in system-wide mode. It has an actual process with a zero PID. But it doesn't have any samples for that process. https://share.firefox.dev/415PzAR

But I think it's possible to have samples for PID 0. Here's a quote from a stackoverflow reply:

So nowadays process #0 on a Unix is the system process, which effectively holds a number of kernel threads doing a number of things, ranging from page-out operations, through filesystem cache flushes and buffer zeroing, to idling when there's nothing else to run.


I'm not opposed to the suggested change in this PR, but we should be aware that sometimes, a pid of zero is legitimate.

@fqueze
Copy link
Contributor Author

fqueze commented Feb 7, 2025

Should we instead change the size-profiler to make thread.pid an empty string, and hide the pid when the string is empty? (currently it's only hidden when the string is null, which isn't possible for actual thread, but happens for screenshot tracks)

@mstange
Copy link
Contributor

mstange commented Feb 13, 2025

Should we instead change the size-profiler to make thread.pid an empty string, and hide the pid when the string is empty? (currently it's only hidden when the string is null, which isn't possible for actual thread, but happens for screenshot tracks)

I think this might cause other problems because in the URL we encode some things keyed by pid, and I'm not sure if that would still work properly if the pid is empty. Let's go with what you have.

In the future we could change the URL encoding to use process indexes, and have a central list of processes so that the process start/stop/name information is deduplicated. Then we can afford empty pids.

@fqueze fqueze enabled auto-merge (squash) February 13, 2025 09:31
@fqueze fqueze merged commit 3e62ca1 into firefox-devtools:main Feb 13, 2025
14 of 16 checks passed
@fqueze fqueze deleted the hide-0-pid branch February 13, 2025 09:33
@canova canova mentioned this pull request Feb 19, 2025
canova added a commit that referenced this pull request Feb 19, 2025
## Updates:

[Nicolas Chevobbe] Make timeline ruler notches visible in High Contrast
Mode (#5346)
[Nazım Can Altınova] Add the ability to mark marker fields as hidden
(#5354)
[Maxx Crawford] Update guide-startup-shutdown.md (#5357)
[Nazım Can Altınova] Enable prettier on the docs-user markdown files
(#5358)
[Paul Adenot] Allow searching by Content-Type in the network marker view
(#5351)
[Florian Quèze] Hide the pid in global tracks if it is 0. (#5361)
[Markus Stange] Make inverting the call tree fast, by computing inverted
call nodes lazily (#4900)
[Markus Stange] Use 64-bit floats for call tree timings. (#5371)
[Markus Stange] Extend the workaround in the v53 upgrader to generate
missing subcategory columns. (#5369)

## Also thanks to our localizers:

de: Michael Köhler
el: Jim Spentzos
en-GB: Paul
es-CL: ravmn
fr: Théo Chevalier
fur: Fabio Tomat
fy-NL: Fjoerfoks
ia: Melo46
it: Francesco Lodolo
nl: Mark Heijl
pt-BR: Marcelo Ghelman
ru: Valery Ledovskoy
sv-SE: Luna Jernberg, Andreas Pettersson
tr: Grk
uk: Іhor Hordiichuk
zh-CN: Olvcpr423
zh-TW: Pin-guang Chen
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.

2 participants