Search in sources :

Example 1 with IImageProcessBuilder

use of com.ibm.dtfj.javacore.builder.IImageProcessBuilder in project openj9 by eclipse.

the class ParserController method generateImageBuilder.

/**
 * @throws BuilderFailureException
 */
private IImageBuilder generateImageBuilder() throws BuilderFailureException {
    IImageBuilder imageBuilder = fImageBuilderFactory.generateImageBuilder(DEFAULT_IMAGE_BUILDER);
    IImageAddressSpaceBuilder addressSpace = imageBuilder.generateAddressSpaceBuilder(DEFAULT_IMAGE_ADDRESS_SPACE_BUILDER);
    IImageProcessBuilder processBuilder = addressSpace.generateImageProcessBuilder(DEFAULT_IMAGE_PROCESS_BUILDER);
    processBuilder.generateJavaRuntimeBuilder(DEFAULT_JAVA_RUNTIME_BUILDER);
    return imageBuilder;
}
Also used : IImageAddressSpaceBuilder(com.ibm.dtfj.javacore.builder.IImageAddressSpaceBuilder) IImageProcessBuilder(com.ibm.dtfj.javacore.builder.IImageProcessBuilder) IImageBuilder(com.ibm.dtfj.javacore.builder.IImageBuilder)

Example 2 with IImageProcessBuilder

use of com.ibm.dtfj.javacore.builder.IImageProcessBuilder in project openj9 by eclipse.

the class NativeMemorySectionParser method topLevelRule.

protected void topLevelRule() throws ParserException {
    IImageProcessBuilder fImageProcessBuilder = fImageBuilder.getCurrentAddressSpaceBuilder().getCurrentImageProcessBuilder();
    IJavaRuntimeBuilder fRuntimeBuilder = fImageProcessBuilder.getCurrentJavaRuntimeBuilder();
    IAttributeValueMap results = null;
    Stack categoryStack = new Stack();
    processTagLineOptional(T_0MEMUSER);
    while ((results = processMemUserLine()) != null) {
        String name = results.getTokenValue(A_NAME);
        /* If no name available, this is a spacing line */
        if (name == null) {
            continue;
        }
        int depth = results.getIntValue(A_DEPTH);
        while (categoryStack.size() >= depth) {
            categoryStack.pop();
        }
        long deepBytes = parseCommaDelimitedLong(results.getTokenValue(A_DEEP_BYTES));
        long deepAllocations = parseCommaDelimitedLong(results.getTokenValue(A_DEEP_ALLOCATIONS));
        JavaRuntimeMemoryCategory parent = null;
        if (categoryStack.size() > 0) {
            parent = (JavaRuntimeMemoryCategory) categoryStack.peek();
        }
        if (name.equals(OTHER_CATEGORY)) {
            if (parent == null) {
                throw new ParserException("Parse error: Unexpected NULL parent category for \"Other\" memory category");
            }
            fRuntimeBuilder.setShallowCountersForCategory(parent, deepBytes, deepAllocations);
        } else {
            JavaRuntimeMemoryCategory category = fRuntimeBuilder.addMemoryCategory(name, deepBytes, deepAllocations, parent);
            categoryStack.push(category);
        }
    }
}
Also used : ParserException(com.ibm.dtfj.javacore.parser.framework.parser.ParserException) IAttributeValueMap(com.ibm.dtfj.javacore.parser.j9.IAttributeValueMap) JavaRuntimeMemoryCategory(com.ibm.dtfj.java.JavaRuntimeMemoryCategory) IJavaRuntimeBuilder(com.ibm.dtfj.javacore.builder.IJavaRuntimeBuilder) IImageProcessBuilder(com.ibm.dtfj.javacore.builder.IImageProcessBuilder) Stack(java.util.Stack)

Aggregations

IImageProcessBuilder (com.ibm.dtfj.javacore.builder.IImageProcessBuilder)2 JavaRuntimeMemoryCategory (com.ibm.dtfj.java.JavaRuntimeMemoryCategory)1 IImageAddressSpaceBuilder (com.ibm.dtfj.javacore.builder.IImageAddressSpaceBuilder)1 IImageBuilder (com.ibm.dtfj.javacore.builder.IImageBuilder)1 IJavaRuntimeBuilder (com.ibm.dtfj.javacore.builder.IJavaRuntimeBuilder)1 ParserException (com.ibm.dtfj.javacore.parser.framework.parser.ParserException)1 IAttributeValueMap (com.ibm.dtfj.javacore.parser.j9.IAttributeValueMap)1 Stack (java.util.Stack)1