Search in sources :

Example 11 with J9JavaVMPointer

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

the class ACCommand method dumpACForObject.

public void dumpACForObject(J9JavaVMPointer vm, StructurePointer objectPointer, PrintStream out) throws CorruptDataException {
    if (GCExtensions.isVLHGC()) {
        if ((null != objectPointer) && !objectPointer.isNull()) {
            /* get the object's region */
            GCHeapRegionDescriptor region = heapRegionManager.regionDescriptorForAddress(objectPointer);
            if (null != region) {
                MM_HeapRegionDescriptorVLHGCPointer vlhgcRegionPointer = MM_HeapRegionDescriptorVLHGCPointer.cast(region.getHeapRegionDescriptorPointer());
                /* get the region's owning allocation context */
                StructurePointer act = vlhgcRegionPointer._allocateData()._owningContext().getAsRuntimeType();
                out.println("Object's owning context: " + act.formatShortInteractive());
            }
        }
    }
}
Also used : GCHeapRegionDescriptor(com.ibm.j9ddr.vm29.j9.gc.GCHeapRegionDescriptor) StructurePointer(com.ibm.j9ddr.vm29.pointer.StructurePointer) MM_HeapRegionDescriptorVLHGCPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_HeapRegionDescriptorVLHGCPointer)

Example 12 with J9JavaVMPointer

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

the class ThreadsCommand method search.

private void search(PrintStream out, UDATA tid) throws DDRInteractiveCommandException {
    try {
        J9JavaVMPointer vm = J9RASHelper.getVM(DataType.getJ9RASPointer());
        J9VMThreadPointer mainThread = vm.mainThread();
        if (mainThread.notNull()) {
            J9VMThreadPointer threadCursor = vm.mainThread();
            do {
                if (threadCursor.osThread().tid().eq(tid)) {
                    out.println(String.format("\t!stack 0x%08x\t!j9vmthread 0x%08x\t!j9thread 0x%08x\ttid 0x%x (%d) // %s", threadCursor.getAddress(), threadCursor.getAddress(), threadCursor.osThread().getAddress(), threadCursor.osThread().tid().longValue(), threadCursor.osThread().tid().longValue(), getThreadName(threadCursor)));
                    break;
                }
                threadCursor = threadCursor.linkNext();
            } while (!threadCursor.eq(mainThread));
        }
    } catch (CorruptDataException e) {
        throw new DDRInteractiveCommandException(e);
    }
}
Also used : J9VMThreadPointer(com.ibm.j9ddr.vm29.pointer.generated.J9VMThreadPointer) DDRInteractiveCommandException(com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException) J9JavaVMPointer(com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException)

Example 13 with J9JavaVMPointer

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

the class ThreadsCommand method flags.

private void flags(PrintStream out) throws DDRInteractiveCommandException {
    try {
        J9JavaVMPointer vm = J9RASHelper.getVM(DataType.getJ9RASPointer());
        J9VMThreadPointer mainThread = vm.mainThread();
        if (mainThread.notNull()) {
            J9VMThreadPointer threadCursor = vm.mainThread();
            do {
                out.append(String.format("    !j9vmthread 0x%s publicFlags=%s privateFlags=%s // %s", Long.toHexString(threadCursor.getAddress()), Long.toHexString(threadCursor.publicFlags().longValue()), Long.toHexString(threadCursor.privateFlags().longValue()), getThreadName(threadCursor)));
                out.append(nl);
                threadCursor = threadCursor.linkNext();
            } while (!threadCursor.eq(mainThread));
        }
    } catch (CorruptDataException e) {
        throw new DDRInteractiveCommandException(e);
    }
}
Also used : J9VMThreadPointer(com.ibm.j9ddr.vm29.pointer.generated.J9VMThreadPointer) DDRInteractiveCommandException(com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException) J9JavaVMPointer(com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException)

Example 14 with J9JavaVMPointer

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

the class ThreadsCommand method trace.

private void trace(PrintStream out) throws DDRInteractiveCommandException {
    try {
        J9JavaVMPointer vm = J9RASHelper.getVM(DataType.getJ9RASPointer());
        J9VMThreadPointer mainThread = vm.mainThread();
        if (mainThread.notNull()) {
            J9VMThreadPointer threadCursor = vm.mainThread();
            do {
                out.append(String.format("    !stack 0x%s  !j9vmthread 0x%s  !j9thread 0x%s  tid 0x%s (%d) !utthreaddata 0x%s // %s", Long.toHexString(threadCursor.getAddress()), Long.toHexString(threadCursor.getAddress()), Long.toHexString(threadCursor.osThread().getAddress()), Long.toHexString(threadCursor.osThread().tid().longValue()), threadCursor.osThread().tid().longValue(), Long.toHexString(threadCursor.omrVMThread()._trace$uteThread().getAddress()), getThreadName(threadCursor)));
                out.append(nl);
                threadCursor = threadCursor.linkNext();
            } while (!threadCursor.eq(mainThread));
        }
    } catch (CorruptDataException e) {
        throw new DDRInteractiveCommandException(e);
    }
}
Also used : J9VMThreadPointer(com.ibm.j9ddr.vm29.pointer.generated.J9VMThreadPointer) DDRInteractiveCommandException(com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException) J9JavaVMPointer(com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException)

Example 15 with J9JavaVMPointer

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

the class ThreadsCommand method stack.

private void stack(PrintStream out, Context context, String command) throws DDRInteractiveCommandException {
    try {
        J9JavaVMPointer vm = J9RASHelper.getVM(DataType.getJ9RASPointer());
        J9VMThreadPointer mainThread = vm.mainThread();
        StackWalkCommand walkCommand = new StackWalkCommand();
        if (mainThread.notNull()) {
            J9VMThreadPointer threadCursor = vm.mainThread();
            do {
                out.println(String.format("\t!stack 0x%08x\t!j9vmthread 0x%08x\t!j9thread 0x%08x\ttid 0x%x (%d) // %s", threadCursor.getAddress(), threadCursor.getAddress(), threadCursor.osThread().getAddress(), threadCursor.osThread().tid().longValue(), threadCursor.osThread().tid().longValue(), getThreadName(threadCursor)));
                out.append(nl);
                walkCommand.run(command, new String[] { Long.toString(threadCursor.getAddress()) }, context, out);
                out.append(nl);
                threadCursor = threadCursor.linkNext();
            } while (!threadCursor.eq(mainThread));
        }
    } catch (CorruptDataException e) {
        throw new DDRInteractiveCommandException(e);
    }
}
Also used : J9VMThreadPointer(com.ibm.j9ddr.vm29.pointer.generated.J9VMThreadPointer) DDRInteractiveCommandException(com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException) J9JavaVMPointer(com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer) StackWalkCommand(com.ibm.j9ddr.vm29.tools.ddrinteractive.commands.StackWalkCommand) CorruptDataException(com.ibm.j9ddr.CorruptDataException)

Aggregations

J9JavaVMPointer (com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer)57 CorruptDataException (com.ibm.j9ddr.CorruptDataException)49 DDRInteractiveCommandException (com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException)39 J9ClassPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer)23 J9VMThreadPointer (com.ibm.j9ddr.vm29.pointer.generated.J9VMThreadPointer)17 UDATA (com.ibm.j9ddr.vm29.types.UDATA)13 J9ROMClassPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ROMClassPointer)10 ClassSegmentIterator (com.ibm.j9ddr.vm29.j9.walkers.ClassSegmentIterator)8 J9ObjectPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer)8 J9MemorySegmentPointer (com.ibm.j9ddr.vm29.pointer.generated.J9MemorySegmentPointer)6 PatternString (com.ibm.j9ddr.util.PatternString)5 MonitorIterator (com.ibm.j9ddr.vm29.j9.walkers.MonitorIterator)5 ROMClassesIterator (com.ibm.j9ddr.vm29.j9.walkers.ROMClassesIterator)5 U8Pointer (com.ibm.j9ddr.vm29.pointer.U8Pointer)5 J9ClassLoaderPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ClassLoaderPointer)5 MM_HeapRegionManagerPointer (com.ibm.j9ddr.vm29.pointer.generated.MM_HeapRegionManagerPointer)5 Table (com.ibm.j9ddr.tools.ddrinteractive.Table)4 GCHeapRegionDescriptor (com.ibm.j9ddr.vm29.j9.gc.GCHeapRegionDescriptor)4 J9MethodPointer (com.ibm.j9ddr.vm29.pointer.generated.J9MethodPointer)4 J9ThreadMonitorPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ThreadMonitorPointer)4