[Title] Fixed bug TDIS-4049 "Profile As"->"Profile Configurations" pops up a error...
authorYangang,Han <yangangx.han@intel.com>
Thu, 7 Mar 2013 10:07:11 +0000 (18:07 +0800)
committerYangang,Han <yangangx.han@intel.com>
Thu, 7 Mar 2013 10:07:11 +0000 (18:07 +0800)
[Desc.]
[Issue]

Signed-off-by: Yangang,Han <yangangx.han@intel.com>
org.eclipse.linuxtools.oprofile.core/src/org/tizen/oprofile/core/processor/eventinfo/EventListProcessor.java

index 4e3c5ee..ab6f163 100644 (file)
@@ -48,7 +48,11 @@ public class EventListProcessor {
 
        private static final String COMMAND_EVENT_LIST = OprofileCommonConstants.COMMAND_OPCONTROL
                        + " -l 2> /dev/null";
-       private static final String EVENT_PATTERN = "^[A-Z1-9]+.*\\(counter: \\d+.*\\)$";
+       //Add by yangang.han(yangangx.han@intel.com) 2013.03.06 to fix the bug TDIS-4049.
+       //In IA device the event pattern like "CPU_CLK_UNHALTED: (counter: all)" and in ARM device it like "ISS_NO_DISP1: (counter: 1, 2, 3, 4, 5, 6)"
+       //So change this RegExp to match this two type.
+       //private static final String EVENT_PATTERN = "^[A-Z1-9]+.*\\(counter: \\d+.*\\)$";
+       private static final String EVENT_PATTERN = "^[A-Z1-9]+.*\\(counter: (\\d|all)+.*\\)$";
        //private static final String EVENT_DETAIL_PATTERN = "^\\s+.*\\(min count: \\d+\\).*";
        private static final String EVENT_DETAIL_PATTERN = ".*\\(min count: \\d+\\).*";
        private static final String UNIT_MASK_PATTERN = "Unit masks \\(default: 0x..\\)$";
@@ -56,7 +60,6 @@ public class EventListProcessor {
 
        public void parse() throws InterruptedException {
                String resultStr = null;
-
                resultStr = CommandManager.runCommandReturningResult(COMMAND_EVENT_LIST);                       
 
                if (resultStr == null || resultStr.trim().length() == 0)
@@ -93,12 +96,21 @@ public class EventListProcessor {
 
                                isDummy = false;
                        } else if (str.matches(EVENT_DETAIL_PATTERN)) {
+                               if (null == event) {
+                                   event = new OpEvent();//add by yangang.han
+                               }
                                setOpEventDescription(event, str);
                                setOpEventMinCount(event, str);
                        } else if (str.matches(UNIT_MASK_PATTERN)) {
+                               if (null == unitMask) {
+                                   unitMask = new OpUnitMask();//add by yangang.han
+                               }
                                setOpUnitMaskDefault(unitMask, str);
                                maskList = new ArrayList<MaskInfo>();
                        } else if (str.matches(MASK_INFO_PATTERN)) {
+                               if (null == maskList) {
+                                   maskList = new ArrayList<MaskInfo>();//add by yangang.han
+                               }
                                addMaskInfo(maskList, str);
                        } else {
                                isContinued = true;