Closed
Bug 1189881
Opened 10 years ago
Closed 9 years ago
Move GeckoJavaSampler.getProfilerTime out of AndroidJNI.cpp
Categories
(Core Graveyard :: Widget: Android, defect)
Tracking
(firefox43 fixed)
RESOLVED
FIXED
mozilla43
Tracking | Status | |
---|---|---|
firefox43 | --- | fixed |
People
(Reporter: jchen, Assigned: droeh)
References
Details
Attachments
(1 file, 6 obsolete files)
11.18 KB,
patch
|
droeh
:
review+
|
Details | Diff | Splinter Review |
Similar to bug 1182641 and bug 1186467, we want to move GeckoJavaSampler.getProfilerTime out of AndroidJNI.cpp and into an appropriate class.
Updated•10 years ago
|
Assignee: nobody → droeh
Assignee | ||
Comment 1•10 years ago
|
||
Jim, can you take a look at this when you've got a moment? Thanks.
Flags: needinfo?(nchen)
Assignee | ||
Comment 2•10 years ago
|
||
Moves GeckoJavaSampler.getProfilerTime to GeckoJavaSampler.h/cpp
Attachment #8652515 -
Attachment is obsolete: true
Attachment #8652944 -
Flags: review?(snorp)
Updated•10 years ago
|
Attachment #8652944 -
Flags: review?(snorp) → review?(nchen)
Reporter | ||
Comment 3•10 years ago
|
||
Comment on attachment 8652944 [details] [diff] [review]
Proposed Patch
Review of attachment 8652944 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good, but I didn't see the GeckoJavaSampler.h/cpp changes. Did you mean to include those as well?
Attachment #8652944 -
Flags: review?(nchen) → feedback+
Reporter | ||
Updated•10 years ago
|
Flags: needinfo?(nchen)
Assignee | ||
Comment 4•10 years ago
|
||
Yep, missed GeckoJavaSampler.h/cpp in that last patch. This one should be good.
Attachment #8652944 -
Attachment is obsolete: true
Attachment #8653019 -
Flags: review?(nchen)
Reporter | ||
Comment 5•10 years ago
|
||
Comment on attachment 8653019 [details] [diff] [review]
Proposed patch (updated)
Review of attachment 8653019 [details] [diff] [review]:
-----------------------------------------------------------------
Getting there! Like I said on IRC yesterday, I think we should move the GeckoJavaSampler implementation to under tools/profiler/, maybe inside tools/profiler/core/platform.cpp. Then you can call GeckoJavaSampler::Init from inside mozilla_sampler_init. Just remember to put | #ifdef SPS_OS_android | around everything.
[1] http://mxr.mozilla.org/mozilla-central/source/tools/profiler/core/platform.cpp?rev=fea87cbeaa6b#434
Attachment #8653019 -
Flags: review?(nchen) → feedback+
Assignee | ||
Comment 6•10 years ago
|
||
I actually looked into doing that, but the problem I ran into was that in order to call mozilla::GeckoJavaSampler::Init() in nsAppShell.cpp, I would have to include tools/profiler/core/platform.h (or something that includes that), which creates competing definitions of Mutex and MutexAutoLock in nsAppShell (the other definitions being from xpcom/glue/Mutex.h).
I didn't see an easy way around this, but if you've got a suggestion I'm open to try it.
Flags: needinfo?(nchen)
Reporter | ||
Comment 7•10 years ago
|
||
You don't have to call GeckoJavaSampler::Init() in nsAppShell.cpp. Instead, you can call it inside mozilla_sampler_init, which is inside platform.cpp. So everything can go inside platform.cpp; you don't even need to touch platform.h.
Flags: needinfo?(nchen)
Assignee | ||
Comment 8•10 years ago
|
||
Alright, thanks Jim. Here's a patch that handles it that way.
Attachment #8653019 -
Attachment is obsolete: true
Attachment #8654128 -
Flags: review?(nchen)
Reporter | ||
Comment 9•10 years ago
|
||
Comment on attachment 8654128 [details] [diff] [review]
Proposed patch (updated)
Review of attachment 8654128 [details] [diff] [review]:
-----------------------------------------------------------------
::: tools/profiler/core/platform.cpp
@@ +58,5 @@
> + static double GetProfilerTime();
> +};
> +
> +double
> +GeckoJavaSampler::GetProfilerTime() {
You can just put the function inside the class declaration. And you don't really need the mozilla namespace for GeckoJavaSampler.
@@ +522,5 @@
>
> const char* threadFilters[] = { "GeckoMain", "Compositor" };
>
> +#ifdef SPS_OS_android
> + mozilla::GeckoJavaSampler::Init();
You have to move this to above the line
> const char *val = getenv("MOZ_PROFILER_STARTUP");
Because otherwise it won't run unless the MOZ_PROFILER_STARTUP env var is eet.
::: tools/profiler/moz.build
@@ +89,5 @@
> '/mozglue/linker',
> '/toolkit/crashreporter/google-breakpad/src',
> '/tools/profiler/core/',
> '/tools/profiler/gecko/',
> + '/widget/android',
Instead of this, can you add "GeneratedJNINatives.h" under EXPORTS in widget/android/moz.build?
Attachment #8654128 -
Flags: review?(nchen) → feedback+
Assignee | ||
Comment 10•10 years ago
|
||
Now with recommended changes.
Attachment #8654128 -
Attachment is obsolete: true
Attachment #8654197 -
Flags: review?(nchen)
Reporter | ||
Comment 11•10 years ago
|
||
Comment on attachment 8654197 [details] [diff] [review]
Proposed patch (updated)
Review of attachment 8654197 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good! Thanks! Adding BenWa to rubber stamp the tools/profiler changes.
Attachment #8654197 -
Flags: review?(nchen)
Attachment #8654197 -
Flags: review?(bgirard)
Attachment #8654197 -
Flags: review+
Comment 12•10 years ago
|
||
Comment on attachment 8654197 [details] [diff] [review]
Proposed patch (updated)
Review of attachment 8654197 [details] [diff] [review]:
-----------------------------------------------------------------
Thanks!
Attachment #8654197 -
Flags: review?(bgirard) → review+
Assignee | ||
Comment 13•10 years ago
|
||
Assignee | ||
Comment 14•10 years ago
|
||
Assignee | ||
Comment 15•9 years ago
|
||
Assignee | ||
Comment 16•9 years ago
|
||
Assignee | ||
Comment 17•9 years ago
|
||
Updated to fix test breakage. Carry over jchen's r+.
Attachment #8654197 -
Attachment is obsolete: true
Attachment #8661786 -
Flags: review+
Assignee | ||
Updated•9 years ago
|
Keywords: checkin-needed
Comment 18•9 years ago
|
||
Keywords: checkin-needed
Comment 19•9 years ago
|
||
sorry had to back this out since this caused a bustage on b2g like https://treeherder.mozilla.org/logviewer.html#?job_id=14257056&repo=mozilla-inbound
Flags: needinfo?(droeh)
Comment 20•9 years ago
|
||
Assignee | ||
Comment 21•9 years ago
|
||
Fixed b2g build breakage. Carry over jchen's r+.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=08000315018b
Attachment #8661786 -
Attachment is obsolete: true
Flags: needinfo?(droeh)
Attachment #8662955 -
Flags: review+
Assignee | ||
Updated•9 years ago
|
Keywords: checkin-needed
Comment 22•9 years ago
|
||
Keywords: checkin-needed
Comment 23•9 years ago
|
||
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox43:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla43
Updated•3 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•