logging: include process RSS

Resident set size shows non-swapped memory usage of a process. This is
useful to have for comparing memory usage over time for the the process
being measured.
pull/1121/head
Clayton Craft 7 months ago committed by flightlessmango
parent 675202713d
commit 22d2de4edd

@ -125,7 +125,7 @@ static void writeFileHeaders(ofstream& out){
if (HUDElements.params->enabled[OVERLAY_PARAM_ENABLED_log_versioning])
out << "--------------------FRAME METRICS--------------------" << endl;
out << "fps," << "frametime," << "cpu_load," << "gpu_load," << "cpu_temp," << "gpu_temp," << "gpu_core_clock," << "gpu_mem_clock," << "gpu_vram_used," << "gpu_power," << "ram_used," << "swap_used," << "elapsed" << endl;
out << "fps," << "frametime," << "cpu_load," << "gpu_load," << "cpu_temp," << "gpu_temp," << "gpu_core_clock," << "gpu_mem_clock," << "gpu_vram_used," << "gpu_power," << "ram_used," << "swap_used," << "process_rss," << "elapsed" << endl;
}
@ -149,6 +149,7 @@ void Logger::writeToFile(){
output_file << logArray.back().gpu_power << ",";
output_file << logArray.back().ram_used << ",";
output_file << logArray.back().swap_used << ",";
output_file << logArray.back().process_rss << ",";
output_file << std::chrono::duration_cast<std::chrono::nanoseconds>(logArray.back().previous).count() << "\n";
output_file.flush();
} else {

@ -26,6 +26,7 @@ struct logData{
float gpu_vram_used;
float ram_used;
float swap_used;
float process_rss;
Clock::duration previous;
};

@ -5,7 +5,7 @@
#include <stdio.h>
#include <thread>
extern float memused, memmax, swapused, swapmax;
extern float memused, memmax, swapused, swapmax, rss;
struct memory_information {
/* memory information in kilobytes */

@ -159,6 +159,7 @@ void update_hw_info(const struct overlay_params& params, uint32_t vendorID)
#ifdef __linux__
currentLogData.ram_used = memused;
currentLogData.swap_used = swapused;
currentLogData.process_rss = proc_mem.resident / float((2 << 29)); // GiB, consistent w/ other mem stats
#endif
currentLogData.cpu_load = cpuStats.GetCPUDataTotal().percent;

Loading…
Cancel
Save