Closed
Bug 1375392
Opened 8 years ago
Closed 8 years ago
Tweak the PROFILER_LABEL* macros
Categories
(Core :: Gecko Profiler, enhancement)
Core
Gecko Profiler
Tracking
()
RESOLVED
FIXED
mozilla56
| Tracking | Status | |
|---|---|---|
| firefox56 | --- | fixed |
People
(Reporter: n.nethercote, Assigned: n.nethercote)
Details
Attachments
(1 file)
|
272.12 KB,
patch
|
mstange
:
review+
|
Details | Diff | Splinter Review |
The PROFILER_LABEL* macros can be improved. Apologies in advance for the huge
and tedious patch.
| Assignee | ||
Comment 1•8 years ago
|
||
This patch makes the following changes to the macros.
- Removes PROFILER_LABEL_FUNC. It's only suitable for use in functions outside
classes, due to PROFILER_FUNCTION_NAME not getting class names, and it was
mostly misused.
- Removes PROFILER_FUNCTION_NAME. It's no longer used, and __func__ is
universally available now anyway.
- Combines the first two string literal arguments of PROFILER_LABEL and
PROFILER_LABEL_DYNAMIC into a single argument. There was no good reason for
them to be separate, and it forced a '::' in the label, which isn't always
appropriate. Also, the meaning of the "name_space" argument was interpreted
in an interesting variety of ways.
- Adds an "AUTO_" prefix to PROFILER_LABEL and PROFILER_LABEL_DYNAMIC, to make
it clearer they construct RAII objects rather than just being function calls.
(I myself have screwed up the scoping because of this in the past.)
- Fills in the 'js::ProfileEntry::Category::' qualifier within the macro, so
the caller doesn't need to. This makes a *lot* more of the uses fit onto a
single line.
The patch also makes the following changes to the macro uses (beyond those
required by the changes described above).
- Fixes a bunch of labels that had gotten out of sync with the name of the
class and/or function that encloses them.
- Removes a useless PROFILER_LABEL use within a trivial scope in
EventStateManager::DispatchMouseOrPointerEvent(). It clearly wasn't serving
any useful purpose. It also serves as extra evidence that the AUTO_ prefix is
a good idea.
- Tweaks DecodePool::SyncRunIf{Preferred,Possible} so that the labelling is
done within them, instead of at their callsites, because that's a more
standard way of doing things.
Attachment #8880258 -
Flags: review?(mstange)
Comment 2•8 years ago
|
||
(In reply to Nicholas Nethercote [:njn] from comment #1)
> - Removes a useless PROFILER_LABEL use within a trivial scope in
> EventStateManager::DispatchMouseOrPointerEvent(). It clearly wasn't serving
> any useful purpose.
That's a fun one. Looks like this one started out correct but then got broken in https://hg.mozilla.org/mozilla-central/rev/37f1942487842f8eeccacda76425b96532007d72#l2.128
Updated•8 years ago
|
Attachment #8880258 -
Flags: review?(mstange) → review+
| Assignee | ||
Comment 3•8 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/aa1693a26a15eb5cba24102222687dc81eeddd7b
Bug 1375392 - Tweak the PROFILER_LABEL* macros. r=mstange.
Comment 4•8 years ago
|
||
(In reply to Nicholas Nethercote [:njn] from comment #1)
> - Fixes a bunch of labels that had gotten out of sync with the name of the
> class and/or function that encloses them.
For the labels that I added, it was intentional, to have a name that would me meaningful to front-end engineers.
eg. "Components.utils.import" is readable, "nsXPCComponents_Utils::Import" exposes an implementation detail.
"LoadSubScript" is also a lot more meaningful than "DoLoadSubScriptWithOptions" when the JS call triggering this was "Services.scriptloader.loadSubScript"
Comment 5•8 years ago
|
||
| bugherder | ||
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox56:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
You need to log in
before you can comment on or make changes to this bug.
Description
•