Search in sources :

Example 1 with UtGlobalDataPointer

use of com.ibm.j9ddr.vm29.pointer.generated.UtGlobalDataPointer in project openj9 by eclipse.

the class TraceConfigCommand method run.

public void run(String command, String[] args, Context context, final PrintStream out) throws DDRInteractiveCommandException {
    try {
        J9JavaVMPointer vm = J9RASHelper.getVM(DataType.getJ9RASPointer());
        // !RasGlobalStorage
        RasGlobalStoragePointer rasGlobal = RasGlobalStoragePointer.cast(vm.j9rasGlobalStorage());
        // !UtGlobalData
        UtGlobalDataPointer utGlobal = UtGlobalDataPointer.cast(rasGlobal.utGlobalData());
        // !UtComponentList componentList
        UtComponentListPointer componentList = utGlobal.componentList();
        // !UtComponentData head
        UtComponentDataPointer head = componentList.head();
        if (args.length == 0) {
            walkTraceComponents(new ModuleVisitor() {

                public void visit(UtModuleInfoPointer modInfo) throws CorruptDataException {
                    out.println(moduleName(modInfo));
                }
            }, head, context, out);
        } else if ("all".equals(args[0])) {
            walkTraceComponents(new ModuleVisitor() {

                public void visit(UtModuleInfoPointer modInfo) throws CorruptDataException {
                    printActiveTracePoints(modInfo, out);
                }
            }, head, context, out);
        } else {
            for (int i = 0; i < args.length; i++) {
                final String componentName = args[i];
                walkTraceComponents(new ModuleVisitor() {

                    public void visit(UtModuleInfoPointer modInfo) throws CorruptDataException {
                        if (componentName.equals(moduleName(modInfo))) {
                            printActiveTracePoints(modInfo, out);
                        }
                    }
                }, head, context, out);
            }
        }
    } catch (CorruptDataException e) {
        e.printStackTrace();
    }
}
Also used : UtModuleInfoPointer(com.ibm.j9ddr.vm29.pointer.generated.UtModuleInfoPointer) UtComponentListPointer(com.ibm.j9ddr.vm29.pointer.generated.UtComponentListPointer) UtGlobalDataPointer(com.ibm.j9ddr.vm29.pointer.generated.UtGlobalDataPointer) UtComponentDataPointer(com.ibm.j9ddr.vm29.pointer.generated.UtComponentDataPointer) J9JavaVMPointer(com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException) RasGlobalStoragePointer(com.ibm.j9ddr.vm29.pointer.generated.RasGlobalStoragePointer)

Aggregations

CorruptDataException (com.ibm.j9ddr.CorruptDataException)1 J9JavaVMPointer (com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer)1 RasGlobalStoragePointer (com.ibm.j9ddr.vm29.pointer.generated.RasGlobalStoragePointer)1 UtComponentDataPointer (com.ibm.j9ddr.vm29.pointer.generated.UtComponentDataPointer)1 UtComponentListPointer (com.ibm.j9ddr.vm29.pointer.generated.UtComponentListPointer)1 UtGlobalDataPointer (com.ibm.j9ddr.vm29.pointer.generated.UtGlobalDataPointer)1 UtModuleInfoPointer (com.ibm.j9ddr.vm29.pointer.generated.UtModuleInfoPointer)1