Blame SOURCES/oprofile-maskarray.patch

e284e3
commit ef501aa609f49c06df9f33c9a7330dffd71b31b3
e284e3
Author: Maynard Johnson <maynardj@us.ibm.com>
e284e3
Date:   Thu Oct 31 11:11:06 2013 -0500
e284e3
e284e3
    Fix handling of default named unit masks longer than 11 chars
e284e3
    
e284e3
    The handling of default unit masks that are names instead of hex
e284e3
    values is new with oprofile 0.9.9. I've discovered a bug in this
e284e3
    handling when the name exceeds 11 characters. For example, on
e284e3
    Sandybridge, the following ocount command fails:
e284e3
    
e284e3
    [mpjohn@oc1757000783 test-stuff]$ ocount -e l1d_blocks ls
e284e3
    Cannot find unit mask bank_confli for l1d_blocks
e284e3
    Unable to find unit mask info for bank_confli for event l1d_blocks
e284e3
    
e284e3
    This problem was due to the char array ('mask') being too small.
e284e3
    
e284e3
    Signed-off-by: Maynard Johnson <maynardj@us.ibm.com>
e284e3
e284e3
diff --git a/libpe_utils/op_pe_utils.cpp b/libpe_utils/op_pe_utils.cpp
e284e3
index 177835e..9e2addb 100644
e284e3
--- a/libpe_utils/op_pe_utils.cpp
e284e3
+++ b/libpe_utils/op_pe_utils.cpp
e284e3
@@ -413,8 +413,8 @@ static void _get_event_code(operf_event_t * event, op_cpu cpu_type)
e284e3
 
e284e3
 
e284e3
 #if defined(__i386__) || defined(__x86_64__)
e284e3
+	char mask[OP_MAX_UM_NAME_LEN];
e284e3
 	// Setup EventSelct[11:8] field for AMD
e284e3
-	char mask[12];
e284e3
 	const char * vendor_AMD = "AuthenticAMD";
e284e3
 	if (op_is_cpu_vendor((char *)vendor_AMD)) {
e284e3
 		config = base_code & 0xF00ULL;