Blame SOURCES/oprofile-power9.patch

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