btftoolchain
btf::BtfFile Class Reference

Main class of the btf lib. It contains all necessary functions to import and export a BTF file. More...

#include <btf.h>

Public Types

enum class  TimeScales { pico_seconds , nano_seconds , micro_seconds , milli_seconds }
 Enum class which contains the possible time scales (pico-, nano-, micro- or milliseconds). More...
 

Public Member Functions

 BtfFile (std::string path, TimeScales time_scale=TimeScales::nano_seconds, bool auto_suspend_parent_runnable=true, bool source_is_core=true, bool auto_generate_core_events=false, bool auto_wait_resume_os_events=false)
 Constructs a BTF file in memory. More...
 
void finish ()
 Writes all BtfEntry instances to file. More...
 
void importFromFile (const std::string &path, char delimiter=',')
 Appends the data from a BTF file. Currently only import into an empty BTF file is supported. More...
 
void setStringHashMap (std::unordered_map< size_t, std::string > hash_map)
 Sets the ID to name translation map. This should only be used for traces that use ID based APIs (e.g. for naming of events).
Be careful when using this with string based APIs. More...
 
ErrorCodes coreEvent (uint64_t time, const std::string &core, Core::Events core_event)
 Emits a core event. See overloaded function for more information. More...
 
ErrorCodes coreEvent (uint64_t time, size_t core_hash, Core::Events core_event)
 Emits a core event (source is a task). More...
 
ErrorCodes osEvent (uint64_t time, const std::string &process, const std::string &os, OS::Events os_event)
 Emits an OS event (source is a core or a process depending on the value of the core_is_source parameter). See overloaded function for more information. More...
 
ErrorCodes osEvent (uint64_t time, size_t core_hash, size_t os_hash, OS::Events os_event)
 Emits an OS event (source is a core or a process depending on the value of the core_is_source parameter). More...
 
ErrorCodes taskMigrationEvent (uint64_t time, const std::string &source_core, const std::string &destination_core, const std::string &task, uint64_t task_instance_id)
 Emits a task migration event. See overloaded function for more information. More...
 
ErrorCodes taskMigrationEvent (uint64_t time, size_t source_core_hash, size_t destination_core_hash, size_t task_hash, uint64_t task_instance_id)
 Emits a task migration event. More...
 
ErrorCodes processEvent (uint64_t time, const std::string &source, const std::string &process, uint64_t process_instance_id, Process::Events process_event, bool is_isr=false)
 Emits a task event (except migration). See overloaded function for more information. More...
 
ErrorCodes processEvent (uint64_t time, size_t source_hash, size_t process_hash, uint64_t process_instance_id, Process::Events process_event, bool is_isr=false)
 Emits a process event (except task migration). More...
 
ErrorCodes runnableEvent (uint64_t time, const std::string &source, const std::string &runnable, Runnable::Events runnable_event)
 Emits a runnable event (source is a core or process depending on the value of the core_is_source parameter). See overloaded function for more information. More...
 
ErrorCodes runnableEvent (uint64_t time, size_t core_hash, size_t process_hash, size_t runnable_hash, Runnable::Events runnable_event)
 Emits a runnable event (source is a core or process depending on the value of the core_is_source parameter). More...
 
ErrorCodes semaphoreEvent (uint64_t time, const std::string &source, const std::string &target, Semaphore::Events semaphore_event, uint64_t note)
 Emits a semaphore event. See overloaded function for more information. More...
 
ErrorCodes semaphoreEvent (uint64_t time, size_t semaphore_hash, Semaphore::Events semaphore_event, uint64_t note)
 Emits a semaphore event (source is a semaphore). More...
 
ErrorCodes semaphoreEvent (uint64_t time, size_t core_hash, size_t semaphore_hash, Semaphore::Events semaphore_event, uint64_t note)
 Emits a semaphore event (source is a core or process depending on the value of the core_is_source parameter). More...
 
ErrorCodes schedulerEvent (uint64_t time, const std::string &source, const std::string &scheduler, Scheduler::Events scheduler_event)
 Emits a scheduler event. See overloaded function for more information. More...
 
ErrorCodes schedulerEvent (uint64_t time, size_t core_hash, size_t scheduler_hash, Scheduler::Events scheduler_event)
 Emits a scheduler event (source is a core or process depending on the value of the core_is_source parameter). More...
 
ErrorCodes schedulerEvent (uint64_t time, size_t scheduler_hash, Scheduler::Events scheduler_event)
 Emits a scheduler event (source is a scheduler). More...
 
ErrorCodes signalEvent (uint64_t time, const std::string &source, const std::string &signal, Signal::Events signal_event, const std::string &signal_value="")
 Emits a signal event (source is a core or process depending on the value of the core_is_source parameter). See overloaded function for more information. More...
 
ErrorCodes signalEvent (uint64_t time, size_t core_hash, size_t signal_hash, Signal::Events signal_event, const std::string &signal_value="")
 Emits a signal event (source is a core or process depending on the value of the core_is_source parameter). More...
 
ErrorCodes stimulusEvent (uint64_t time, const std::string &source, const std::string &target, Stimulus::Events stimulus_event)
 Emits a stimulus event. See overloaded function for more information. More...
 
ErrorCodes stimulusEvent (uint64_t time, size_t stimulus_hash, Stimulus::Events stimulus_event)
 Emits a stimulus event. More...
 
std::list< std::list< BtfEntry >::iterator > getEventsForEntity (const std::string &entity)
 
std::list< std::list< BtfEntry >::iterator > getEventsForEntity (size_t entity_hash)
 
void comment (const std::string &comment)
 Emits a comment. More...
 
void headerEntry (const std::string &header_entry)
 Writes a custom entry to the header. More...
 
void insertEvent (std::list< std::list< BtfEntry >::iterator >::iterator pos, const BtfEntry &entry)
 Inserts an event into the BTF trace.
Warning: Use on own risk. No checks are performed and the insertion of a wrong event can lead to an invalid BTF file. More...
 
std::list< std::list< BtfEntry >::iterator > & getEntityEvents (const std::string &entity)
 Gets the list of events for a entity. More...
 
std::list< BtfEntrygetAllEvents () const
 Gets a list of all events. More...
 
size_t getNumberOfAllEvents () const
 Gets the number of all events. More...
 
ErrorCodes simulationEventProcessName (uint64_t time, const std::string &process, const std::string &name)
 Emits a process name event (e.g. name change or initial name). See overloaded function for more information. More...
 
ErrorCodes simulationEventProcessName (uint64_t time, size_t process_hash, const std::string &name)
 Emits a process name event (e.g. name change or initial name). More...
 
ErrorCodes simulationEventProcessCreation (uint64_t time, const std::string &process, uint64_t pid, uint64_t ppid)
 Emits a process creation event. See overloaded function for more information. More...
 
ErrorCodes simulationEventProcessCreation (uint64_t time, size_t process_hash, uint64_t pid, uint64_t ppid)
 Emits a process creation event, e.g. PID and PPID mapping to a process. More...
 
ErrorCodes simulationEventThreadName (uint64_t time, const std::string &thread, const std::string &name)
 Emits a thread name event (e.g. name change or initial name). See overloaded function for more information. More...
 
ErrorCodes simulationEventThreadName (uint64_t time, size_t thread_hash, const std::string &name)
 Emits a thread name event (e.g. name change or initial name). More...
 
ErrorCodes simulationEventThreadCreation (uint64_t time, const std::string &thread, uint64_t tid, uint64_t pid)
 Emits a thread creation event. See overloaded function for more information. More...
 
ErrorCodes simulationEventThreadCreation (uint64_t time, size_t thread_hash, uint64_t tid, uint64_t pid)
 Emits a thread creation event, e.g. TID and PID mapping to a thread. More...
 
void setIgnoreMultipleTaskReleases (bool value)
 Sets the option to ignore multiple releases on a waiting task. More...
 

Detailed Description

Main class of the btf lib. It contains all necessary functions to import and export a BTF file.

Member Enumeration Documentation

◆ TimeScales

Enum class which contains the possible time scales (pico-, nano-, micro- or milliseconds).

Enumerator
pico_seconds 

10-12 s

nano_seconds 

10-9 s

micro_seconds 

10-6 s

milli_seconds 

10-3 s

Constructor & Destructor Documentation

◆ BtfFile()

btf::BtfFile::BtfFile ( std::string  path,
TimeScales  time_scale = TimeScales::nano_seconds,
bool  auto_suspend_parent_runnable = true,
bool  source_is_core = true,
bool  auto_generate_core_events = false,
bool  auto_wait_resume_os_events = false 
)
explicit

Constructs a BTF file in memory.

Parameters
[in]pathThe path where the BTF file will be created.
[in]time_scaleThe time unit in which the events are given.
[in]auto_suspend_parent_runnableBoolean which, if true, causes parent runnables to automatically stop when a child runnable starts, and resume when the child runnable finishes. The default value is false.
Note: This option is not defined in the specification. However, it is included in the btf library because it can later simplify the analysis of a btf trace with several child runnables.
[in]source_is_coreBoolean which, if true, causes the osEvent, runnableEvent, signalEvent, schedulerEvent and semaphore event to expect a core as source instead of a process (only relevant for event types for which a process is defined as the source in the specification). Otherwise, a process is expected as source. The default value is true.
Note: This option is not defined in the specification. According to the specification the source of these events are processes. However, since many trace formats only display which event occured on which core this option is implemented to ease the conversion from other trace formats to BTF.
[in]auto_generate_core_eventsBoolean which, if true, causes a core idle event to be automatically generated when no task is running and the core to resume when a task runs again. The default value is false.
Note: This option is not defined in the specification. However, it is included in the btf library because it can later simplify the analysis of a btf trace with several child runnables.
[in]auto_wait_resume_os_eventsBoolean which, if true, causes the task state to be automatically updated after an OS event and the corresponding task events to be generated. The default value is false.
Note: This option is not defined in the specification. It is included for automation purposes.

Member Function Documentation

◆ comment()

void btf::BtfFile::comment ( const std::string &  comment)

Emits a comment.

Parameters
[in]commentThe comment in form of a string. The # at the beginning is added by this function.
Here is the caller graph for this function:

◆ coreEvent() [1/2]

ErrorCodes btf::BtfFile::coreEvent ( uint64_t  time,
const std::string &  core,
Core::Events  core_event 
)

Emits a core event. See overloaded function for more information.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ coreEvent() [2/2]

ErrorCodes btf::BtfFile::coreEvent ( uint64_t  time,
size_t  core_hash,
Core::Events  core_event 
)

Emits a core event (source is a task).

Parameters
[in]timeThe timestamp of the event.
[in]core_hashThe ID of the core.
[in]core_eventThe core event that occurred.
Returns
If no error: success. Otherwise, the following errors are possible:
  • descending_timestamp: the timestamp is earlier than the timestamp of the last event,
  • invalid_type: the specified ID has already been used with a type other than the current one,
  • core_idle_task_still_running: the core wants to go into the idle state but a task is still allocated to the core,
  • already_in_state: the core wants to go into a state it is already in.

◆ finish()

void btf::BtfFile::finish ( )

Writes all BtfEntry instances to file.

Here is the caller graph for this function:

◆ getAllEvents()

std::list< BtfEntry > btf::BtfFile::getAllEvents ( ) const

Gets a list of all events.

Returns
All events.
Here is the caller graph for this function:

◆ getEntityEvents()

std::list< std::list< BtfEntry >::iterator > & btf::BtfFile::getEntityEvents ( const std::string &  entity)

Gets the list of events for a entity.

Parameters
[in]entityThe entity.
Returns
The list of events for that entity.

◆ getEventsForEntity() [1/2]

std::list< std::list< BtfEntry >::iterator > btf::BtfFile::getEventsForEntity ( const std::string &  entity)

◆ getEventsForEntity() [2/2]

std::list< std::list< BtfEntry >::iterator > btf::BtfFile::getEventsForEntity ( size_t  entity_hash)

◆ getNumberOfAllEvents()

size_t btf::BtfFile::getNumberOfAllEvents ( ) const

Gets the number of all events.

Returns
The number of events.
Here is the caller graph for this function:

◆ headerEntry()

void btf::BtfFile::headerEntry ( const std::string &  header_entry)

Writes a custom entry to the header.

Parameters
[in]header_entryThe header entry.
Here is the caller graph for this function:

◆ importFromFile()

void btf::BtfFile::importFromFile ( const std::string &  path,
char  delimiter = ',' 
)

Appends the data from a BTF file. Currently only import into an empty BTF file is supported.

Parameters
[in]pathThe path to the BTF file.
[in]delimiterThe delimiter used in the BTF file.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ insertEvent()

void btf::BtfFile::insertEvent ( std::list< std::list< BtfEntry >::iterator >::iterator  pos,
const BtfEntry entry 
)

Inserts an event into the BTF trace.
Warning: Use on own risk. No checks are performed and the insertion of a wrong event can lead to an invalid BTF file.

Parameters
[in]posThe event is inserted before this position.
[in]entryThe BTF entry to insert.

◆ osEvent() [1/2]

ErrorCodes btf::BtfFile::osEvent ( uint64_t  time,
const std::string &  process,
const std::string &  os,
OS::Events  os_event 
)

Emits an OS event (source is a core or a process depending on the value of the core_is_source parameter). See overloaded function for more information.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ osEvent() [2/2]

ErrorCodes btf::BtfFile::osEvent ( uint64_t  time,
size_t  core_hash,
size_t  os_hash,
OS::Events  os_event 
)

Emits an OS event (source is a core or a process depending on the value of the core_is_source parameter).

Parameters
[in]timeThe timestamp of the event.
[in]core_hashThe ID of the core on which the event occurred.
[in]os_hashThe ID of the OS instance that triggered the event.
[in]os_eventThe OS event that occurred.
Returns
If no error: success. Otherwise, the following errors are possible:
  • descending_timestamp: the timestamp is earlier than the timestamp of the last event,
  • invalid_type: the specified ID has already been used with a type other than the current one,
  • core_idle_task_still_running: the core wants to go into the idle state but a task is still allocated to the core,
  • already_in_state: the core wants to go into a state it is already in.
Here is the call graph for this function:

◆ processEvent() [1/2]

ErrorCodes btf::BtfFile::processEvent ( uint64_t  time,
const std::string &  source,
const std::string &  process,
uint64_t  process_instance_id,
Process::Events  process_event,
bool  is_isr = false 
)

Emits a task event (except migration). See overloaded function for more information.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ processEvent() [2/2]

ErrorCodes btf::BtfFile::processEvent ( uint64_t  time,
size_t  source_hash,
size_t  process_hash,
uint64_t  process_instance_id,
Process::Events  process_event,
bool  is_isr = false 
)

Emits a process event (except task migration).

Parameters
[in]timeThe timestamp of the event.
[in]source_hashThe ID of the source on which the event occurred.
[in]process_hashThe ID of the process.
[in]process_instance_idThe instance ID of the process.
[in]process_eventThe process event that occurred.
[in]is_isrBoolean value that is true if the process is an ISR.
Returns
If no error: success. Otherwise, the following errors are possible:
  • descending_timestamp: the timestamp is earlier than the timestamp of the last event,
  • invalid_type: the specified ID has already been used with a type other than the current one,
  • event_on_idle_core: the core is currently idle, so no task event can occur,
  • invalid_state_transition: the intended state transition is invalid,
  • multiple_tasks_running: the task is allocated to a core which is already allocated by another task,
  • allocated_to_different_core: the task is currently allocated to a different core,
  • terminate_on_task_with_running_runnables: the task wants to terminate, but there are still runnables running in this task,
  • already_in_state: the target state of the task is already the current state.
Here is the call graph for this function:

◆ runnableEvent() [1/2]

ErrorCodes btf::BtfFile::runnableEvent ( uint64_t  time,
const std::string &  source,
const std::string &  runnable,
Runnable::Events  runnable_event 
)

Emits a runnable event (source is a core or process depending on the value of the core_is_source parameter). See overloaded function for more information.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ runnableEvent() [2/2]

ErrorCodes btf::BtfFile::runnableEvent ( uint64_t  time,
size_t  core_hash,
size_t  process_hash,
size_t  runnable_hash,
Runnable::Events  runnable_event 
)

Emits a runnable event (source is a core or process depending on the value of the core_is_source parameter).

Parameters
[in]timeThe timestamp of the event.
[in]core_hashThe ID of the core on which the event occurred.
[in]process_hashThe ID of the process on which the event occurred.
[in]runnable_hashThe ID of the runnable.
[in]runnable_eventThe runnable event that occurred.
Returns
If no error: success. Otherwise, the following errors are possible:
  • descending_timestamp: the timestamp is earlier than the timestamp of the last event,
  • invalid_type: the specified ID has already been used with a type other than the current one,
  • no_task_running: there is no task running on this core, therefore no runnable event can occure,
  • runnable_source_task_not_running: the runnable is not running on the current running task,
  • terminate_on_runnable_with_running_sub_runnable: the runnable wants to terminate, but there are still running sub-runnables,
  • invalid_state_transition: the intended state transition is invalid,
  • already_in_state: the target state of the runnable is already the current state.
Here is the call graph for this function:

◆ schedulerEvent() [1/3]

ErrorCodes btf::BtfFile::schedulerEvent ( uint64_t  time,
const std::string &  source,
const std::string &  scheduler,
Scheduler::Events  scheduler_event 
)

Emits a scheduler event. See overloaded function for more information.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ schedulerEvent() [2/3]

ErrorCodes btf::BtfFile::schedulerEvent ( uint64_t  time,
size_t  core_hash,
size_t  scheduler_hash,
Scheduler::Events  scheduler_event 
)

Emits a scheduler event (source is a core or process depending on the value of the core_is_source parameter).

Parameters
[in]timeThe timestamp of the event.
[in]core_hashThe ID of the core on which the event occurred.
[in]scheduler_hashThe ID of the scheduler.
[in]scheduler_eventThe scheduler event that occurred.
Returns
If no error: success. Otherwise, the following errors are possible:
  • descending_timestamp: the timestamp is earlier than the timestamp of the last event,
  • invalid_type: the specified ID has already been used with a type other than the current one,
  • invalid_event: the specified event cannot be issued by the given source,
  • no_task_running: there is no task running on this core, therefore no signal event can occure.

◆ schedulerEvent() [3/3]

ErrorCodes btf::BtfFile::schedulerEvent ( uint64_t  time,
size_t  scheduler_hash,
Scheduler::Events  scheduler_event 
)

Emits a scheduler event (source is a scheduler).

Parameters
[in]timeThe timestamp of the event.
[in]scheduler_hashThe ID of the scheduler.
[in]scheduler_eventThe scheduler event that occurred.
Returns
If no error: success. Otherwise, the following errors are possible:
  • descending_timestamp: the timestamp is earlier than the timestamp of the last event,
  • invalid_type: the specified ID has already been used with a type other than the current one,
  • invalid_event: the specified event cannot be issued by the given source,
  • no_task_running: there is no task running on this core, therefore no signal event can occure.

◆ semaphoreEvent() [1/3]

ErrorCodes btf::BtfFile::semaphoreEvent ( uint64_t  time,
const std::string &  source,
const std::string &  target,
Semaphore::Events  semaphore_event,
uint64_t  note 
)

Emits a semaphore event. See overloaded function for more information.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ semaphoreEvent() [2/3]

ErrorCodes btf::BtfFile::semaphoreEvent ( uint64_t  time,
size_t  core_hash,
size_t  semaphore_hash,
Semaphore::Events  semaphore_event,
uint64_t  note 
)

Emits a semaphore event (source is a core or process depending on the value of the core_is_source parameter).

Parameters
[in]timeThe timestamp of the event.
[in]core_hashThe ID of the core on which the event occurred.
[in]semaphore_hashThe ID of the semaphore.
[in]semaphore_eventThe semaphore event that occurred.
[in]noteThe amount of accesses on the semaphore.
Returns
If no error: success. Otherwise, the following errors are possible:
  • descending_timestamp: the timestamp is earlier than the timestamp of the last event,
  • invalid_type: the specified ID has already been used with a type other than the current one,
  • invalid_event: the specified event cannot be issued by the given source,
  • no_task_running: there is no task running on this core, therefore no signal event can occure,
  • invalid_state_transition: the intended state transition is invalid,
  • already_in_state: the target state of the runnable is already the current state,
  • amount_of_semaphore_accesses_invalid: the given amount of semaphore accesses is invalid.

◆ semaphoreEvent() [3/3]

ErrorCodes btf::BtfFile::semaphoreEvent ( uint64_t  time,
size_t  semaphore_hash,
Semaphore::Events  semaphore_event,
uint64_t  note 
)

Emits a semaphore event (source is a semaphore).

Parameters
[in]timeThe timestamp of the event.
[in]semaphore_hashThe ID of the semaphore.
[in]semaphore_eventThe semaphore event that occurred.
[in]noteThe amount of accesses on the semaphore.
Returns
If no error: success. Otherwise, the following errors are possible:
  • descending_timestamp: the timestamp is earlier than the timestamp of the last event,
  • invalid_type: the specified ID has already been used with a type other than the current one,
  • invalid_event: the specified event cannot be issued by the given source.
  • no_task_running: there is no task running on this core, therefore no signal event can occure,
  • invalid_state_transition: the intended state transition is invalid,
  • already_in_state: the target state of the runnable is already the current state.

◆ setIgnoreMultipleTaskReleases()

void btf::BtfFile::setIgnoreMultipleTaskReleases ( bool  value)

Sets the option to ignore multiple releases on a waiting task.

Parameters
[in]valueIf true ignore multiple releases on a waiting task, else consider them.
Here is the caller graph for this function:

◆ setStringHashMap()

void btf::BtfFile::setStringHashMap ( std::unordered_map< size_t, std::string >  hash_map)

Sets the ID to name translation map. This should only be used for traces that use ID based APIs (e.g. for naming of events).
Be careful when using this with string based APIs.

Parameters
[in]hash_mapThe ID to name translation map.
Here is the caller graph for this function:

◆ signalEvent() [1/2]

ErrorCodes btf::BtfFile::signalEvent ( uint64_t  time,
const std::string &  source,
const std::string &  signal,
Signal::Events  signal_event,
const std::string &  signal_value = "" 
)

Emits a signal event (source is a core or process depending on the value of the core_is_source parameter). See overloaded function for more information.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ signalEvent() [2/2]

ErrorCodes btf::BtfFile::signalEvent ( uint64_t  time,
size_t  core_hash,
size_t  signal_hash,
Signal::Events  signal_event,
const std::string &  signal_value = "" 
)

Emits a signal event (source is a core or process depending on the value of the core_is_source parameter).

Parameters
[in]timeThe timestamp of the event.
[in]core_hashThe ID of the core on which the event occurred.
[in]signal_hashThe ID of the signal.
[in]signal_eventThe signal event that occurred.
[in]signal_value(optional) value of the signal.
Returns
If no error: success. Otherwise, the following errors are possible:
  • descending_timestamp: the timestamp is earlier than the timestamp of the last event,
  • invalid_type: the specified ID has already been used with a type other than the current one,
  • no_task_running: there is no task running on this core, therefore no signal event can occure.

◆ simulationEventProcessCreation() [1/2]

ErrorCodes btf::BtfFile::simulationEventProcessCreation ( uint64_t  time,
const std::string &  process,
uint64_t  pid,
uint64_t  ppid 
)

Emits a process creation event. See overloaded function for more information.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ simulationEventProcessCreation() [2/2]

ErrorCodes btf::BtfFile::simulationEventProcessCreation ( uint64_t  time,
size_t  process_hash,
uint64_t  pid,
uint64_t  ppid 
)

Emits a process creation event, e.g. PID and PPID mapping to a process.

Parameters
[in]timeThe timestamp of the event.
[in]process_hashThe ID of the process.
[in]pidThe process ID of the process.
[in]ppidThe parent process ID of the parent process.

◆ simulationEventProcessName() [1/2]

ErrorCodes btf::BtfFile::simulationEventProcessName ( uint64_t  time,
const std::string &  process,
const std::string &  name 
)

Emits a process name event (e.g. name change or initial name). See overloaded function for more information.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ simulationEventProcessName() [2/2]

ErrorCodes btf::BtfFile::simulationEventProcessName ( uint64_t  time,
size_t  process_hash,
const std::string &  name 
)

Emits a process name event (e.g. name change or initial name).

Parameters
[in]timeThe timestamp of the event.
[in]process_hashThe ID of the process.
[in]nameThe name of the process.

◆ simulationEventThreadCreation() [1/2]

ErrorCodes btf::BtfFile::simulationEventThreadCreation ( uint64_t  time,
const std::string &  thread,
uint64_t  tid,
uint64_t  pid 
)

Emits a thread creation event. See overloaded function for more information.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ simulationEventThreadCreation() [2/2]

ErrorCodes btf::BtfFile::simulationEventThreadCreation ( uint64_t  time,
size_t  thread_hash,
uint64_t  tid,
uint64_t  pid 
)

Emits a thread creation event, e.g. TID and PID mapping to a thread.

Parameters
[in]timeThe timestamp of the event.
[in]thread_hashThe ID of the thread.
[in]tidThe Thread ID of the thread.
[in]pidThe Process ID of the thread.

◆ simulationEventThreadName() [1/2]

ErrorCodes btf::BtfFile::simulationEventThreadName ( uint64_t  time,
const std::string &  thread,
const std::string &  name 
)

Emits a thread name event (e.g. name change or initial name). See overloaded function for more information.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ simulationEventThreadName() [2/2]

ErrorCodes btf::BtfFile::simulationEventThreadName ( uint64_t  time,
size_t  thread_hash,
const std::string &  name 
)

Emits a thread name event (e.g. name change or initial name).

Parameters
[in]timeThe timestamp of the event.
[in]thread_hashThe ID of the thread.
[in]nameThe name of the thread.

◆ stimulusEvent() [1/2]

ErrorCodes btf::BtfFile::stimulusEvent ( uint64_t  time,
const std::string &  source,
const std::string &  target,
Stimulus::Events  stimulus_event 
)

Emits a stimulus event. See overloaded function for more information.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stimulusEvent() [2/2]

ErrorCodes btf::BtfFile::stimulusEvent ( uint64_t  time,
size_t  stimulus_hash,
Stimulus::Events  stimulus_event 
)

Emits a stimulus event.

Parameters
[in]timeThe timestamp of the event.
[in]stimulus_hashThe ID of the stimulus that triggered the event.
[in]stimulus_eventThe stimulus event that occurred.
Returns
If no error: success. Otherwise, the following errors are possible:
  • descending_timestamp: the timestamp is earlier than the timestamp of the last event,
  • invalid_type: the specified ID has already been used with a type other than the current one,
  • source_and_target_not_equal: The source and the target of the stimulus are not equal.

◆ taskMigrationEvent() [1/2]

ErrorCodes btf::BtfFile::taskMigrationEvent ( uint64_t  time,
const std::string &  source_core,
const std::string &  destination_core,
const std::string &  task,
uint64_t  task_instance_id 
)

Emits a task migration event. See overloaded function for more information.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ taskMigrationEvent() [2/2]

ErrorCodes btf::BtfFile::taskMigrationEvent ( uint64_t  time,
size_t  source_core_hash,
size_t  destination_core_hash,
size_t  task_hash,
uint64_t  task_instance_id 
)

Emits a task migration event.

Parameters
[in]timeThe timestamp of the event.
[in]source_core_hashThe ID of the core, on which the task was running.
[in]destination_core_hashThe ID of the core, on which the task will run.
[in]task_hashThe ID of the task.
[in]task_instance_idThe instance ID of the task.
Returns
If no error: success. Otherwise, the following errors are possible:
  • descending_timestamp: the timestamp is earlier than the timestamp of the last event,
  • invalid_type: the specified ID has already been used with a type other than the current one,
  • invalid_state_transition: the task is currently assigned to the core; in this state migration is not possible.

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