graphs: Fix rendering CPU graphs after number of cores decreased

Message ID 20200918074437.5237-1-michael.tremer@ipfire.org
State Accepted
Commit 6fc3625512aa4f06c15322cccbf1d763716e2ea1
Headers
Series graphs: Fix rendering CPU graphs after number of cores decreased |

Commit Message

Michael Tremer Sept. 18, 2020, 7:44 a.m. UTC
  Fixes: #12193 - cpu graphs cannot created if smt is disabled
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
---
 config/cfgroot/graphs.pl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Patch

diff --git a/config/cfgroot/graphs.pl b/config/cfgroot/graphs.pl
index a7b82fed3..f6e6e25a3 100644
--- a/config/cfgroot/graphs.pl
+++ b/config/cfgroot/graphs.pl
@@ -172,7 +172,7 @@  sub updatecpugraph {
 	}
 	
 	for(my $i = 2; $i < $cpucount; $i++) {
-		$addstring .= "+,";
+		$addstring .= "ADDNAN,";
 	}
 
 	if ( $cpucount > 1){
@@ -190,7 +190,7 @@  sub updatecpugraph {
 		push(@command,$nice,$interrupt,$steal,$user,$system,$idle,$iowait,$irq);
 	}
 
-	push(@command,"CDEF:total=user,system,idle,iowait,irq,nice,interrupt,steal,+,+,+,+,+,+,+"
+	push(@command,"CDEF:total=user,system,idle,iowait,irq,nice,interrupt,steal,ADDNAN,ADDNAN,ADDNAN,ADDNAN,ADDNAN,ADDNAN,ADDNAN"
 			,"CDEF:userpct=100,user,total,/,*"
 			,"CDEF:nicepct=100,nice,total,/,*"
 			,"CDEF:interruptpct=100,interrupt,total,/,*"