Message ID | 20190514174621.12227-1-prarit@redhat.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Len Brown |
Headers | show |
Series | tools/power turbostat: Increase default buffer size | expand |
On 5/14/19 1:46 PM, Prarit Bhargava wrote: > '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. Self-Nak. I will post a dynamic allocation solution in a few minutes. P. > > Signed-off-by: Prarit Bhargava <prarit@redhat.com> > --- > tools/power/x86/turbostat/turbostat.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c > index c7727be9719f..b401d1aec394 100644 > --- a/tools/power/x86/turbostat/turbostat.c > +++ b/tools/power/x86/turbostat/turbostat.c > @@ -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"); >
diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c index c7727be9719f..b401d1aec394 100644 --- a/tools/power/x86/turbostat/turbostat.c +++ b/tools/power/x86/turbostat/turbostat.c @@ -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");
'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 <prarit@redhat.com> --- tools/power/x86/turbostat/turbostat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)