Repository navigation
Conversation
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In preparation for supporting non-Linux Unix targets (such as FreeBSD), this PR separates Linux-specific
/proc,/sys, andinotifydata collection from the platform-independent HUD, logging, and overlay logic.Summary of Changes
*_linux.cpp(and*_common.cppwhere shared state/helpers live) while keeping existing headers as the internal interface:gpu.cpp->gpu_linux.cpp(gpu_enumerate())amdgpu.cpp->amdgpu_linux.cpp(AMDGPU::platform_init(),get_instant_metrics(),get_sysfs_metrics())file_utils.cpp->file_utils_linux.cpp(get_exe_path(),get_proc_comm(),get_proc_cmdline(),is_wine_loader(),lib_loaded())cpu.cpp->cpu_common.cpp(sharedcalculateCPUData(), constructors,Reinit(),cpuStatsinstance)memory.cpp->memory_common.cpp(shared memory metric globals)iostats.cpp->iostats_linux.cpp(read_io_counters())net.cpp->net_linux.cpp(net_list_interfaces(),net_read_counters())notify.cpp->notify_linux.cpp(notify_open(),notify_watch(),notify_poll(),notify_close())overlay.cpp->system_info_linux.cpp(get_system_info())#ifdef __linux__with#ifndef _WIN32in common Unix code paths as suggested by FreeBSD support (part one: preparation) #652 (comment) (hud_elements.cpp,overlay.cpp,vulkan.cpp,shell.h,app/main.cpp, etc.), while keeping Linux-only synchronization primitives (esync/fsync/ntsyncinwinesync.h) restricted to__linux__(Note that FreeBSD's own implementation of ntsync is expected to arrive in 15.2 RELEASE, but I left it aside because this is about Linux.).src/meson.build): Add the new*_linux.cppand*_common.cpptranslation units tovklayer_fileson Unix targets.Purpose of this
This refactor is intended to preserve existing Linux behavior without regressions, however, I don't have a Linux install to validate it personally; in theory nothing should change functionally, but i'm open to any suggestions.