btftoolchain
btf::Process Class Reference

Class for Process Events (see BTF Specification Chapter 2.3.2). More...

#include <process.h>

Public Types

enum class  Events {
  activate , start , preempt , resume ,
  terminate , poll , run , park ,
  poll_parking , release_parking , wait , release ,
  full_migration , enforced_migration , interrupt_suspended , mtalimitexceeded ,
  nowait , unknown
}
 Possible types of Process events. More...
 
enum class  States {
  running , polling , waiting , parking ,
  ready , active , terminated , unknown
}
 Possible types of Process states. More...
 

Public Member Functions

 Process (States state=States::unknown)
 Constructor of the class Process. More...
 
ErrorCodes doStateTransition (Events ev)
 Transitions the current state depending on the event. More...
 
bool isTerminated () const
 Checks, if the current process state is terminated. More...
 
bool wasStarted () const
 Checks, if the current process got a start event at some point. More...
 
bool waitOSevent () const
 Checks, if the current process is waiting for an OS event. More...
 
void setwaitOSevent (bool wait)
 Allows to set the OS wait state of the process. More...
 

Static Public Member Functions

static std::string eventToString (Events ev)
 Converts the enum Events into string. More...
 
static Events stringToEvent (const std::string &str)
 Converts a string into the enum Events. More...
 
static EntityTypes getSourceType (Events ev)
 Gets the source type of the event. More...
 
static bool isEventAllocatingCore (Events ev)
 Checks, if the event will lead to an allocation on the core. More...
 
static bool isEventDeallocatingCore (Events ev)
 Checks, if the event will lead to an deallocation from the core. More...
 

Detailed Description

Class for Process Events (see BTF Specification Chapter 2.3.2).

A Process can be either a task (T) or an interrupt service routine (I).
It is activated by a stimulus. After activation, a scheduler assigns the process to a core where the process is executed

Member Enumeration Documentation

◆ Events

enum btf::Process::Events
strong

Possible types of Process events.

Enumerator
activate 

The activate event indicates that a process transitions from TERMINATED to ACTIVE state.

start 

The start event indicates that a process (target) that is active for execution gets scheduled and allocated to a core (source).

preempt 

The preempt event indicates that a process (target) that is executing on a core (source) gets removed from it due to a scheduling decision.

resume 

The resume event indicates that a process (target) that has been removed from a core by a scheduler gets allocated to a core (source) due to a new scheduling decision.

terminate 

The terminate event indicates that a process (target) has finished its execution.

poll 

The poll event indicates that a request resource is not available and the process (target) starts waiting actively to access it.

run 

The run event indicates that a process (target) that is actively waiting for a resource on a core (source) gets access to this resource and continues execution.

park 

The park event indicates that a process (target) that is actively waiting for a resource is suspended.

poll_parking 

The poll_parking event indicates that a process (target) that has been removed from the allocated core (source) during actively waiting for a resource gets allocated to a core (source). During this reallocation, the requested resource is still not available.

release_parking 

The release_parking event indicates that a process (target) that has been removed from the allocated core (source) during actively waiting for a resource gets access to this resource. During this time, the process is still removed from the core due to a scheduling decision.

wait 

The wait event indicates that a process (target) calls a system service to wait for at least one OS-Event and these events are not set. The process gets removed from the core (source) it is allocated to.

release 

The release event indicates that at least one OS-Event a process (target) is passively waiting for is set and the process is ready to proceed execution.

full_migration 
enforced_migration 
interrupt_suspended 

The interrupt_suspended event indicates that the stated interrupt service routine instance (target) is suspended.

mtalimitexceeded 

The mtalimitexceeded event indicates that the maximum allowed number of concurrent activations of this task is already reached.

nowait 
unknown 

Default value.

◆ States

enum btf::Process::States
strong

Possible types of Process states.

Enumerator
running 

The process instance executes on a core.

polling 

The process instance has requested a not available resource and waits actively.

waiting 

The process instance has called the system service to wait for an OS-Event which is not set and waits passively.

parking 

The process instance has been preempted while actively waiting for a resource that is not available.

ready 

The process instance has been preempted.

active 

The process instance is ready for execution.

terminated 

The process instance has finished its execution or hasn’t been activated yet.

unknown 

Default state.

Constructor & Destructor Documentation

◆ Process()

btf::Process::Process ( States  state = States::unknown)

Constructor of the class Process.

Member Function Documentation

◆ doStateTransition()

ErrorCodes btf::Process::doStateTransition ( Events  ev)

Transitions the current state depending on the event.

Parameters
[in]evEvents enum that triggered the state transition.
Returns
ErrorCodes enum.

◆ eventToString()

std::string btf::Process::eventToString ( Events  ev)
static

Converts the enum Events into string.

Parameters
[in]evEvents enum that will be converted.
Returns
String if Events type is valid, else a fatal error is triggered.
Here is the caller graph for this function:

◆ getSourceType()

EntityTypes btf::Process::getSourceType ( Events  ev)
static

Gets the source type of the event.

Parameters
[in]evEvents enum which source is to be retrieved.
Returns
EntityTypes enum.
Here is the caller graph for this function:

◆ isEventAllocatingCore()

bool btf::Process::isEventAllocatingCore ( Events  ev)
static

Checks, if the event will lead to an allocation on the core.

Parameters
[in]evEvents enum that will be checked.
Returns
True if event allocates on the core, else false.
Here is the caller graph for this function:

◆ isEventDeallocatingCore()

bool btf::Process::isEventDeallocatingCore ( Events  ev)
static

Checks, if the event will lead to an deallocation from the core.

Parameters
[in]evEvents enum that will be checked.
Returns
True if event deallocates from the core, else false.
Here is the caller graph for this function:

◆ isTerminated()

bool btf::Process::isTerminated ( ) const

Checks, if the current process state is terminated.

Returns
True if the current state is terminated, else false.

◆ setwaitOSevent()

void btf::Process::setwaitOSevent ( bool  wait)

Allows to set the OS wait state of the process.

Parameters
[in]waitTrue if the process waits for an OS event, else false.

◆ stringToEvent()

Process::Events btf::Process::stringToEvent ( const std::string &  str)
static

Converts a string into the enum Events.

Parameters
[in]strString that will be converted.
Returns
Events enum.
Here is the caller graph for this function:

◆ waitOSevent()

bool btf::Process::waitOSevent ( ) const

Checks, if the current process is waiting for an OS event.

Returns
True if the process waits for an OS event, else false.

◆ wasStarted()

bool btf::Process::wasStarted ( ) const

Checks, if the current process got a start event at some point.

Returns
True if the process had a start event, else false.

The documentation for this class was generated from the following files: