Merge Sampler and GeckoSampler

RESOLVED FIXED in Firefox 54

Status

()

Core
Gecko Profiler
RESOLVED FIXED
3 months ago
3 months ago

People

(Reporter: njn, Assigned: njn)

Tracking

(Blocks: 1 bug)

unspecified
mozilla54
Points:
---

Firefox Tracking Flags

(firefox54 fixed)

Details

Attachments

(5 attachments)

(Assignee)

Description

3 months ago
GeckoSampler is the only subclass of Sampler. Might as well merge them.
(Assignee)

Comment 1

3 months ago
Created attachment 8831110 [details] [diff] [review]
(part 1) - Merge Sampler constructors and destructors

They're defined separately for each platform, but the definitions are almost
identical and can be commoned up.
Attachment #8831110 - Flags: review?(mstange)
(Assignee)

Updated

3 months ago
Assignee: nobody → n.nethercote
Status: NEW → ASSIGNED
(Assignee)

Comment 2

3 months ago
Created attachment 8831111 [details] [diff] [review]
(part 2) - Merge Sampler and GeckoSampler

There's no point having them as separate classes. This removes the need for
some virtual functions, too.
Attachment #8831111 - Flags: review?(mstange)
(Assignee)

Comment 3

3 months ago
Created attachment 8831113 [details] [diff] [review]
(part 3) - Rename GeckoSampler.cpp as Sampler.cpp

The patch also moves some Sampler methods from platform.cpp to Sampler.cpp. Now
all Sampler methods are in Sampler.cpp except for a small number of
platform-specific ones, which are in platform-*.cpp.
Attachment #8831113 - Flags: review?(mstange)
(Assignee)

Comment 4

3 months ago
Created attachment 8831114 [details] [diff] [review]
(part 4) - Remove Sampler::profiling_

Because it's always true.
Attachment #8831114 - Flags: review?(mstange)
(Assignee)

Comment 5

3 months ago
Created attachment 8831116 [details] [diff] [review]
(part 5) - Remove PlatformData::profiled_pthread_

It's unused.
Attachment #8831116 - Flags: review?(mstange)
Attachment #8831110 - Flags: review?(mstange) → review+
Attachment #8831111 - Flags: review?(mstange) → review+
Comment on attachment 8831113 [details] [diff] [review]
(part 3) - Rename GeckoSampler.cpp as Sampler.cpp

Review of attachment 8831113 [details] [diff] [review]:
-----------------------------------------------------------------

::: tools/profiler/core/Sampler.cpp
@@ +165,5 @@
>    return false;
>  }
>  
> +std::vector<ThreadInfo*>* Sampler::sRegisteredThreads = nullptr;
> +mozilla::UniquePtr< ::Mutex> Sampler::sRegisteredThreadsMutex;

Shouldn't this be mozilla::Mutex? Looks like I missed this in the patch that removed ::Mutex.
Attachment #8831113 - Flags: review?(mstange) → review+
Attachment #8831114 - Flags: review?(mstange) → review+
Attachment #8831116 - Flags: review?(mstange) → review+
(Assignee)

Comment 7

3 months ago
> > +std::vector<ThreadInfo*>* Sampler::sRegisteredThreads = nullptr;
> > +mozilla::UniquePtr< ::Mutex> Sampler::sRegisteredThreadsMutex;
> 
> Shouldn't this be mozilla::Mutex? Looks like I missed this in the patch that
> removed ::Mutex.

The declaration in platform.h uses mozilla::Mutex. So ::Mutex must somehow auto-qualify as mozilla::Mutex. But I've changed it locally for clarity.
(Assignee)

Comment 8

3 months ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/89526e05e79d13c8fa95f2a0d441ce240c52f566
Bug 1334466 (part 1) - Merge Sampler constructors and destructors. r=mstange.

https://hg.mozilla.org/integration/mozilla-inbound/rev/63af77eff001e461b633a573e563722b2cf45780
Bug 1334466 (part 2) - Merge Sampler and GeckoSampler. r=mstange.

https://hg.mozilla.org/integration/mozilla-inbound/rev/66ffe7a006d1e1355176eb6b6f44ffffe2bb4b05
Bug 1334466 (part 3) - Rename GeckoSampler.cpp as Sampler.cpp. r=mstange.

https://hg.mozilla.org/integration/mozilla-inbound/rev/cb29b76cb9d5e75343166925ab6b353fc1ec0215
Bug 1334466 (part 4) - Remove Sampler::profiling_. r=mstange.

https://hg.mozilla.org/integration/mozilla-inbound/rev/864f918423a3d99dfff536de4780f08e4e922364
Bug 1334466 (part 5) - Remove PlatformData::profiled_pthread_. r=mstange.

Comment 9

3 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/89526e05e79d
https://hg.mozilla.org/mozilla-central/rev/63af77eff001
https://hg.mozilla.org/mozilla-central/rev/66ffe7a006d1
https://hg.mozilla.org/mozilla-central/rev/cb29b76cb9d5
https://hg.mozilla.org/mozilla-central/rev/864f918423a3
Status: ASSIGNED → RESOLVED
Last Resolved: 3 months ago
status-firefox54: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
You need to log in before you can comment on or make changes to this bug.