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..\\)$";
public void parse() throws InterruptedException {
String resultStr = null;
-
resultStr = CommandManager.runCommandReturningResult(COMMAND_EVENT_LIST);
if (resultStr == null || resultStr.trim().length() == 0)
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;