Search in sources :

Example 76 with Log

use of com.oracle.svm.core.log.Log in project graal by oracle.

the class MetricsLogUtils method logCounterMetric.

public static void logCounterMetric(String category, long value) {
    Log log = Log.log();
    log.spaces(INDENT_LEVEL_2);
    log.string(category, CATEGORY_FILL, Log.LEFT_ALIGN).unsigned(value, VALUE_FILL, Log.RIGHT_ALIGN).string("#", UNIT_FILL, Log.RIGHT_ALIGN).newline();
}
Also used : Log(com.oracle.svm.core.log.Log)

Example 77 with Log

use of com.oracle.svm.core.log.Log in project graal by oracle.

the class MetricsLogUtils method logTimeMetric.

public static void logTimeMetric(String category, long nanos, TimeUnit unit) {
    Log log = Log.log();
    log.spaces(INDENT_LEVEL_2);
    log.string(category, CATEGORY_FILL, Log.LEFT_ALIGN).unsigned(nanosToUnit(nanos, unit), VALUE_FILL, Log.RIGHT_ALIGN).string(unit.symbol(), UNIT_FILL, Log.RIGHT_ALIGN).newline();
}
Also used : Log(com.oracle.svm.core.log.Log)

Example 78 with Log

use of com.oracle.svm.core.log.Log in project graal by oracle.

the class SubstrateSegfaultHandler method dispatch.

@CEntryPoint
@CEntryPointOptions(prologue = NoPrologue.class, epilogue = NoEpilogue.class, publishAs = Publish.NotPublished, include = CEntryPointOptions.NotIncludedAutomatically.class)
@RestrictHeapAccess(access = RestrictHeapAccess.Access.NO_ALLOCATION, reason = "Must not allocate in segfault signal handler.")
@Uninterruptible(reason = "Must be uninterruptible until it gets immune to safepoints", calleeMustBe = false)
private static void dispatch(int signalNumber, @SuppressWarnings("unused") siginfo_t sigInfo, ucontext_t uContext) {
    if (dispatchInProgress) {
        Log.log().newline().string("[ [ SubstrateSegfaultHandler already handling signal ").signed(signalNumber).string(" ] ]").newline();
        return;
    }
    dispatchInProgress = true;
    VMThreads.StatusSupport.setStatusIgnoreSafepoints();
    Log log = Log.log();
    log.autoflush(true);
    log.string("[ [ SubstrateSegfaultHandler caught signal ").signed(signalNumber).string(" ] ]").newline();
    GregsPointer gregs = uContext.uc_mcontext_gregs();
    long spValue = gregs.read(Signal.GregEnum.REG_RSP.getCValue());
    long ipValue = gregs.read(Signal.GregEnum.REG_RIP.getCValue());
    log.newline().string("General Purpose Register Set Values: ").newline();
    log.indent(true);
    log.string("RAX ").zhex(gregs.read(Signal.GregEnum.REG_RAX.getCValue())).newline();
    log.string("RBX ").zhex(gregs.read(Signal.GregEnum.REG_RBX.getCValue())).newline();
    log.string("RCX ").zhex(gregs.read(Signal.GregEnum.REG_RCX.getCValue())).newline();
    log.string("RDX ").zhex(gregs.read(Signal.GregEnum.REG_RDX.getCValue())).newline();
    log.string("RBP ").zhex(gregs.read(Signal.GregEnum.REG_RBP.getCValue())).newline();
    log.string("RSI ").zhex(gregs.read(Signal.GregEnum.REG_RSI.getCValue())).newline();
    log.string("RDI ").zhex(gregs.read(Signal.GregEnum.REG_RDI.getCValue())).newline();
    log.string("RSP ").zhex(spValue).newline();
    log.string("R8  ").zhex(gregs.read(Signal.GregEnum.REG_R8.getCValue())).newline();
    log.string("R9  ").zhex(gregs.read(Signal.GregEnum.REG_R9.getCValue())).newline();
    log.string("R10 ").zhex(gregs.read(Signal.GregEnum.REG_R10.getCValue())).newline();
    log.string("R11 ").zhex(gregs.read(Signal.GregEnum.REG_R11.getCValue())).newline();
    log.string("R12 ").zhex(gregs.read(Signal.GregEnum.REG_R12.getCValue())).newline();
    log.string("R13 ").zhex(gregs.read(Signal.GregEnum.REG_R13.getCValue())).newline();
    log.string("R14 ").zhex(gregs.read(Signal.GregEnum.REG_R14.getCValue())).newline();
    log.string("R15 ").zhex(gregs.read(Signal.GregEnum.REG_R15.getCValue())).newline();
    log.string("EFL ").zhex(gregs.read(Signal.GregEnum.REG_EFL.getCValue())).newline();
    log.string("RIP ").zhex(ipValue).newline();
    log.indent(false);
    SubstrateUtil.printDiagnostics(log, WordFactory.pointer(spValue), WordFactory.pointer(ipValue));
    log.string("Use runtime option -R:-InstallSegfaultHandler if you don't want to use SubstrateSegfaultHandler.").newline();
    log.newline().string("Bye bye ...").newline().newline();
    LogHandler.get().fatalError();
}
Also used : Log(com.oracle.svm.core.log.Log) GregsPointer(com.oracle.svm.core.posix.headers.Signal.GregsPointer) CEntryPoint(org.graalvm.nativeimage.c.function.CEntryPoint) CEntryPointOptions(com.oracle.svm.core.c.function.CEntryPointOptions) Uninterruptible(com.oracle.svm.core.annotate.Uninterruptible) RestrictHeapAccess(com.oracle.svm.core.annotate.RestrictHeapAccess)

Example 79 with Log

use of com.oracle.svm.core.log.Log in project graal by oracle.

the class AlignedHeapChunkMemoryWalkerAccessFeature method verifyRememberedSet.

/**
 * Verify the remembered set of the given chunk.
 */
private static boolean verifyRememberedSet(AlignedHeader that) {
    final Log trace = Log.noopLog().string("[AlignedHeapChunk.verifyRememberedSet:").string("  that: ").hex(that);
    /* Only chunks in the old from space have a remembered set. */
    final HeapImpl heap = HeapImpl.getHeapImpl();
    final OldGeneration oldGen = heap.getOldGeneration();
    if (that.getSpace() == oldGen.getFromSpace()) {
        /* Verify the remembered sets themselves. */
        if (!CardTable.verify(getCardTableStart(that), getFirstObjectTableStart(that), getAlignedHeapChunkStart(that), that.getTop())) {
            final Log verifyLog = heap.getHeapVerifierImpl().getWitnessLog().string("[AlignedHeapChunk.verifyRememberedSet:");
            verifyLog.string("  card table fails to verify").string("]").newline();
            return false;
        }
        if (!FirstObjectTable.verify(getFirstObjectTableStart(that), getAlignedHeapChunkStart(that), that.getTop())) {
            final Log verifyLog = heap.getHeapVerifierImpl().getWitnessLog().string("[AlignedHeapChunk.verifyRememberedSet:");
            verifyLog.string("  first object table fails to verify").string("]").newline();
            return false;
        }
    }
    trace.string("]").newline();
    return true;
}
Also used : Log(com.oracle.svm.core.log.Log)

Example 80 with Log

use of com.oracle.svm.core.log.Log in project graal by oracle.

the class AlignedHeapChunkMemoryWalkerAccessFeature method verifyAlignedHeapChunk.

/*
     * Verification.
     */
static boolean verifyAlignedHeapChunk(AlignedHeader that) {
    final Log trace = Log.noopLog().string("[AlignedHeapChunk.verify:");
    trace.string("  that: ").hex(that);
    boolean result = true;
    /* Verify the superclass structure. */
    if (result && !verifyHeapChunk(that, getAlignedHeapChunkStart(that))) {
        result = false;
        final Log verifyLog = HeapImpl.getHeapImpl().getHeapVerifierImpl().getWitnessLog().string("[AlignedHeapChunk.verify:");
        verifyLog.string("  identifier: ").hex(that).string("  superclass fails to verify]").newline();
    }
    /* AlignedHeapChunks should not be pinned. */
    if (result && that.getPinned()) {
        result = false;
        final Log verifyLog = HeapImpl.getHeapImpl().getHeapVerifierImpl().getWitnessLog().string("[AlignedHeapChunk.verify:");
        verifyLog.string("  identifier: ").hex(that).string("  isPinned.]").newline();
    }
    /* Verify the object headers. */
    if (result && !verifyHeaders(that)) {
        result = false;
        final Log verifyLog = HeapImpl.getHeapImpl().getHeapVerifierImpl().getWitnessLog().string("[AlignedHeapChunk.verify:");
        verifyLog.string("  identifier: ").hex(that).string("  object headers fail to verify.]").newline();
    }
    /* Verify the remembered set. */
    if (result && !verifyRememberedSet(that)) {
        result = false;
        final Log verifyLog = HeapImpl.getHeapImpl().getHeapVerifierImpl().getWitnessLog().string("[AlignedHeapChunk.verify:");
        verifyLog.string("  identifier: ").hex(that).string("  remembered set fails to verify]").newline();
    }
    trace.string("  returns: ").bool(result);
    trace.string("]").newline();
    return result;
}
Also used : Log(com.oracle.svm.core.log.Log)

Aggregations

Log (com.oracle.svm.core.log.Log)130 Pointer (org.graalvm.word.Pointer)30 UnsignedWord (org.graalvm.word.UnsignedWord)30 IsolateThread (org.graalvm.nativeimage.IsolateThread)4 CodePointer (org.graalvm.nativeimage.c.function.CodePointer)4 Uninterruptible (com.oracle.svm.core.annotate.Uninterruptible)3 CollectionWatcher (com.oracle.svm.core.heap.CollectionWatcher)3 DiscoverableReference (com.oracle.svm.core.heap.DiscoverableReference)3 XOptions (com.oracle.svm.core.option.XOptions)3 AlwaysInline (com.oracle.svm.core.annotate.AlwaysInline)2 CEntryPointOptions (com.oracle.svm.core.c.function.CEntryPointOptions)2 KnownIntrinsics.readCallerStackPointer (com.oracle.svm.core.snippets.KnownIntrinsics.readCallerStackPointer)2 CEntryPoint (org.graalvm.nativeimage.c.function.CEntryPoint)2 RestrictHeapAccess (com.oracle.svm.core.annotate.RestrictHeapAccess)1 CodeInfoQueryResult (com.oracle.svm.core.code.CodeInfoQueryResult)1 SubstrateInstalledCode (com.oracle.svm.core.deopt.SubstrateInstalledCode)1 AlignedHeader (com.oracle.svm.core.genscavenge.AlignedHeapChunk.AlignedHeader)1 UnalignedHeader (com.oracle.svm.core.genscavenge.UnalignedHeapChunk.UnalignedHeader)1 AllocationFreeList (com.oracle.svm.core.heap.AllocationFreeList)1 NoAllocationVerifier (com.oracle.svm.core.heap.NoAllocationVerifier)1