boklm pushed to branch tor-browser-150.0a1-16.0-1 at The Tor Project / Applications / Tor Browser Commits: fa337cb6 by Damien Carver at 2026-04-21T10:52:19+02:00 !dropme Bug 2024724 - Fix PowerCounters.h because we do not compile PowerCounters-win.cpp against __MINGW32__ r=canaltinova,profiler-reviewers BB 44868: Backport upstream commit to fix Windows builds This commit should be dropped during the 151 rebase as it was reverted as part of https://bugzilla.mozilla.org/show_bug.cgi?id=2026031 in the upstream 151 branch. - - - - - 4 changed files: - mozglue/baseprofiler/public/BaseProfilerState.h - tools/profiler/core/PowerCounters.h - tools/profiler/moz.build - tools/profiler/public/ProfilerState.h Changes: ===================================== mozglue/baseprofiler/public/BaseProfilerState.h ===================================== @@ -136,7 +136,7 @@ class MOZ_RAII AutoProfilerStats { "Record the power used by the entire system with each sample. " \ "Only available with Intel CPUs and requires setting " \ "the sysctl kernel.perf_event_paranoid to 0." -#elif defined(GP_OS_windows) +#elif defined(GP_OS_windows) && defined(_MSC_VER) # define POWER_HELP \ "Record the value of every energy meter available on the system with " \ "each sample. Only available on Windows 11 with Intel CPUs." ===================================== tools/profiler/core/PowerCounters.h ===================================== @@ -10,7 +10,7 @@ #include "mozilla/UniquePtr.h" #include "mozilla/Vector.h" -#if defined(GP_OS_windows) +#if defined(GP_OS_windows) && defined(_MSC_VER) class PowerMeterDevice; #endif #if defined(GP_PLAT_arm64_darwin) @@ -50,20 +50,20 @@ bool GetRailEnergyData(RailEnergyData*, size_t* size_of_arr); class PowerCounters { public: -#if defined(GP_OS_windows) || defined(GP_OS_darwin) || \ +#if (defined(GP_OS_windows) && defined(_MSC_VER)) || defined(GP_OS_darwin) || \ defined(GP_PLAT_amd64_linux) || defined(GP_PLAT_arm64_android) explicit PowerCounters(); #else explicit PowerCounters() {}; #endif -#if defined(GP_OS_windows) || defined(GP_PLAT_amd64_darwin) || \ - defined(GP_PLAT_arm64_android) +#if (defined(GP_OS_windows) && defined(_MSC_VER)) || \ + defined(GP_PLAT_amd64_darwin) || defined(GP_PLAT_arm64_android) ~PowerCounters(); #else ~PowerCounters() = default; #endif -#if defined(GP_OS_windows) || defined(GP_PLAT_amd64_darwin) || \ - defined(GP_PLAT_arm64_android) +#if (defined(GP_OS_windows) && defined(_MSC_VER)) || \ + defined(GP_PLAT_amd64_darwin) || defined(GP_PLAT_arm64_android) void Sample(); #else void Sample() {}; @@ -75,7 +75,7 @@ class PowerCounters { private: CountVector mCounters; -#if defined(GP_OS_windows) +#if defined(GP_OS_windows) && defined(_MSC_VER) mozilla::Vector<mozilla::UniquePtr<PowerMeterDevice>> mPowerMeterDevices; #endif #if defined(GP_PLAT_amd64_darwin) ===================================== tools/profiler/moz.build ===================================== @@ -167,6 +167,7 @@ elif CONFIG["OS_TARGET"] == "WINNT" and CONFIG["TARGET_CPU"] in ( UNIFIED_SOURCES += [ "gecko/nsProfiler.cpp", ] + # Keep in sync with PowerCounters.h, BaseProfilerState.h and ProfilerState.h (see __MINGW32__) if CONFIG["CC_TYPE"] == "clang-cl": UNIFIED_SOURCES += [ "core/PowerCounters-win.cpp", ===================================== tools/profiler/public/ProfilerState.h ===================================== @@ -31,7 +31,7 @@ "Only available with Intel CPUs and requires setting " \ "the sysctl kernel.perf_event_paranoid to 0." -#elif defined(GP_OS_windows) +#elif defined(GP_OS_windows) && defined(_MSC_VER) # define POWER_HELP \ "Record the value of every energy meter available on the system with " \ "each sample. Only available on Windows 11 with Intel CPUs." View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/fa337cb6... -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/fa337cb6... You're receiving this email because of your account on gitlab.torproject.org. Manage all notifications: https://gitlab.torproject.org/-/profile/notifications | Help: https://gitlab.torproject.org/help
participants (1)
-
boklm (@boklm)