Changeset 44:05abba900db9 in finroc_plugins_scheduling


Ignore:
Timestamp:
03.06.2019 17:51:22 (3 months ago)
Author:
Max Reichardt <max.reichardt@…>
Branch:
17.03
Parents:
41:9f50c089353c (diff), 43:01861b41db29 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Phase:
public
Message:

Merge with 14.08

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • tThreadContainerElement.hpp

    r39 r44  
    7272  rt_thread("Realtime Thread", this, false), 
    7373  warn_on_cycle_time_exceed("Warn on cycle time exceed", this, true), 
    74   execution_duration("Execution Duration", new core::tPortGroup(this, "Profiling", core::tFrameworkElementFlag::INTERFACE, core::tFrameworkElement::tFlag::EMITS_DATA | core::tFrameworkElement::tFlag::OUTPUT_PORT)), 
     74  execution_duration("Execution Duration", new core::tPortGroup(this, "Profiling", core::tFrameworkElementFlag::INTERFACE | core::tFrameworkElementFlag::INTERFACE_FOR_DATA_PORTS | core::tFrameworkElementFlag::INTERFACE_FOR_OUTPUTS, data_ports::cDEFAULT_OUTPUT_PORT_FLAGS)), 
    7575  execution_details("Details", execution_duration.GetParent(), IsProfilingEnabled() ? BASE::tFlag::PORT : BASE::tFlag::DELETED), 
    7676  cycle_time("Cycle Time", this, std::chrono::milliseconds(40), data_ports::tBounds<rrlib::time::tDuration>(rrlib::time::tDuration::zero(), std::chrono::seconds(60))), 
  • tThreadContainerThread.cpp

    r40 r44  
    303303} 
    304304 
    305 void tThreadContainerThread::HandleWatchdogAlert() 
     305std::string tThreadContainerThread::GetCurrentTaskName() const 
    306306{ 
    307307  tPeriodicFrameworkElementTask* task = current_task; 
    308308  if (!task) 
    309309  { 
     310    return ""; 
     311  } 
     312  std::stringstream stream; 
     313  stream << *(task->incoming.size() > 0 ? task->incoming[0] : task->GetAnnotated<core::tFrameworkElement>()); 
     314  return stream.str(); 
     315} 
     316 
     317void tThreadContainerThread::HandleWatchdogAlert() 
     318{ 
     319  std::string stuck_name = GetCurrentTaskName(); 
     320  if (stuck_name.empty()) 
     321  { 
    310322    FINROC_LOG_PRINT(ERROR, "Got stuck without executing any task!? This should not happen."); 
    311323  } 
    312324  else 
    313325  { 
    314     core::tFrameworkElement* stuck_element = task->incoming.size() > 0 ? task->incoming[0] : task->GetAnnotated<core::tFrameworkElement>(); 
    315     FINROC_LOG_PRINT(ERROR, "Got stuck executing task associated with '", *stuck_element, "'. Please check your code for infinite loops etc.!"); 
     326    FINROC_LOG_PRINT(ERROR, "Got stuck executing task associated with '", stuck_name, "'. Please check your code for infinite loops etc.!"); 
    316327  } 
    317328  tWatchDogTask::Deactivate(); 
  • tThreadContainerThread.cpp

    r43 r44  
    208208  { 
    209209#ifdef FINROC_PORT_BASED_SCHEDULING 
    210     core::tAbstractPort& dest_port = trace_reverse ? *it_incoming : *it_outgoing; 
     210    core::tAbstractPort& dest_port = trace_reverse ? it_incoming->Source() : it_outgoing->Destination(); 
    211211    core::tEdgeAggregator* dest_aggregator = core::tEdgeAggregator::GetAggregator(dest_port); 
    212212#else 
     
    310310    return ""; 
    311311  } 
    312   return task->incoming.size() > 0 ? task->incoming[0]->GetQualifiedName() : task->GetAnnotated<core::tFrameworkElement>()->GetQualifiedName(); 
     312  std::stringstream stream; 
     313  stream << *(task->incoming.size() > 0 ? task->incoming[0] : task->GetAnnotated<core::tFrameworkElement>()); 
     314  return stream.str(); 
    313315} 
    314316 
     
    692694} 
    693695 
    694 void tThreadContainerThread::OnEdgeChange(core::tRuntimeListener::tEvent change_type, core::tAbstractPort& source, core::tAbstractPort& target) 
    695 { 
    696   if (source.IsChildOf(this->thread_container) && target.IsChildOf(this->thread_container)) 
     696void tThreadContainerThread::OnConnectorChange(core::tRuntimeListener::tEvent change_type, core::tConnector& connector) 
     697{ 
     698  if (connector.Source().IsChildOf(this->thread_container) && connector.Destination().IsChildOf(this->thread_container)) 
    697699  { 
    698700    reschedule = true; 
     
    708710} 
    709711 
     712void tThreadContainerThread::OnUriConnectorChange(core::tRuntimeListener::tEvent change_type, core::tUriConnector& connector) 
     713{ 
     714} 
     715 
    710716void tThreadContainerThread::Run() 
    711717{ 
  • tThreadContainerThread.h

    r41 r44  
    108108 
    109109  /*! 
     110   * \return Returns name of task the thread is currently processing - or empty string if no task is currently processed 
     111   */ 
     112  std::string GetCurrentTaskName() const; 
     113 
     114  /*! 
    110115   * \return Shared Pointer to thread container thread 
    111116   */ 
  • tThreadContainerThread.h

    r43 r44  
    213213  virtual void HandleWatchdogAlert() override; 
    214214 
    215   virtual void OnEdgeChange(core::tRuntimeListener::tEvent change_type, core::tAbstractPort& source, core::tAbstractPort& target) override; 
    216  
     215  virtual void OnConnectorChange(tEvent change_type, core::tConnector& connector) override; 
    217216  virtual void OnFrameworkElementChange(core::tRuntimeListener::tEvent change_type, core::tFrameworkElement& element) override; 
     217  virtual void OnUriConnectorChange(tEvent change_type, core::tUriConnector& connector) override; 
    218218}; 
    219219 
Note: See TracChangeset for help on using the changeset viewer.