tools/profiler/public/GeckoProfiler.h:59:32: fatal error: GeckoProfilerTypes.h: No such file or directory (non-SPS)

RESOLVED FIXED in Firefox 53

Status

()

Core
Gecko Profiler
RESOLVED FIXED
a year ago
a year ago

People

(Reporter: Jan Beich, Assigned: Jan Beich)

Tracking

({regression})

Trunk
mozilla53
Unspecified
FreeBSD
regression
Points:
---

Firefox Tracking Flags

(firefox50 unaffected, firefox51 unaffected, firefox52 unaffected, firefox53 fixed)

Details

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment)

(Assignee)

Description

a year ago
On platforms without SPS profiler (e.g. BSDs, Solaris, Darwin/X11 and maybe iOS) some headers under tools/profiler/public/ aren't exported which leads to the following error.

In file included from objdir/dom/presentation/Unified_cpp_dom_presentation0.cpp:110:
In file included from dom/presentation/PresentationSessionInfo.cpp:7:
In file included from objdir/dist/include/mozilla/dom/ContentParent.h:10:
In file included from objdir/ipc/ipdl/_ipdlheaders/mozilla/dom/PContentParent.h:9:
In file included from objdir/ipc/ipdl/_ipdlheaders/mozilla/dom/PContent.h:20:
In file included from objdir/dist/include/ipc/DataStorageIPCUtils.h:11:
In file included from objdir/dist/include/mozilla/DataStorage.h:11:
In file included from objdir/dist/include/mozilla/Monitor.h:10:
In file included from objdir/dist/include/mozilla/CondVar.h:16:
objdir/dist/include/GeckoProfiler.h:59:10: fatal error: 'GeckoProfilerTypes.h' file not found
#include "GeckoProfilerTypes.h"
         ^
1 error generated.
(Assignee)

Comment 1

a year ago
Trying to export GeckoProfilerTypes.h for non-SPS leads to the following error.

layout/base/nsRefreshDriver.cpp:1827:13: error: no matching function for call to
      'profiler_tracing'
            profiler_tracing("Paint", "Styles", Move(mStyleCause), TRACING_INTERVAL_START);
            ^~~~~~~~~~~~~~~~
objdir/dist/include/GeckoProfiler.h:118:20: note: candidate function not viable: no known
      conversion from 'typename RemoveReference<UniquePtr<ProfilerBacktrace,
      ProfilerBacktraceDestructor> &>::Type' (aka 'mozilla::UniquePtr<ProfilerBacktrace,
      ProfilerBacktraceDestructor>') to 'ProfilerBacktrace *' for 3rd argument
static inline void profiler_tracing(const char* aCategory, const char* aInfo,
                   ^
objdir/dist/include/GeckoProfiler.h:114:20: note: candidate function not viable: requires at
      most 3 arguments, but 4 were provided
static inline void profiler_tracing(const char* aCategory, const char* aInfo,
                   ^
layout/base/nsRefreshDriver.cpp:1867:11: error: no matching function for call to
      'profiler_tracing'
          profiler_tracing("Paint", "Reflow", Move(mReflowCause), TRACING_INTERVAL_START);
          ^~~~~~~~~~~~~~~~
objdir/dist/include/GeckoProfiler.h:118:20: note: candidate function not viable: no known
      conversion from 'typename RemoveReference<UniquePtr<ProfilerBacktrace,
      ProfilerBacktraceDestructor> &>::Type' (aka 'mozilla::UniquePtr<ProfilerBacktrace,
      ProfilerBacktraceDestructor>') to 'ProfilerBacktrace *' for 3rd argument
static inline void profiler_tracing(const char* aCategory, const char* aInfo,
                   ^
objdir/dist/include/GeckoProfiler.h:114:20: note: candidate function not viable: requires at
      most 3 arguments, but 4 were provided
static inline void profiler_tracing(const char* aCategory, const char* aInfo,
                   ^
2 errors generated.
(Assignee)

Comment 2

a year ago
Android on aarch64 and Linux on non-x86 are also part of non-SPS list.

Ted, what happened to iOS? Was it relegated to Tier3 like B2G? Looking at old-configure.in and toolkit/moz.configure changes I don't see it gaining SPS support.
Flags: needinfo?(ted)
(In reply to Jan Beich from comment #2)
> Ted, what happened to iOS? Was it relegated to Tier3 like B2G? Looking at
> old-configure.in and toolkit/moz.configure changes I don't see it gaining
> SPS support.

It's basically Tier-3 in that we don't have any CI builds for it, yes.
Flags: needinfo?(ted)
I'm sorry for breaking non-SPS builds again, Jan. We really need a CI job that compiles without SPS, or change the SPS code so that it can be compiled for all platforms.
(Assignee)

Updated

a year ago
See Also: → bug 1329466, bug 1329467
(Assignee)

Comment 5

a year ago
After adjusting profiler_tracing() stub the build fails during linking libxul.so. Maybe mozilla::UniquePtr doesn't like incomplete types.

../../layout/base/nsRefreshDriver.o: In function `nsRefreshDriver::~nsRefreshDriver()':
layout/base/nsRefreshDriver.cpp:(.text._ZN15nsRefreshDriverD2Ev+0x4a8): undefined reference to `ProfilerBacktraceDestructor::operator()(ProfilerBacktrace*)'
/usr/bin/ld: ../../layout/base/nsRefreshDriver.o: relocation R_X86_64_PC32 against `_ZN27ProfilerBacktraceDestructorclEP17ProfilerBacktrace' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
Comment hidden (mozreview-request)
(Assignee)

Comment 8

a year ago
mozreview-review
Comment on attachment 8824758 [details]
Bug 1329291 - Unbreak build on non-SPS platforms after bug 1142197.

https://reviewboard.mozilla.org/r/103074/#review103680

::: tools/profiler/public/GeckoProfiler.h:161
(Diff revision 1)
>  // Immediately capture the current thread's call stack and return it
>  static inline UniqueProfilerBacktrace profiler_get_backtrace() { return nullptr; }
>  static inline void profiler_get_backtrace_noalloc(char *output, size_t outputSize) { return; }
>  
> +// Free a ProfilerBacktrace returned by profiler_get_backtrace()
> +inline void ProfilerBacktraceDestructor::operator()(ProfilerBacktrace* aBacktrace) {}

Before bug 1142197 this was `mozilla_sampler_free_backtrace()`. Not sure if it wouldn't leak memory but at least cannot be made `static`.

```c++
In file included from toolkit/components/terminator/nsTerminator.cpp:35:
objdir/dist/include/GeckoProfiler.h:161:1: error: 'static' can only be specified inside the class definition
static inline void ProfilerBacktraceDestructor::operator()(ProfilerBacktrace* aBacktrace) {}
^~~~~~~
1 error generated.
```

Comment 9

a year ago
mozreview-review
Comment on attachment 8824758 [details]
Bug 1329291 - Unbreak build on non-SPS platforms after bug 1142197.

https://reviewboard.mozilla.org/r/103074/#review103884

Thanks for the patch; apologies for breaking this.

::: tools/profiler/public/GeckoProfiler.h:161
(Diff revision 1)
>  // Immediately capture the current thread's call stack and return it
>  static inline UniqueProfilerBacktrace profiler_get_backtrace() { return nullptr; }
>  static inline void profiler_get_backtrace_noalloc(char *output, size_t outputSize) { return; }
>  
> +// Free a ProfilerBacktrace returned by profiler_get_backtrace()
> +inline void ProfilerBacktraceDestructor::operator()(ProfilerBacktrace* aBacktrace) {}

I don't think this can leak memory, because `profiler_get_backtrace`, above, always returns `nullptr` in this configuration.
Attachment #8824758 - Flags: review?(nfroyd) → review+
FYI we continually had this same problem with MOZ_GAMEPAD, and what we wound up doing was just implementing a stub gamepad backend, and using that for any platform that didn't have a real gamepad backend. (bug 1315896)
(Assignee)

Updated

a year ago
Keywords: checkin-needed
Assignee: nobody → jbeich

Comment 11

a year ago
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/49f393e88b6c
Unbreak build on non-SPS platforms after bug 1142197. r=froydnj
Keywords: checkin-needed

Comment 12

a year ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/49f393e88b6c
Status: NEW → RESOLVED
Last Resolved: a year ago
status-firefox53: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
status-firefox50: --- → unaffected
status-firefox51: --- → unaffected
status-firefox52: --- → unaffected
You need to log in before you can comment on or make changes to this bug.