Search in sources :

Example 31 with ILineRule

use of com.ibm.dtfj.javacore.parser.framework.tag.ILineRule in project openj9 by eclipse.

the class MonitorTagParser method addWaiter.

/**
 */
private void addWaiter() {
    ILineRule lineRule = new MonitorObjectLineRule() {

        public void processLine(String source, int startingOffset) {
            addVMThreadInformation();
        }
    };
    addTag(T_3LKWAITER, lineRule);
}
Also used : ILineRule(com.ibm.dtfj.javacore.parser.framework.tag.ILineRule)

Example 32 with ILineRule

use of com.ibm.dtfj.javacore.parser.framework.tag.ILineRule in project openj9 by eclipse.

the class PlatformTagParser method addHostName.

/**
 * Add rules for the host name
 * 2XHHOSTNAME    Host             : myhost:9.20.2.67
 */
private void addHostName() {
    ILineRule lineRule = new LineRule() {

        public void processLine(String source, int startingOffset) {
            consumeUntilFirstMatch(CommonPatternMatchers.colon);
            consumeUntilFirstMatch(CommonPatternMatchers.whitespace);
            addAllCharactersAsTokenAndConsumeFirstMatch(PL_HOST_NAME, CommonPatternMatchers.colon);
            addToken(PL_HOST_ADDR, CommonPatternMatchers.allButLineFeed);
        }
    };
    addTag(T_2XHHOSTNAME, lineRule);
}
Also used : LineRule(com.ibm.dtfj.javacore.parser.framework.tag.LineRule) ILineRule(com.ibm.dtfj.javacore.parser.framework.tag.ILineRule) ILineRule(com.ibm.dtfj.javacore.parser.framework.tag.ILineRule)

Example 33 with ILineRule

use of com.ibm.dtfj.javacore.parser.framework.tag.ILineRule in project openj9 by eclipse.

the class PlatformTagParser method addOSLevel.

/**
 * Add rules for the OS level information (2XHOSLEVEL line)
 */
private void addOSLevel() {
    ILineRule lineRule = new LineRule() {

        public void processLine(String source, int startingOffset) {
            // here we get the OS name, which in javacore is concatenated with
            // the OS level, so we have to pull out the specific OS names
            consumeUntilFirstMatch(CommonPatternMatchers.colon);
            if (findFirst(PlatformPatternMatchers.Windows_XP)) {
                addToken(PL_OS_NAME, PlatformPatternMatchers.Windows_XP);
            } else if (findFirst(PlatformPatternMatchers.Windows_Server_2003)) {
                addToken(PL_OS_NAME, PlatformPatternMatchers.Windows_Server_2003);
            } else if (findFirst(PlatformPatternMatchers.Windows_Server_2008)) {
                addToken(PL_OS_NAME, PlatformPatternMatchers.Windows_Server_2008);
            } else if (findFirst(PlatformPatternMatchers.Windows_2000)) {
                addToken(PL_OS_NAME, PlatformPatternMatchers.Windows_2000);
            } else if (findFirst(PlatformPatternMatchers.Windows_Vista)) {
                addToken(PL_OS_NAME, PlatformPatternMatchers.Windows_Vista);
            } else if (findFirst(PlatformPatternMatchers.Windows_7)) {
                addToken(PL_OS_NAME, PlatformPatternMatchers.Windows_7);
            } else if (findFirst(PlatformPatternMatchers.Windows_8)) {
                addToken(PL_OS_NAME, PlatformPatternMatchers.Windows_8);
            } else if (findFirst(PlatformPatternMatchers.Windows_Server_8)) {
                addToken(PL_OS_NAME, PlatformPatternMatchers.Windows_Server_8);
            } else if (findFirst(PlatformPatternMatchers.Windows_Server_2012)) {
                addToken(PL_OS_NAME, PlatformPatternMatchers.Windows_Server_2012);
            } else if (findFirst(PlatformPatternMatchers.Windows_Generic)) {
                addToken(PL_OS_NAME, PlatformPatternMatchers.Windows_Generic);
            } else if (findFirst(PlatformPatternMatchers.Linux)) {
                addToken(PL_OS_NAME, PlatformPatternMatchers.Linux);
            } else if (findFirst(PlatformPatternMatchers.AIX)) {
                addToken(PL_OS_NAME, PlatformPatternMatchers.AIX);
            } else if (findFirst(PlatformPatternMatchers.z_OS)) {
                addToken(PL_OS_NAME, PlatformPatternMatchers.z_OS);
            }
            // if we did not find a recognised OS name the token is not
            // set and will show DataUnavailable through the DTFJ API
            consumeUntilFirstMatch(CommonPatternMatchers.whitespace);
            // grab the remainder of the line as the OS version
            addToken(PL_OS_VERSION, CommonPatternMatchers.allButLineFeed);
        }
    };
    addTag(T_2XHOSLEVEL, lineRule);
}
Also used : LineRule(com.ibm.dtfj.javacore.parser.framework.tag.LineRule) ILineRule(com.ibm.dtfj.javacore.parser.framework.tag.ILineRule) ILineRule(com.ibm.dtfj.javacore.parser.framework.tag.ILineRule)

Example 34 with ILineRule

use of com.ibm.dtfj.javacore.parser.framework.tag.ILineRule in project openj9 by eclipse.

the class PlatformTagParser method addCPUCount.

/**
 * Add rule for the number of CPUs information (3XHNUMCPUS line)
 */
private void addCPUCount() {
    ILineRule lineRule = new LineRule() {

        public void processLine(String source, int startingOffset) {
            // the CPU count is a decimal number following a colon
            consumeUntilFirstMatch(CommonPatternMatchers.colon);
            addToken(PL_CPU_COUNT, CommonPatternMatchers.dec);
        }
    };
    addTag(T_3XHNUMCPUS, lineRule);
    addTag(T_3XHNUMASUP, null);
}
Also used : LineRule(com.ibm.dtfj.javacore.parser.framework.tag.LineRule) ILineRule(com.ibm.dtfj.javacore.parser.framework.tag.ILineRule) ILineRule(com.ibm.dtfj.javacore.parser.framework.tag.ILineRule)

Example 35 with ILineRule

use of com.ibm.dtfj.javacore.parser.framework.tag.ILineRule in project openj9 by eclipse.

the class MonitorTagParser method initTagAttributeRules.

protected void initTagAttributeRules() {
    addTag(T_1LKPOOLINFO, null);
    addPoolTotal();
    addTag(T_1LKMONPOOLDUMP, null);
    addMonInUse();
    addMonObject();
    addTag(T_3LKWAITERQ, null);
    addWaiter();
    addTag(T_3LKNOTIFYQ, null);
    addWaitNotify();
    addTag(T_1LKREGMONDUMP, null);
    addRegMon();
    // Deadlock support skipped for now.
    // addTag(T_1LKDEADLOCK, null);
    // addDeadLockThr();
    // addTag(T_3LKDEADLOCKWTR, null);
    // addDeadLockMon();
    // addDeadLockObj();
    // addDeadLockReg();
    // addTag(T_3LKDEADLOCKOWN, null);
    ILineRule lineRule = new LineRule() {

        public void processLine(String source, int startingOffset) {
            // Thread identifiers (as used in flat monitors):
            addToken(IMonitorTypes.MONITOR_SECTION, CommonPatternMatchers.allButLineFeed);
        }
    };
    addTag(IMonitorTypesSov.LK_FLAT_MON_DUMP, lineRule);
    ILineRule lineRule2 = new LineRule() {

        public void processLine(String source, int startingOffset) {
            // ident 0x05 "Finalizer" (0x14B09E0) ee 0x014B0800
            addPrefixedHexToken(IMonitorTypesSov.MONITOR_FLAT_ID);
            addToken(MONITOR_THREAD_NAME, CommonPatternMatchers.quoted_stringvalue);
            addPrefixedHexToken(MONITOR_THREAD_ID);
            addPrefixedHexToken(IMonitorTypesSov.MONITOR_THREAD_EE);
        }
    };
    addTag(IMonitorTypesSov.LK_FLAT_MON, lineRule2);
    addTag(IMonitorTypesSov.LK_OBJ_MON_DUMP, null);
    ILineRule lineRule3 = new MonitorObjectLineRule() {

        public void processLine(String source, int startingOffset) {
            // java.lang.String@C1FF58/C1FF60
            addMonitorObjectNameAndAddress();
        }
    };
    addTag(IMonitorTypesSov.LK_INFLATED_MON, lineRule3);
    addTag(IMonitorTypesSov.LK_INFL_DETAILS, null);
    addTag(IMonitorTypesSov.LK_FLAT_LOCKED, lineRule3);
    ILineRule lineRule4 = new LineRule() {

        public void processLine(String source, int startingOffset) {
            // locknflags 00050000 Flat locked by thread ident 0x05, entry count 1
            addPrefixedHexToken(IMonitorTypesSov.MONITOR_FLAT_ID);
        }
    };
    addTag(IMonitorTypesSov.LK_FLAT_DETAILS, lineRule4);
}
Also used : LineRule(com.ibm.dtfj.javacore.parser.framework.tag.LineRule) ILineRule(com.ibm.dtfj.javacore.parser.framework.tag.ILineRule) ILineRule(com.ibm.dtfj.javacore.parser.framework.tag.ILineRule)

Aggregations

ILineRule (com.ibm.dtfj.javacore.parser.framework.tag.ILineRule)46 LineRule (com.ibm.dtfj.javacore.parser.framework.tag.LineRule)31 PointerSizeLineRule (com.ibm.dtfj.javacore.parser.j9.section.common.PointerSizeLineRule)6 IParserToken (com.ibm.dtfj.javacore.parser.framework.scanner.IParserToken)1 Matcher (java.util.regex.Matcher)1