Verified Commit fa337cb6 authored by Damien Carver's avatar Damien Carver Committed by boklm
Browse files

!dropme Bug 2024724 - Fix PowerCounters.h because we do not compile...

!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.
parent be92795a
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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."
+7 −7
Original line number Diff line number Diff line
@@ -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)
+1 −0
Original line number Diff line number Diff line
@@ -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",
+1 −1
Original line number Diff line number Diff line
@@ -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."