Skip to contentSkip to conversation

turbostat: Increase output buffer size to accommodate C8-C10

PATCH New Josh Triplett 1 participant 1 message Jun 13, 2013 Turbostat utility

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 turbostat: Increase output buffer size to accommodate C8-C10

On platforms with C8-C10 support, the additional C-states cause turbostat to overrun its output buffer of 128 bytes per CPU. Increase this to 256 bytes per CPU.

---
As a bugfix, this should go into 3.10; however, since the C8-C10 support didn't go in until after 3.9, this need not go into any stable kernel.

 tools/power/x86/turbostat/turbostat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/power/x86/turbostat/turbostat.c +1 -1
index 9e9d348..fe70207 100644
@@ -2191,7 +2191,7 @@ int initialize_counters(int cpu_id)
 
 void allocate_output_buffer()
 {
-	output_buffer = calloc(1, (1 + topo.num_cpus) * 128);
+	output_buffer = calloc(1, (1 + topo.num_cpus) * 256);
 	outp = output_buffer;
 	if (outp == NULL) {
 		perror("calloc");
Signature · 1 line
1.8.3.1