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


C++ Probe::enqueueNotifyPacket方法代码示例

本文整理汇总了C++中Probe::enqueueNotifyPacket方法的典型用法代码示例。如果您正苦于以下问题:C++ Probe::enqueueNotifyPacket方法的具体用法?C++ Probe::enqueueNotifyPacket怎么用?C++ Probe::enqueueNotifyPacket使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Probe的用法示例。


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

示例1: handleEvent

Process::cb_ret_t Backend::handleEvent(Dyninst::ProcControlAPI::Process::const_ptr curProcess,
                                 Dyninst::ProcControlAPI::Thread::const_ptr curThread,
                                 DysectAPI::Event* dysectEvent) {

  Process::cb_ret_t retState = Process::cbDefault;

  // Let event know that it was triggered.
  // Used for event composition
  Walker* proc = (Walker*)curProcess->getData();

  if(!proc) {
    Err::warn(true, "Missing payload in process object: could not get walker");
  } else {
    dysectEvent->triggered(curProcess, curThread);

    // Find owning probe
    Probe* probe = dysectEvent->getOwner();


    if(!probe) {
      Err::warn(true, "Probe could not be found for event object");
    } else {
      // If enqueued disabled - stop and await
      //if(probe->isDisabled(curProcess)) {
      //  probe->addWaitingProc(curProcess);

      //  return Process::cbProcStop;
      //  //return Process::cbDefault;
      //}

      // Composed events might require several events being triggered
      if(probe->wasTriggered(curProcess, curThread)) {
        // Required events indeed triggered
        // Evaluate conditions
        ConditionResult result;
        
        Err::verbose(true, "Evaluate condition!");
        if(probe->evaluateConditions(result, curProcess, curThread) == DysectAPI::OK) {

          if(result == ResolvedTrue) { 
            Err::verbose(true, "Condition satisfied");
            
            Domain* dom = probe->getDomain();
            assert(dom != 0);

            if(dom->getWaitTime() == Wait::inf) {

              // Block strictly, until all processes have shown up
              Err::verbose(true, "Enqueuing notification for static domain");
              probe->enqueueNotifyPacket();
              probe->enqueueAction(curProcess, curThread);

            } else if(dom->getWaitTime() != Wait::NoWait) {
              if(!DysectAPI::SafeTimer::syncTimerRunning(probe)) {
                Err::verbose(true, "Start timer and enqueue: %x", dom->getId());
                DysectAPI::SafeTimer::startSyncTimer(probe);
              } else {
                Err::verbose(true, "Timer already running - just enqueue");
              }
              
              if(probe->doNotify()) {
                probe->enqueueNotifyPacket();
              }

              probe->enqueueAction(curProcess, curThread);

            } else { // No-wait probe

              if(probe->doNotify()) {
                probe->notifyTriggered();
              }

              probe->triggerAction(curProcess, curThread);

            }
            
            if(probe->waitForOthers()) {
              Err::verbose(true, "Wait for group members");
              probe->addWaitingProc(curProcess);

              if((dom->getWaitTime() == Wait::inf) && (probe->staticGroupWaiting())) {
                Err::verbose(true, "Sending enqueued notifications");
                
                if(probe->doNotify()) {
                  probe->sendEnqueuedNotifications();
                }
  
                probe->sendEnqueuedActions();
              }
            
              retState = Process::cbThreadStop;
            
            } else {
              Err::verbose(true, "Enable children for probe %x", dom->getId());
              probe->enqueueEnable(curProcess);

              //Err::verbose(true, "Stopping thread in process %d", curProcess->getPid());
              probe->addWaitingProc(curProcess);
              //retState = Process::cbThreadStop;
              retState = Process::cbProcStop;
//.........这里部分代码省略.........
开发者ID:LLNL,项目名称:DysectAPI,代码行数:101,代码来源:backend.cpp


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