Blame SOURCES/oprofile-power9_recog.patch

c532ac
commit c474cd3ddfcb2fe68f38745675f4c4d9ef79dfc5
c532ac
Author: Carl Love <cel@us.ibm.com>
c532ac
Date:   Tue Mar 27 13:07:37 2018 -0700
c532ac
c532ac
    PowerPC: Remove trailing comma in cpu_name.
c532ac
    
c532ac
    Will:
c532ac
    
c532ac
    I redid the patch as follows per your suggestions.  I was able to get
c532ac
    on to a system where the issue occurs and test the patch.  The patch
c532ac
    seems to work fine.
c532ac
    
c532ac
                       Carl Love
c532ac
    
c532ac
    -----------------------------------------------------------------------
c532ac
    
c532ac
    The processor type for some Power 9 systems had a comma after POWER9.
c532ac
    Remove the comma before returning the string for the CPU.
c532ac
c532ac
diff --git a/libop/op_cpu_type.c b/libop/op_cpu_type.c
c532ac
index feea9487..d2babd18 100644
c532ac
--- a/libop/op_cpu_type.c
c532ac
+++ b/libop/op_cpu_type.c
c532ac
@@ -154,17 +154,17 @@ static char * _get_cpuinfo_cpu_type_line(char * buf, int len, const char * prefi
c532ac
 			/* if token param 0 then read the whole line else
c532ac
 			 * first token only. */
c532ac
 			if (token == 0) {
c532ac
-				/* Trim trailing whitespace */
c532ac
+				/* Trim trailing whitespace and commas */
c532ac
 				end = buf + strlen(buf) - 1;
c532ac
-				while (isspace(*end))
c532ac
+				while (isspace(*end) || *end == ',')
c532ac
 					--end;
c532ac
 				*(++end) = '\0';
c532ac
 				break;
c532ac
 			} else {
c532ac
 				/* Scan ahead to the end of the token */
c532ac
-				while (*buf && !isspace(*buf))
c532ac
+				while (*buf && !(isspace(*buf) || *buf == ','))
c532ac
 					++buf;
c532ac
-				/* Trim trailing whitespace */
c532ac
+				/* Trim trailing whitespace and commas */
c532ac
 				*buf = '\0';
c532ac
 				break;
c532ac
 			}