66#include "modules/cpu/cpu.h"
77#include "util/stringUtils.h"
88
9- #define FF_CPU_NUM_FORMAT_ARGS 11
9+ #define FF_CPU_NUM_FORMAT_ARGS 10
1010
1111static int sortCores (const FFCPUCore * a , const FFCPUCore * b )
1212{
@@ -17,13 +17,13 @@ void ffPrintCPU(FFCPUOptions* options)
1717{
1818 FFCPUResult cpu = {
1919 .temperature = FF_CPU_TEMP_UNSET ,
20- .frequencyMin = 0.0 / 0.0 ,
21- .frequencyMax = 0.0 / 0.0 ,
22- .frequencyBase = 0.0 / 0.0 ,
23- .frequencyBiosLimit = 0.0 / 0.0 ,
20+ .frequencyMin = 0.0 / 0.0 ,
21+ .frequencyMax = 0.0 / 0.0 ,
22+ .frequencyBase = 0.0 / 0.0 ,
23+ .frequencyBiosLimit = 0.0 / 0.0 ,
2424 .name = ffStrbufCreate (),
2525 .vendor = ffStrbufCreate (),
26- . coresUtilizationRate = FF_CPU_UTILIZATION_RATE_UNSET };
26+ };
2727
2828 const char * error = ffDetectCPU (options , & cpu );
2929
@@ -86,12 +86,6 @@ void ffPrintCPU(FFCPUOptions* options)
8686 ffTempsAppendNum (cpu .temperature , & str , options -> tempConfig , & options -> moduleArgs );
8787 }
8888
89- if (cpu .coresUtilizationRate != FF_CPU_UTILIZATION_RATE_UNSET )
90- {
91- ffStrbufAppendS (& str , " - " );
92- ffPercentAppendNum (& str , cpu .coresUtilizationRate , options -> percent , true, & options -> moduleArgs );
93- }
94-
9589 ffStrbufPutTo (& str , stdout );
9690 }
9791 else
@@ -113,18 +107,17 @@ void ffPrintCPU(FFCPUOptions* options)
113107 FF_STRBUF_AUTO_DESTROY tempStr = ffStrbufCreate ();
114108 ffTempsAppendNum (cpu .temperature , & tempStr , options -> tempConfig , & options -> moduleArgs );
115109 FF_PRINT_FORMAT_CHECKED (FF_CPU_MODULE_NAME , 0 , & options -> moduleArgs , FF_PRINT_TYPE_DEFAULT , FF_CPU_NUM_FORMAT_ARGS , ((FFformatarg []){
116- {FF_FORMAT_ARG_TYPE_STRBUF , & cpu .name , "name" },
117- {FF_FORMAT_ARG_TYPE_STRBUF , & cpu .vendor , "vendor" },
118- {FF_FORMAT_ARG_TYPE_UINT16 , & cpu .coresPhysical , "cores-physical" },
119- {FF_FORMAT_ARG_TYPE_UINT16 , & cpu .coresLogical , "cores-logical" },
120- {FF_FORMAT_ARG_TYPE_UINT16 , & cpu .coresOnline , "cores-online" },
121- {FF_FORMAT_ARG_TYPE_DOUBLE , & cpu .coresUtilizationRate , "cores-utilization-rate" },
122- {FF_FORMAT_ARG_TYPE_STRING , freqBase , "freq-base" },
123- {FF_FORMAT_ARG_TYPE_STRING , freqMax , "freq-max" },
124- {FF_FORMAT_ARG_TYPE_STRBUF , & tempStr , "temperature" },
125- {FF_FORMAT_ARG_TYPE_STRBUF , & coreTypes , "core-types" },
126- {FF_FORMAT_ARG_TYPE_STRING , freqBioslimit , "freq-bios-limit" },
127- }));
110+ {FF_FORMAT_ARG_TYPE_STRBUF , & cpu .name , "name" },
111+ {FF_FORMAT_ARG_TYPE_STRBUF , & cpu .vendor , "vendor" },
112+ {FF_FORMAT_ARG_TYPE_UINT16 , & cpu .coresPhysical , "cores-physical" },
113+ {FF_FORMAT_ARG_TYPE_UINT16 , & cpu .coresLogical , "cores-logical" },
114+ {FF_FORMAT_ARG_TYPE_UINT16 , & cpu .coresOnline , "cores-online" },
115+ {FF_FORMAT_ARG_TYPE_STRING , freqBase , "freq-base" },
116+ {FF_FORMAT_ARG_TYPE_STRING , freqMax , "freq-max" },
117+ {FF_FORMAT_ARG_TYPE_STRBUF , & tempStr , "temperature" },
118+ {FF_FORMAT_ARG_TYPE_STRBUF , & coreTypes , "core-types" },
119+ {FF_FORMAT_ARG_TYPE_STRING , freqBioslimit , "freq-bios-limit" },
120+ }));
128121 }
129122 }
130123
@@ -237,7 +230,6 @@ void ffGenerateCPUJsonResult(FFCPUOptions* options, yyjson_mut_doc* doc, yyjson_
237230 yyjson_mut_obj_add_uint (doc , cores , "physical" , cpu .coresPhysical );
238231 yyjson_mut_obj_add_uint (doc , cores , "logical" , cpu .coresLogical );
239232 yyjson_mut_obj_add_uint (doc , cores , "online" , cpu .coresOnline );
240- yyjson_mut_obj_add_real (doc , cores , "utilizationRate" , cpu .coresUtilizationRate );
241233
242234 yyjson_mut_val * frequency = yyjson_mut_obj_add_obj (doc , obj , "frequency" );
243235 yyjson_mut_obj_add_real (doc , frequency , "base" , cpu .frequencyBase );
@@ -262,19 +254,18 @@ void ffGenerateCPUJsonResult(FFCPUOptions* options, yyjson_mut_doc* doc, yyjson_
262254
263255void ffPrintCPUHelpFormat (void )
264256{
265- FF_PRINT_MODULE_FORMAT_HELP_CHECKED (FF_CPU_MODULE_NAME , "{1} ({5}) @ {7} GHz" , FF_CPU_NUM_FORMAT_ARGS , ((const char * []){
266- "Name - name" ,
267- "Vendor - vendor" ,
268- "Physical core count - cores-physical" ,
269- "Logical core count - cores-logical" ,
270- "Online core count - cores-online" ,
271- "Utilization rate - cores-utilization-rate" ,
272- "Base frequency - freq-base" ,
273- "Max frequency - freq-max" ,
274- "Temperature (formatted) - temperature" ,
275- "Logical core count grouped by frequency - core-types" ,
276- "Bios limited frequency - freq-bios-limit" ,
277- }));
257+ FF_PRINT_MODULE_FORMAT_HELP_CHECKED (FF_CPU_MODULE_NAME , "{1} ({5}) @ {7} GHz" , FF_CPU_NUM_FORMAT_ARGS , ((const char * []) {
258+ "Name - name" ,
259+ "Vendor - vendor" ,
260+ "Physical core count - cores-physical" ,
261+ "Logical core count - cores-logical" ,
262+ "Online core count - cores-online" ,
263+ "Base frequency - freq-base" ,
264+ "Max frequency - freq-max" ,
265+ "Temperature (formatted) - temperature" ,
266+ "Logical core count grouped by frequency - core-types" ,
267+ "Bios limited frequency - freq-bios-limit" ,
268+ }));
278269}
279270
280271void ffInitCPUOptions (FFCPUOptions * options )
0 commit comments