当前位置: 首页>>代码示例>>C++>>正文


C++ LOG_ALWAYS_FATAL函数代码示例

本文整理汇总了C++中LOG_ALWAYS_FATAL函数的典型用法代码示例。如果您正苦于以下问题:C++ LOG_ALWAYS_FATAL函数的具体用法?C++ LOG_ALWAYS_FATAL怎么用?C++ LOG_ALWAYS_FATAL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了LOG_ALWAYS_FATAL函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: mRILfd

PhoneMachine::PhoneMachine(PhoneService *service)
    : mRILfd(-1)
    , mAudioMode(AUDIO_MODE_NORMAL)  // Strictly speaking we should initialize this 
    , mService(service)
{
    char *flags = ::getenv("DEBUG_PHONE");
    if (flags != NULL) {
	mDebug = DEBUG_BASIC;
	char *token = strtok(flags, ":");
	while (token != NULL) {
	    if (!strncasecmp(token, "in", 2))
		mDebug |= DEBUG_INCOMING;
	    else if (!strncasecmp(token, "out", 3))
		mDebug |= DEBUG_OUTGOING;
	    token = strtok(NULL, ":");
	}
    }
    mRILfd = socket_local_client("rild", ANDROID_SOCKET_NAMESPACE_RESERVED, SOCK_STREAM);
    if (mRILfd < 0) {
	perror("opening rild socket");
	exit(-1);
    }
    if (AudioSystem::setMasterMute(false) != NO_ERROR)
	LOG_ALWAYS_FATAL("Unable to write master mute to false\n");
    SLOGV("Audio configured\n");
    if (createThread(beginOutgoingThread, this) == false) 
	LOG_ALWAYS_FATAL("ERROR!  Unable to create outgoing thread for RILD socket\n");
    if (createThread(beginIncomingThread, this) == false) 
	LOG_ALWAYS_FATAL("ERROR!  Unable to create incoming thread for RILD socket\n");
}
开发者ID:cambridgehackers,项目名称:klaatu-services,代码行数:30,代码来源:PhoneStateMachine.cpp

示例2: selectorLoop

void selectorLoop(Selector* selector) {
    // Make sure we're not already looping.
    if (selector->looping) {
        LOG_ALWAYS_FATAL("Already looping.");
    }
    selector->looping = true;
    
    while (true) {
        setInSelect(selector, true);
        
        prepareForSelect(selector);

        LOGD("Entering select().");
        
        // Select file descriptors.
        int result = select(selector->maxFd + 1, &selector->readFds, 
                &selector->writeFds, &selector->exceptFds, NULL);
        
        LOGD("Exiting select().");
        
        setInSelect(selector, false);
        
        if (result == -1) {
            // Abort on everything except EINTR.
            if (errno == EINTR) {
                LOGI("select() interrupted.");    
            } else {
                LOG_ALWAYS_FATAL("select() error: %s", 
                        strerror(errno));
            }
        } else if (result > 0) {
            fireEvents(selector);
        }
    }
}
开发者ID:28vicky,项目名称:android_system_core,代码行数:35,代码来源:selector.c

示例3: setNonBlocking

/** Sets the non-blocking flag on a descriptor. */
static void setNonBlocking(int fd) {
    int flags;
    if ((flags = fcntl(fd, F_GETFL, 0)) < 0) { 
        LOG_ALWAYS_FATAL("fcntl() error: %s", strerror(errno));
    } 
    if (fcntl(fd, F_SETFL, flags | O_NONBLOCK) < 0) { 
        LOG_ALWAYS_FATAL("fcntl() error: %s", strerror(errno));
    } 
}
开发者ID:0omega,项目名称:platform_system_core,代码行数:10,代码来源:mq.c

示例4: peerProxyRead

/**
 * Reads input from a peer process.
 */
static void peerProxyRead(SelectableFd* fd) {
    ALOGD("Reading...");
    PeerProxy* peerProxy = (PeerProxy*) fd->data;
    int state = peerProxy->inputState;
    Buffer* in = peerProxy->inputBuffer;
    switch (state) {
        case READING_HEADER:
            if (peerProxyBufferInput(peerProxy)) {
                ALOGD("Header read.");
                // We've read the complete header.
                Header* header = (Header*) in->data;
                peerProxyHandleHeader(peerProxy, header);
            }
            break;
        case READING_BYTES:
            ALOGD("Reading bytes...");
            if (peerProxyBufferInput(peerProxy)) {
                ALOGD("Bytes read.");
                // We have the complete packet. Notify bytes listener.
                peerProxy->peer->onBytes(peerProxy->credentials,
                    in->data, in->size);
                        
                // Get ready for the next packet.
                peerProxyExpectHeader(peerProxy);
            }
            break;
        case ACCEPTING_CONNECTION:
            masterProxyAcceptConnection(peerProxy);
            break;
        default:
            LOG_ALWAYS_FATAL("Unknown state: %d", state);
    }
}
开发者ID:0omega,项目名称:platform_system_core,代码行数:36,代码来源:mq.c

示例5: LOG_ALWAYS_FATAL

Mapper::Mapper()
{
    mMapper = IMapper::getService();
    if (mMapper == nullptr || mMapper->isRemote()) {
        LOG_ALWAYS_FATAL("gralloc-mapper must be in passthrough mode");
    }
}
开发者ID:MIPS,项目名称:frameworks-native,代码行数:7,代码来源:Gralloc2.cpp

示例6: jnienv

 JNIEnv* jnienv() {
     JNIEnv* env;
     if (mVm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_6) != JNI_OK) {
         LOG_ALWAYS_FATAL("Failed to get JNIEnv for JavaVM: %p", mVm);
     }
     return env;
 }
开发者ID:rockinroyle,项目名称:platform_frameworks_base,代码行数:7,代码来源:android_view_RenderNode.cpp

示例7: LOG_ALWAYS_FATAL

void Snapshot::buildScreenSpaceTransform(Matrix4* outTransform) const {
#if HWUI_NEW_OPS
    LOG_ALWAYS_FATAL("not supported - not needed by new ops");
#else
    // build (reverse ordered) list of the stack of snapshots, terminated with a NULL
    Vector<const Snapshot*> snapshotList;
    snapshotList.push(nullptr);
    const Snapshot* current = this;
    do {
        snapshotList.push(current);
        current = current->previous;
    } while (current);

    // traverse the list, adding in each transform that contributes to the total transform
    outTransform->loadIdentity();
    for (size_t i = snapshotList.size() - 1; i > 0; i--) {
        // iterate down the stack
        const Snapshot* current = snapshotList[i];
        const Snapshot* next = snapshotList[i - 1];
        if (current->flags & kFlagIsFboLayer) {
            // if we've hit a layer, translate by the layer's draw offset
            outTransform->translate(current->layer->layer.left, current->layer->layer.top);
        }
        if (!next || (next->flags & kFlagIsFboLayer)) {
            // if this snapshot is last, or if this snapshot is last before an
            // FBO layer (which reset the transform), apply it
            outTransform->multiply(*(current->transform));
        }
    }
#endif
}
开发者ID:debian-pkg-android-tools,项目名称:android-platform-frameworks-base,代码行数:31,代码来源:Snapshot.cpp

示例8: ATRACE_NAME

bool EglManager::swapBuffers(const Frame& frame, const SkRect& screenDirty) {
    if (CC_UNLIKELY(Properties::waitForGpuCompletion)) {
        ATRACE_NAME("Finishing GPU work");
        fence();
    }

    EGLint rects[4];
    frame.map(screenDirty, rects);
    eglSwapBuffersWithDamageKHR(mEglDisplay, frame.mSurface, rects, screenDirty.isEmpty() ? 0 : 1);

    EGLint err = eglGetError();
    if (CC_LIKELY(err == EGL_SUCCESS)) {
        return true;
    }
    if (err == EGL_BAD_SURFACE || err == EGL_BAD_NATIVE_WINDOW) {
        // For some reason our surface was destroyed out from under us
        // This really shouldn't happen, but if it does we can recover easily
        // by just not trying to use the surface anymore
        ALOGW("swapBuffers encountered EGL error %d on %p, halting rendering...", err,
              frame.mSurface);
        return false;
    }
    LOG_ALWAYS_FATAL("Encountered EGL error %d %s during rendering", err, egl_error_str(err));
    // Impossible to hit this, but the compiler doesn't know that
    return false;
}
开发者ID:AlanCheen,项目名称:platform_frameworks_base,代码行数:26,代码来源:EglManager.cpp

示例9: mMapper

Allocator::Allocator(const Mapper& mapper)
    : mMapper(mapper)
{
    mAllocator = IAllocator::getService();
    if (mAllocator == nullptr) {
        LOG_ALWAYS_FATAL("gralloc-alloc is missing");
    }
}
开发者ID:MIPS,项目名称:frameworks-native,代码行数:8,代码来源:Gralloc2.cpp

示例10: gralloc_unlock

int gralloc_unlock(gralloc_module_t const* module, buffer_handle_t buffer) {
  GraphicsBuffer* gb = GetGraphicsBuffer(buffer);
  if (!module || !gb || !gb->IsValid()) {
    LOG_ALWAYS_FATAL("%s: Invalid graphics buffer handle.", __FUNCTION__);
    return -EINVAL;
  }
  return gb->Unlock();
}
开发者ID:epowers,项目名称:arc,代码行数:8,代码来源:gralloc.cpp

示例11: LOG_ALWAYS_FATAL

    ~weakref_impl()
    {
        bool dumpStack = false;
        if (!mRetain && mStrongRefs != NULL) {
            dumpStack = true;
#if DEBUG_REFS_FATAL_SANITY_CHECKS
            LOG_ALWAYS_FATAL("Strong references remain!");
#else
            ALOGE("Strong references remain:");
#endif
            ref_entry* refs = mStrongRefs;
            while (refs) {
                char inc = refs->ref >= 0 ? '+' : '-';
                ALOGD("\t%c ID %p (ref %d):", inc, refs->id, refs->ref);
#if DEBUG_REFS_CALLSTACK_ENABLED
                refs->stack.dump();
#endif
                refs = refs->next;
            }
        }

        if (!mRetain && mWeakRefs != NULL) {
            dumpStack = true;
#if DEBUG_REFS_FATAL_SANITY_CHECKS
            LOG_ALWAYS_FATAL("Weak references remain:");
#else
            ALOGE("Weak references remain!");
#endif
            ref_entry* refs = mWeakRefs;
            while (refs) {
                char inc = refs->ref >= 0 ? '+' : '-';
                ALOGD("\t%c ID %p (ref %d):", inc, refs->id, refs->ref);
#if DEBUG_REFS_CALLSTACK_ENABLED
                refs->stack.dump();
#endif
                refs = refs->next;
            }
        }
        if (dumpStack) {
            ALOGE("above errors at:");
            CallStack stack;
            stack.update();
            stack.dump();
        }
    }
开发者ID:TomasMM,项目名称:emir,代码行数:45,代码来源:RefBase.cpp

示例12: peerProxyKill

/**
 * Called when the peer dies.
 */
static void peerProxyKill(PeerProxy* peerProxy, bool errnoIsSet) {
    if (errnoIsSet) {
        ALOGI("Peer %d died. errno: %s", peerProxy->credentials.pid, 
                strerror(errno));
    } else {
        ALOGI("Peer %d died.", peerProxy->credentials.pid);
    }
    
    // If we lost the master, we're up a creek. We can't let this happen.
    if (peerProxy->master) {    
        LOG_ALWAYS_FATAL("Lost connection to master.");
    }

    Peer* localPeer = peerProxy->peer;
    pid_t pid = peerProxy->credentials.pid;
    
    peerLock(localPeer);
    
    // Remember for awhile that the peer died.
    localPeer->deadPeers[localPeer->deadPeerCursor] 
        = peerProxy->credentials.pid;
    localPeer->deadPeerCursor++;
    if (localPeer->deadPeerCursor == PEER_HISTORY) {
        localPeer->deadPeerCursor = 0;
    }
  
    // Remove from peer map.
    hashmapRemove(localPeer->peerProxies, &pid);
    
    // External threads can no longer get to this peer proxy, so we don't 
    // need the lock anymore.
    peerUnlock(localPeer);
    
    // Remove the fd from the selector.
    if (peerProxy->fd != NULL) {
        peerProxy->fd->remove = true;
    }

    // Clear outgoing packet queue.
    while (peerProxyNextPacket(peerProxy)) {}

    bufferFree(peerProxy->inputBuffer);

    // This only applies to the master.
    if (peerProxy->connections != NULL) {
        // We can't leave these other maps pointing to freed memory.
        hashmapForEach(peerProxy->connections, &peerProxyRemoveConnection, 
                peerProxy);
        hashmapFree(peerProxy->connections);
    }

    // Invoke death listener.
    localPeer->onDeath(pid);

    // Free the peer proxy itself.
    free(peerProxy);
}
开发者ID:0omega,项目名称:platform_system_core,代码行数:60,代码来源:mq.c

示例13: dump

void GpuMemoryTracker::onGLContextDestroyed() {
    gGpuThread = 0;
    if (CC_UNLIKELY(gObjectSet.size() > 0)) {
        std::stringstream os;
        dump(os);
        ALOGE("%s", os.str().c_str());
        LOG_ALWAYS_FATAL("Leaked %zd GPU objects!", gObjectSet.size());
    }
}
开发者ID:debian-pkg-android-tools,项目名称:android-platform-frameworks-base,代码行数:9,代码来源:GpuMemoryTracker.cpp

示例14: getDvmDexFromClassPathEntry

static DvmDex* getDvmDexFromClassPathEntry(ClassPathEntry* cpe) {
    if (cpe->kind == kCpeDex) {
        return ((RawDexFile*) cpe->ptr)->pDvmDex;
    }
    if (cpe->kind == kCpeJar) {
        return ((JarFile*) cpe->ptr)->pDvmDex;
    }
    LOG_ALWAYS_FATAL("Unknown cpe->kind=%d", cpe->kind);
}
开发者ID:Aireed,项目名称:DexHunter,代码行数:9,代码来源:dalvik_system_VMRuntime.cpp

示例15: gralloc_lock

int gralloc_lock(gralloc_module_t const* module, buffer_handle_t buffer,
                 int usage, int l, int t, int w, int h, void** vaddr) {
  GraphicsBuffer* gb = GetGraphicsBuffer(buffer);
  if (!module || !gb || !gb->IsValid()) {
    LOG_ALWAYS_FATAL("%s: Invalid graphics buffer handle.", __FUNCTION__);
    return -EINVAL;
  }
  return gb->Lock(usage, l, t, w, h, vaddr);
}
开发者ID:epowers,项目名称:arc,代码行数:9,代码来源:gralloc.cpp


注:本文中的LOG_ALWAYS_FATAL函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。