Consider generating processNames for all process types
Categories
(Core :: Gecko Profiler, enhancement, P3)
Tracking
()
People
(Reporter: mstange, Unassigned)
Details
Attachments
(2 files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
WIP: Bug 1745967 - Add a processName in the profile thread JSON for all process types. r=nika,gerald
48 bytes,
text/x-phabricator-request
|
Details | Review |
The Firefox Profiler front-end code has a mapping which creates human readable names for the processes in the profiler:
switch (thread.processType) {
case 'default':
label = 'Parent Process';
break;
case 'gpu':
label = 'GPU Process';
break;
case 'rdd':
label = 'Remote Data Decoder';
break;
case 'tab': {
label = 'Content Process';
homonymThreads = threads.filter((thread) => {
return (
thread.name === 'GeckoMain' && thread.processType === 'tab'
);
});
break;
}
case 'plugin':
label = 'Plugin Process';
break;
case 'socket':
label = 'Socket Process';
break;
It would be great if we could replace this mapping with something that's inside of Gecko, so that we don't need to tweak the front-end when we add new process types.
| Reporter | ||
Comment 1•3 years ago
|
||
Comment 2•3 years ago
|
||
(In reply to Markus Stange [:mstange] from comment #0)
The Firefox Profiler front-end code has a mapping which creates human readable names for the processes in the profiler:
switch (thread.processType) { case 'default': label = 'Parent Process'; break; case 'gpu': label = 'GPU Process'; break; case 'rdd': label = 'Remote Data Decoder'; break; case 'tab': { label = 'Content Process'; homonymThreads = threads.filter((thread) => { return ( thread.name === 'GeckoMain' && thread.processType === 'tab' ); }); break; } case 'plugin': label = 'Plugin Process'; break; case 'socket': label = 'Socket Process'; break;It would be great if we could replace this mapping with something that's inside of Gecko, so that we don't need to tweak the front-end when we add new process types.
Maybe use geckoprocesstypes python module and introduce that as a GeneratedFile ?
| Reporter | ||
Comment 3•3 years ago
|
||
Could you clarify? Who would generate which kind of file and who would consume it? Would this support l10n, and if so, would the localized name be stored in the profile or would it be resolved when viewing the profile?
Comment 4•3 years ago
|
||
(In reply to Markus Stange [:mstange] from comment #3)
Could you clarify? Who would generate which kind of file and who would consume it? Would this support l10n, and if so, would the localized name be stored in the profile or would it be resolved when viewing the profile?
I'm not sure I understand enough of the profiler-related bits to answer the last part. For the first part, you could add a GeneratedFile entry in mozbuild (see e.g. https://searchfox.org/mozilla-central/rev/72c7cef167829b6f1e24cae216fa261934c455fc/xpcom/build/moz.build#78-82) that could produce a C++ header defining your nice names, that you could use directly within GeckoProcessTypeToProfilerProcessName. This way, you don't have to introduce yet-another-field to the GECKO_PROCESS_TYPE macro that we would like to simplify in the future.
Comment 5•3 years ago
|
||
Comment 6•3 years ago
|
||
Markus, have you had a chance to take a look at the WIP I shared ?
| Reporter | ||
Comment 7•1 year ago
|
||
(In reply to :gerard-majax from comment #6)
Markus, have you had a chance to take a look at the WIP I shared ?
It only took three years, but I have now! So with the WIP approach somebody who adds a new process type would need to remember that they need to edit tools/profiler/gen_profilerNames.py to add a new if branch for their new process type. And it doesn't address Nika's request to share the mapping with other places that want to translate these names for the UI.
| Reporter | ||
Updated•1 year ago
|
Description
•