Fix CPU telemetry temperature/clock speed on Windows and macOS
sample_cpu_temperature() only ever had a Linux implementation, so Windows and macOS runs recorded empty temperature data points for every sample. sample_cpu_clock_mhz() on both platforms read a static nominal frequency once (Windows: the ~MHz registry value; macOS: the hw.cpufrequency sysctl) instead of a live reading, so clock speed showed as a constant throughout the benchmark. Windows: temperature now queries the ACPI thermal zone over WMI (MSAcpi_ThermalZoneTemperature), and clock speed reads live per-core frequency via CallNtPowerInformation(ProcessorInformation). Both are XP-compatible (verified via mingw cross-compile with the existing windows-i386 XP toolchain/PE checks). macOS: temperature reads the SMC directly (AppleSMC user client), checking known CPU sensor keys across Intel and Apple Silicon (M1-M5). There is no live-frequency API on macOS at all (Apple Silicon has none, and hw.cpufrequency was always a fixed nominal value even on Intel), so clock speed now reports as unavailable instead of a misleading constant. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PcL8rcwwBeD6W3fZFCRLss
This commit is contained in:
@@ -178,20 +178,21 @@ $(DIST)/fossbench-linux-ppc64le: $(DRIVER) $(DRIVER_DEPS) $(ASM_PPC64LE) | $(DIS
|
||||
@echo "built $@"
|
||||
|
||||
$(DIST)/fossbench-macos-arm64: $(DRIVER) $(DRIVER_DEPS) $(ASM_ARM64) | $(DIST)
|
||||
$(CC_MACOS_ARM64) -arch arm64 $(CFLAGS) $(PTHREAD) $(LDFLAGS) -o $@ $(DRIVER) $(ASM_ARM64) $(LDLIBS)
|
||||
$(CC_MACOS_ARM64) -arch arm64 $(CFLAGS) $(PTHREAD) $(LDFLAGS) -o $@ $(DRIVER) $(ASM_ARM64) $(LDLIBS) -framework IOKit -framework CoreFoundation
|
||||
@echo "built $@"
|
||||
|
||||
$(DIST)/fossbench-macos-amd64: $(DRIVER) $(DRIVER_DEPS) $(ASM_AMD64) | $(DIST)
|
||||
MACOSX_DEPLOYMENT_TARGET=$(MACOS_AMD64_MIN) $(CC_MACOS_AMD64) -arch x86_64 -mmacosx-version-min=$(MACOS_AMD64_MIN) $(CFLAGS) $(PTHREAD) $(LDFLAGS) -Wl,-no_fixup_chains -o $@ $(DRIVER) $(ASM_AMD64) $(LDLIBS)
|
||||
MACOSX_DEPLOYMENT_TARGET=$(MACOS_AMD64_MIN) $(CC_MACOS_AMD64) -arch x86_64 -mmacosx-version-min=$(MACOS_AMD64_MIN) $(CFLAGS) $(PTHREAD) $(LDFLAGS) -Wl,-no_fixup_chains -o $@ $(DRIVER) $(ASM_AMD64) $(LDLIBS) -framework IOKit -framework CoreFoundation
|
||||
@echo "built $@"
|
||||
|
||||
# Windows builds are static and use WinHTTP.
|
||||
# Windows builds are static and use WinHTTP. Temperature/clock telemetry
|
||||
# additionally needs WMI (ole32/oleaut32/wbemuuid) and PowrProf.
|
||||
$(DIST)/fossbench-windows-amd64.exe: $(DRIVER) $(DRIVER_DEPS) $(ASM_AMD64) | $(DIST)
|
||||
$(CC_WINDOWS_AMD64) $(CFLAGS) $(PTHREAD) -static -o $@ $(DRIVER) $(ASM_AMD64) -lm -lwinhttp -ladvapi32
|
||||
$(CC_WINDOWS_AMD64) $(CFLAGS) $(PTHREAD) -static -o $@ $(DRIVER) $(ASM_AMD64) -lm -lwinhttp -ladvapi32 -lole32 -loleaut32 -lwbemuuid -lpowrprof
|
||||
@echo "built $@"
|
||||
|
||||
$(DIST)/fossbench-windows-i386.exe: $(DRIVER) $(DRIVER_DEPS) $(SRC_I386) | $(DIST)
|
||||
$(CC_WINDOWS_I386) -march=i386 $(WINDOWS_I386_XP_CFLAGS) $(CFLAGS) -static $(WINDOWS_I386_XP_LDFLAGS) -o $@ $(DRIVER) $(SRC_I386) -lm -lwinhttp -ladvapi32
|
||||
$(CC_WINDOWS_I386) -march=i386 $(WINDOWS_I386_XP_CFLAGS) $(CFLAGS) -static $(WINDOWS_I386_XP_LDFLAGS) -o $@ $(DRIVER) $(SRC_I386) -lm -lwinhttp -ladvapi32 -lole32 -loleaut32 -lwbemuuid -lpowrprof
|
||||
@echo "built $@"
|
||||
|
||||
# Add a native rule if one was not already made above.
|
||||
|
||||
Reference in New Issue
Block a user