Closed Bug 1770544 Opened 2 years ago Closed 2 years ago

multiple definitions of AUTO_PROFILER_THREAD_WAKE on non-MOZ_GECKO_PROFILER platforms

Categories

(Core :: Gecko Profiler, defect, P3)

Unspecified
OpenBSD
defect

Tracking

()

RESOLVED FIXED
103 Branch
Tracking Status
firefox-esr91 --- unaffected
firefox100 --- wontfix
firefox101 --- wontfix
firefox102 --- fixed
firefox103 --- fixed

People

(Reporter: gaston, Assigned: mozbugz)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

this one is filling my build logs since the profiler headers are included from everywhere:

 7:23.02 /usr/obj/m-c/dist/include/mozilla/ProfilerThreadState.h:90:9: warning: 'AUTO_PROFILER_THREAD_WAKE' macro redefined [-Wmacro-redefined]
 7:23.02 #define AUTO_PROFILER_THREAD_WAKE mozilla::AutoProfilerThreadWake PROFILER_RAII
 7:23.02         ^
 7:23.02 /usr/obj/m-c/dist/include/mozilla/ProfilerThreadSleep.h:21:11: note: previous definition is here
 7:23.03 #  define AUTO_PROFILER_THREAD_WAKE

maybe an #ifndef could be added to the fallback definition in ProfilerThreadSleep.h ?

Flags: needinfo?(gsquelart)

Thank you for the report.
Hmm, the one in ProfilerThreadSleep.h is an empty fallback for non-MOZ_GECKO_PROFILER builds, but the one in ProfilerThradState.h is always defined.

I rather think that the "real" definition in ProfilerThreadState.h should be guarded with in #ifdef MOZ_GECKO_PROFILER, similar to how AUTO_PROFILER_THREAD_SLEEP is.

I may not have the time for it this week (traveling). Keeping the NI as a reminder.

Has Regression Range: --- → yes
Keywords: regression
Regressed by: 1757596

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

(In reply to Gerald Squelart [:gerald] (he/him) from comment #1)

Thank you for the report.
Hmm, the one in ProfilerThreadSleep.h is an empty fallback for non-MOZ_GECKO_PROFILER builds, but the one in ProfilerThradState.h is always defined.

I rather think that the "real" definition in ProfilerThreadState.h should be guarded with in #ifdef MOZ_GECKO_PROFILER, similar to how AUTO_PROFILER_THREAD_SLEEP is.

you mean adding #ifdef MOZ_GECKO_PROFILER around https://searchfox.org/mozilla-central/source/tools/profiler/public/ProfilerThreadState.h#90 ? or also include AutoProfilerThreadWake class definition within it ? the class is also defined here: https://searchfox.org/mozilla-central/source/mozglue/baseprofiler/public/BaseProfiler.h#467

I may not have the time for it this week (traveling). Keeping the NI as a reminder.

No hurry, can test patch when you have one to confirm the warnings are gone on platforms without profiler :)

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

Assignee: nobody → gsquelart
Flags: needinfo?(gsquelart)

The severity field is not set for this bug.
:gerald, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(gsquelart)
Severity: -- → S4
Flags: needinfo?(gsquelart)
Priority: -- → P3
Pushed by gsquelart@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d482b898c011
Avoid AUTO_PROFILER_THREAD_WAKE re-#define in non-MOZ_GECKO_PROFILER builds - r=gaston
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 103 Branch

Comment on attachment 9280151 [details]
Bug 1770544 - Avoid AUTO_PROFILER_THREAD_WAKE re-#define in non-MOZ_GECKO_PROFILER builds - r?gaston

Beta/Release Uplift Approval Request

  • User impact if declined: annoying warnings during on tier3 / non-profiler platforms - would be nice to have in 102esr branch.
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): npotb for tier1 via #ifdefs..
  • String changes made/needed: none
  • Is Android affected?: No

ESR Uplift Approval Request

  • If this is not a sec:{high,crit} bug, please state case for ESR consideration: would be nice to have in 102esr branch for tidier logs.
  • User impact if declined: annoying warnings during on tier3 / non-profiler platforms
  • Fix Landed on Version: 103
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): npotb for tier1 via #ifdefs..
Attachment #9280151 - Flags: approval-mozilla-esr102?
Attachment #9280151 - Flags: approval-mozilla-beta?

Comment on attachment 9280151 [details]
Bug 1770544 - Avoid AUTO_PROFILER_THREAD_WAKE re-#define in non-MOZ_GECKO_PROFILER builds - r?gaston

Approved for 102 beta 6, thanks.

Attachment #9280151 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Attachment #9280151 - Flags: approval-mozilla-esr102?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: