Search in sources :

Example 11 with DDRInteractiveCommandException

use of com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException 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 12 with DDRInteractiveCommandException

use of com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException in project openj9 by eclipse.

the class ThreadsCommand method monitors.

/**
 * Prints all of the J9ObjectMonitors in the list of monitor tables.
 *
 * NOTE: It does not dump system monitors found in the thread lib monitor_pool
 *
 * @param out the PrintStream to write output to
 *
 * @see {@link MonitorsCommand}
 */
private void monitors(PrintStream out) throws DDRInteractiveCommandException {
    try {
        MonitorTableListIterator iterator = new MonitorTableListIterator();
        MonitorTable previousMonitorTable = null;
        while (iterator.hasNext()) {
            J9ObjectMonitorPointer objectMonitorPointer = iterator.next();
            MonitorTable currentMonitorTable = iterator.currentMonitorTable();
            if (!currentMonitorTable.equals(previousMonitorTable)) {
                /* Print header for new monitor table */
                out.append("Table = " + currentMonitorTable.getTableName() + ", itemCount=" + currentMonitorTable.getCount());
                out.append(nl);
            }
            out.append(String.format("\n    !j9thread 0x%s    !j9threadmonitor 0x%s", Long.toHexString(objectMonitorPointer.monitor().owner().getAddress()), Long.toHexString(objectMonitorPointer.monitor().getAddress())));
            out.append(nl);
            previousMonitorTable = currentMonitorTable;
        }
    } catch (CorruptDataException e) {
        throw new DDRInteractiveCommandException(e);
    }
}
Also used : DDRInteractiveCommandException(com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException) J9ObjectMonitorPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectMonitorPointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException) MonitorTableListIterator(com.ibm.j9ddr.vm29.j9.MonitorTableListIterator) MonitorTable(com.ibm.j9ddr.vm29.j9.MonitorTable)

Example 13 with DDRInteractiveCommandException

use of com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException 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)

Example 14 with DDRInteractiveCommandException

use of com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException in project openj9 by eclipse.

the class ThreadsCommand method displayThreads.

private void displayThreads(PrintStream out) throws DDRInteractiveCommandException {
    try {
        J9JavaVMPointer vm = J9RASHelper.getVM(DataType.getJ9RASPointer());
        J9VMThreadPointer mainThread = vm.mainThread();
        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)));
                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 DDRInteractiveCommandException

use of com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException in project openj9 by eclipse.

the class DumpAllSegmentsCommand method run.

public void run(String command, String[] args, Context context, PrintStream out) throws DDRInteractiveCommandException {
    try {
        J9JavaVMPointer vm = J9RASHelper.getVM(DataType.getJ9RASPointer());
        out.append(String.format("memorySegments - !j9memorysegmentlist 0x%s\n", Long.toHexString(vm.memorySegments().getAddress())));
        SegmentsUtil.dbgDumpSegmentList(out, vm.memorySegments());
        out.append(String.format("classMemorySegments - !j9memorysegmentlist 0x%s\n", Long.toHexString(vm.classMemorySegments().getAddress())));
        SegmentsUtil.dbgDumpSegmentList(out, vm.classMemorySegments());
        if (J9BuildFlags.interp_nativeSupport) {
            /* readJavaVM also reads converts the JITConfig pointer. */
            if (!vm.jitConfig().isNull()) {
                out.append(String.format("jit code segments - !j9memorysegmentlist 0x%s\n", Long.toHexString(vm.jitConfig().codeCacheList().getAddress())));
                SegmentsUtil.dbgDumpJITCodeSegmentList(out, vm.jitConfig().codeCacheList());
                out.append(String.format("jit data segments - !j9memorysegmentlist 0x%s\n", Long.toHexString(vm.jitConfig().dataCacheList().getAddress())));
                SegmentsUtil.dbgDumpSegmentList(out, vm.jitConfig().dataCacheList());
            } else {
                out.append("JIT not enabled\n");
            }
        }
        out.append(nl);
    } catch (CorruptDataException e) {
        throw new DDRInteractiveCommandException(e);
    }
}
Also used : DDRInteractiveCommandException(com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException) J9JavaVMPointer(com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException)

Aggregations

DDRInteractiveCommandException (com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException)86 CorruptDataException (com.ibm.j9ddr.CorruptDataException)81 J9JavaVMPointer (com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer)38 J9ClassPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer)16 J9ObjectPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer)16 J9VMThreadPointer (com.ibm.j9ddr.vm29.pointer.generated.J9VMThreadPointer)16 J9ROMClassPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ROMClassPointer)11 ClassWalker (com.ibm.j9ddr.vm29.tools.ddrinteractive.ClassWalker)8 LinearDumper (com.ibm.j9ddr.vm29.tools.ddrinteractive.LinearDumper)8 ClassSegmentIterator (com.ibm.j9ddr.vm29.j9.walkers.ClassSegmentIterator)7 UDATAPointer (com.ibm.j9ddr.vm29.pointer.UDATAPointer)6 J9MethodPointer (com.ibm.j9ddr.vm29.pointer.generated.J9MethodPointer)6 J9PoolPointer (com.ibm.j9ddr.vm29.pointer.generated.J9PoolPointer)6 UDATA (com.ibm.j9ddr.vm29.types.UDATA)6 PatternString (com.ibm.j9ddr.util.PatternString)5 ROMClassesIterator (com.ibm.j9ddr.vm29.j9.walkers.ROMClassesIterator)5 VoidPointer (com.ibm.j9ddr.vm29.pointer.VoidPointer)5 RomClassWalker (com.ibm.j9ddr.vm29.tools.ddrinteractive.RomClassWalker)5 MonitorTable (com.ibm.j9ddr.vm29.j9.MonitorTable)4 MonitorTableListIterator (com.ibm.j9ddr.vm29.j9.MonitorTableListIterator)4