Blame SOURCES/oprofile-maskarray.patch

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