tools/power turbostat: Increase default buffer size
PATCH 1/1 tools/power turbostat: Increase default buffer size
'turbostat -D' fails on INTEL_FAM6_KABYLAKE_DESKTOP systems with a segfault because the default buffer size is too small.
Increase the default to 1536.
Signed-off-by Prarit Bhargava <[email protected]>
--- tools/power/x86/turbostat/turbostat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/power/x86/turbostat/turbostat.c +1 -1
@@ -5135,7 +5135,7 @@ int initialize_counters(int cpu_id)void allocate_output_buffer () { - output_buffer =calloc (1 , (1 + topo.num_cpus) *1024 ); + output_buffer =calloc (1 , (1 + topo.num_cpus) *1536 ); outp = output_buffer;if (outp ==NULL )err (-1 ,"calloc output buffer" );
Signature · 1 line
2.21.0
Quoted 4 lines · Prarit Bhargava
'turbostat -D' fails on
INTEL_FAM6_KABYLAKE_DESKTOPsystems with a segfault because the default buffer size is too small.Increase the default to 1536.
Self-Nak. I will post a dynamic allocation solution in a few minutes.
P.
Quoted 20 lines
Signed-off-by Prarit Bhargava <[email protected]>--- tools/power/x86/turbostat/turbostat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/power/x86/turbostat/turbostat.c +1
-1@@ -5135,7 +5135,7 @@ int initialize_counters(int cpu_id)void allocate_output_buffer () { - output_buffer =calloc (1 , (1 + topo.num_cpus) *1024 ); + output_buffer =calloc (1 , (1 + topo.num_cpus) *1536 ); outp = output_buffer;if (outp ==NULL )err (-1 ,"calloc output buffer" );