Closed Bug 1693037 Opened 4 years ago Closed 4 years ago

/MediaDecoderStateMachine.cpp:387:56: error: ?MEDIA_PLAYBACK? was not declared in this scope

Categories

(Core :: Gecko Profiler, defect, P2)

defect

Tracking

()

RESOLVED FIXED
87 Branch
Tracking Status
firefox-esr78 --- unaffected
firefox85 --- unaffected
firefox86 --- unaffected
firefox87 --- fixed

People

(Reporter: petr.sumbera, Assigned: mozbugz)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0

Steps to reproduce:

I see following build errors on Solaris:

 7:42.74 /builds/psumbera/mozilla-central-build/dom/media/MediaDecoderStateMachine.cpp:387:56: error: ?MEDIA_PLAYBACK? was not declared in this scope; did you mean ?JS::ProfilingCategoryPair::MEDIA_PLAYBACK??
 7:42.74   387 |     PROFILER_MARKER_UNTYPED("MDSM::EnterDormantState", MEDIA_PLAYBACK);
 7:42.74       |                                                        ^~~~~~~~~~~~~~
 7:42.74       |                                                        JS::ProfilingCategoryPair::MEDIA_PLAYBACK
 7:42.74 In file included from /builds/psumbera/mozilla-central-build/obj-x86_64-pc-solaris2.11/dist/include/js/ProfilingStack.h:15,
 7:42.74                  from /builds/psumbera/mozilla-central-build/obj-x86_64-pc-solaris2.11/dist/include/js/RootingAPI.h:27,
 7:42.74                  from /builds/psumbera/mozilla-central-build/obj-x86_64-pc-solaris2.11/dist/include/mozilla/dom/ImageBitmapBinding.h:6,
 7:42.74                  from /builds/psumbera/mozilla-central-build/dom/media/ImageToI420.cpp:10,
 7:42.74                  from Unified_cpp_dom_media2.cpp:2:
 7:42.74 /builds/psumbera/mozilla-central-build/obj-x86_64-pc-solaris2.11/dist/include/js/ProfilingCategoryList.h:116:24: note: ?JS::ProfilingCategoryPair::MEDIA_PLAYBACK? declared here
 7:42.74   116 |     SUBCATEGORY(MEDIA, MEDIA_PLAYBACK, "Playback") \
 7:42.74       |                        ^~~~~~~~~~~~~~
 7:42.74 /builds/psumbera/mozilla-central-build/obj-x86_64-pc-solaris2.11/dist/include/js/ProfilingCategory.h:24:71: note: in definition of macro ?CATEGORY_ENUM_SUBCATEGORY? 7:42.74    24 | #define CATEGORY_ENUM_SUBCATEGORY(supercategory, name, labelAsString) name,
 7:42.74       |                                                                       ^~~~
 7:42.74 /builds/psumbera/mozilla-central-build/obj-x86_64-pc-solaris2.11/dist/include/js/ProfilingCategory.h:27:3: note: in expansion of macro ?MOZ_PROFILING_CATEGORY_LIST? 7:42.74    27 |   MOZ_PROFILING_CATEGORY_LIST(CATEGORY_ENUM_BEGIN_CATEGORY,
 7:42.74       |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
 7:42.82 In file included from Unified_cpp_dom_media2.cpp:47:
 7:42.82 /builds/psumbera/mozilla-central-build/dom/media/MediaDecoderStateMachine.cpp:387:5: error: ?PROFILER_MARKER_UNTYPED? was not declared in this scope
 7:42.82   387 |     PROFILER_MARKER_UNTYPED("MDSM::EnterDormantState", MEDIA_PLAYBACK);
 7:42.82       |     ^~~~~~~~~~~~~~~~~~~~~~~
 7:42.82 /builds/psumbera/mozilla-central-build/dom/media/MediaDecoderStateMachine.cpp:387:5: note: the macro ?PROFILER_MARKER_UNTYPED? had not yet been defined
 7:42.82 In file included from /builds/psumbera/mozilla-central-build/dom/media/MediaFormatReader.cpp:27,
 7:42.82                  from Unified_cpp_dom_media2.cpp:74:
 7:42.82 /builds/psumbera/mozilla-central-build/obj-x86_64-pc-solaris2.11/dist/include/mozilla/ProfilerMarkers.h:40: note: it was later defined here
 7:42.82    40 | #  define PROFILER_MARKER_UNTYPED(markerName, categoryName, ...)
 7:42.82       |
 7:43.08 In file included from Unified_cpp_dom_media2.cpp:47:
 7:43.08 /builds/psumbera/mozilla-central-build/dom/media/MediaDecoderStateMachine.cpp: In member function ?nsresult mozilla::MediaDecoderStateMachine::AccurateSeekingState::DropVideoUpToSeekTarget(mozilla::VideoData*)?:
 7:43.08 /builds/psumbera/mozilla-central-build/dom/media/MediaDecoderStateMachine.cpp:1401:64: error: ?MEDIA_PLAYBACK? was not declared in this scope; did you mean ?JS::ProfilingCategoryPair::MEDIA_PLAYBACK??
 7:43.08  1401 |       PROFILER_MARKER_UNTYPED("MDSM::DropVideoUpToSeekTarget", MEDIA_PLAYBACK);
 7:43.08       |                                                                ^~~~~~~~~~~~~~
 7:43.08       |                                                                JS::ProfilingCategoryPair::MEDIA_PLAYBACK

Where the first bad revision is:

changeset:   567595:14358973739c
user:        Gerald Squelart <gsquelart@mozilla.com>
date:        Mon Feb 15 20:44:19 2021 -0800
description:
	Bug 1691589 - Reduce reliance on GeckoProfiler.h when only labels (and maybe markers) are needed - r=necko-reviewers,geckoview-reviewers,sg,agi,florian

	There are no code changes, only #include changes.
	It was a fairly mechanical process: Search for all "AUTO_PROFILER_LABEL", and in each file, if only labels are used, convert "GeckoProfiler.h" into "ProfilerLabels.h" (or just add that last one where needed).
	In some files, there were also some marker calls but no other profiler-related calls, in these cases "GeckoProfiler.h" was replaced with both "ProfilerLabels.h" and "ProfilerMarkers.h", which still helps in reducing the use of the all-encompassing "GeckoProfiler.h".

	Differential Revision: https://phabricator.services.mozilla.com/D104588
Keywords: regression
Regressed by: 1691589
Has Regression Range: --- → yes

Gerald, can you please have look at this?

Flags: needinfo?(gsquelart)
Component: Untriaged → Gecko Profiler
Product: Firefox → Core
Assignee: nobody → gsquelart
Severity: -- → S4
Flags: needinfo?(gsquelart)
Priority: -- → P2

Thank you for the report Petr.
I did try a non-MOZ_GECKO_PROFILER build locally, but didn't see this error (and still can't). I suspect unified-building is causing the difference.

Anyway, it's a simple fix in this case: Add #include "mozilla/ProfilerMarkerTypes.h" at line 19 of MediaDecoderStateMachine.cpp. Could you please try on your side, in case there are more errors after that? (Bug 1691589 was a big patch touching many files, so there could be other similar mistakes that I can't catch.)

Flags: needinfo?(petr.sumbera)

I have applied above patch. There was one more issue:

18:37.56 /builds/psumbera/FIREFOX/gfx/layers/client/ClientLayerManager.cpp:305:3: error: ?AUTO_PROFILER_TRACING_MARKER? was not declared in this scope
18:37.56   305 |   AUTO_PROFILER_TRACING_MARKER("Paint", "Rasterize", GRAPHICS);
18:37.56       |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
18:37.61 /builds/psumbera/FIREFOX/gfx/layers/client/ClientLayerManager.cpp: In member function ?void mozilla::layers::ClientLayerManager::ForwardTransaction(bool)?:
18:37.61 /builds/psumbera/FIREFOX/gfx/layers/client/ClientLayerManager.cpp:682:63: error: ?GRAPHICS? was not declared in this scope
18:37.61   682 |   AUTO_PROFILER_TRACING_MARKER("Paint", "ForwardTransaction", GRAPHICS);
18:37.61       |                                                               ^~~~~~~~
...

But adding the header finally made it:

--- a/gfx/layers/client/ClientLayerManager.cpp  Fri Jan 15 13:03:49 2021 +0100
+++ b/gfx/layers/client/ClientLayerManager.cpp  Wed Feb 17 09:41:15 2021 +0100
@@ -9,6 +9,7 @@
 #include "mozilla/Assertions.h"  // for MOZ_ASSERT, etc
 #include "mozilla/Hal.h"
 #include "mozilla/ProfilerLabels.h"
+#include "mozilla/ProfilerMarkerTypes.h"
 #include "mozilla/StaticPrefs_apz.h"
 #include "mozilla/StaticPrefs_gfx.h"
 #include "mozilla/StaticPrefs_layers.h"
Flags: needinfo?(petr.sumbera)

Thank you Petr.

I've just managed to do a non-unified non-MOZ_GECKO_PROFILER build: https://treeherder.mozilla.org/logviewer?job_id=330206667&repo=try&lineNumber=4850
It confirms what you found, and a few other potential things that may not happen on your platform.

Set release status flags based on info from the regressing bug 1691589

Attachment #9203548 - Attachment description: Bug 1693037 - Add missing include in MediaDecoderStateMachine.cpp - r?florian → Bug 1693037 - Fix non-MOZ_GECKO_PROFILER builds - r?florian
Pushed by gsquelart@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2ca3989a20c3 Fix non-MOZ_GECKO_PROFILER builds - r=florian
Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 87 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: