|
Adaptyst
A comprehensive and architecture-agnostic performance analysis tool
|
Go to the source code of this file.
Classes | |
| struct | option |
| struct | profile_info |
Enumerations | |
| enum | option_type { INT = 1 , STRING = 2 , UNSIGNED_INT = 3 , BOOL = 4 , NONE = 0 } |
| enum | profile_type { LINUX_PROCESS = 0 } |
| #define ADAPTYST_ERR_EXCEPTION 3 |
Error indicating that a C++ exception occurred on the Adaptyst side. Numerical value: 3
| #define ADAPTYST_ERR_INIT_ONLY 6 |
Error indicating that an API method meant to be called inside adaptyst_module_init() only has been attempted to be called outside of adaptyst_module_init(). Numerical value: 6
| #define ADAPTYST_ERR_LOG_DIR_CREATE 5 |
Error indicating that Adaptyst couldn't create log directories for the current performance analysis session. Numerical value: 5
| #define ADAPTYST_ERR_MODULE_NOT_FOUND 1 |
Error indicating that a module with the specified ID hasn't been found. Numerical value: 1
| #define ADAPTYST_ERR_OUT_OF_MEMORY 2 |
Error indicating that there is no memory left. Numerical value: 2
| #define ADAPTYST_ERR_TERMINAL_NOT_INITIALISED 4 |
Error indicating that the terimnal-related resources in Adaptyst haven't been initialised yet. Numerical value: 4
| #define ADAPTYST_ERR_TIMEOUT 7 |
Error indicating a timeout. Numerical value: 7
| #define ADAPTYST_ERR_TIMESTAMP 9 |
Error indicating that the timestamp couldn't be obtained. Numerical value: 9
| #define ADAPTYST_ERR_WORKFLOW_NOT_STARTED 8 |
Error indicating that the workflow hasn't been started. Numerical value: 8
| #define ADAPTYST_ERR_WORKFLOW_RUNNING 10 |
Error indicating that the workflow is still running. Numerical value: 10
| #define ADAPTYST_OK 0 |
No error has occurred. Numerical value: 0
Gets the CPU mask, which length is equal to the number of CPU cores and where the i-th char (indexing and core numbering from 1) can be either: 'b': the i-th core is for both workflow execution and performance analysis 'p': the i-th core is for performance analysis only 'c': the i-th core is for workflow execution only ' ': the i-th core is not used
This method can be called inside adaptyst_module_init() ONLY. Otherwise, an error will be thrown.
| id | The module ID (use module_id). |
Gets the error code set by any of the Adaptyst API calls.
| id | The module ID (use module_id). |
Gets the error message set by any of the Adaptyst API calls.
| id | The module ID (use module_id). |
Gets the path of a loaded module library (e.g. if the library is /A/B/C/libmodule.so, the return value is /A/B/C/libmodule.so).
| id | The module ID (use module_id). |
Gets the path to a directory where Adaptyst local configuration files are stored.
| id | The module ID (use module_id). |
Gets the path to a directory where Adaptyst logs are stored.
| id | The module ID (use module_id). |
Gets the path to a directory where all module output files should be stored.
| id | The module ID (use module_id). |
Gets the name of a node a module is attached to.
| id | The module ID (use module_id). |
Gets a module option set by a user.
| id | The module ID (use module_id). |
| key | The name of an option to obtain. |
| profile_info * adaptyst_get_profile_info | ( | amod_t | id | ) |
Gets information necessary for profiling a workflow in form of a profile_info struct.
| id | The module ID (use module_id). |
Gets the current timestamp in nanoseconds in the Unix format.
| id | The module ID (use module_id). |
Gets the path to a temporary directory.
| id | The module ID (use module_id). |
Gets the timestamp in nanoseconds in the Unix format of when the workflow has finished executing in an entity where the module is.
| id | The module ID (use module_id). |
Gets the timestamp in nanoseconds in the Unix format of when the workflow has been started in an entity where the module is.
Specifically, the timestamp refers to the moment when the workflow has been started following modules indicating their readiness to run performance analysis.
| id | The module ID (use module_id). |
Checks whether any nodes connected to a node a module is attached to (i.e. any nodes with an edge to the module node) has a specific tag.
| id | The module ID (use module_id). |
| tag | Tag to check. |
Checks whether any nodes a module node is connected to (i.e. any nodes with an edge from the module node) has a specific tag.
| id | The module ID (use module_id). |
| tag | Tag to check. |
Returns whether a node a module is attached to is a directing node.
Gets whether the workflow is currently running in an entity where the module is.
If the workflow is ready to run but modules haven't indicated their readiness to run performance analysis yet, the return value is true.
| id | The module ID (use module_id). |
WARNING: If the operation hasn't been successful, the return value is also false! However, you can determine that this is the cause of your problem by checking the value of adaptyst_get_internal_error_code().
Prints an unformatted message of a given type to Adaptyst logs.
| id | The module ID (use module_id). |
| msg | Message to log. |
| type | Log type (use one of the types declared in log_types). |
Prints a formatted message of a given type to Adaptyst logs, i.e. with a specific prefix indicating whether a message is a main one or a secondary one and whether a message is an error.
| id | The module ID (use module_id). |
| msg | Message to print. |
| sub | Whether a message is a secondary one (if true, "->" is printed before the message, otherwise "==>" is printed). |
| error | Whether a message is an error message. |
| type | Log type (use one of the types declared in log_types). |
Sends source code paths to Adaptyst for further processing (source code packing etc. is handled by Adaptyst, not modules).
| id | The module ID (use module_id). |
| paths | Array of source code paths. |
| n | Number of source code paths. |
Sends a notification to Adaptyst that a module is ready to profile.
| id | The module ID (use module_id). |
Waits for a workflow executed by Adaptyst to finish running.
| id | The module ID (use module_id). |
Receives data from the injection part of the module in a workflow, with no timeout.
| id | The module ID (use module_id). |
| buf | Buffer where received data should be stored. |
| buf_size | Size of the buffer in bytes. |
| n | Pointer to a variable where the number of received bytes should be stored. |
| bool adaptyst_receive_data_timeout | ( | amod_t | id, |
| char * | buf, | ||
| unsigned int | buf_size, | ||
| int * | n, | ||
| long | timeout_seconds | ||
| ) |
Receives data from the injection part of the module in a workflow, with a specific timeout.
| id | The module ID (use module_id). |
| buf | Buffer where received data should be stored. |
| buf_size | Size of the buffer in bytes. |
| n | Pointer to a variable where the number of received bytes should be stored. |
| timeout_seconds | Timeout in seconds. |
Receives a string from the injection part of the module in a workflow, with no timeout.
If the sender has sent n strings using adaptyst_send_string() (where n is a positive integer), adaptyst_receive_string() or its timeout variant must be called n times to receive all of these, in the order they have been sent in.
| id | The module ID (use module_id). |
| str | Pointer to a variable where the received string should be stored. If 0 bytes are received, the variable is set to a null pointer. |
Receives a string from the injection part of the module in a workflow, with a specific timeout.
If the sender has sent n strings using adaptyst_send_string() (where n is a positive integer), adaptyst_receive_string_timeout() or its non-timeout variant must be called n times to receive all of these, in the order they have been sent in.
| id | The module ID (use module_id). |
| str | Pointer to a variable where the received string should be stored. If 0 bytes are received, the variable is set to a null pointer. |
| timeout_seconds | Timeout in seconds. |
Sends data to the injection part of the module in a workflow.
| id | The module ID (use module_id). |
| buf | Data to send. |
| n | Number of bytes to send. |
Sends a string to the injection part of the module in a workflow.
The recipient receives strings in the same order they are sent in as long as the sender uses adaptyst_send_string() and the receiver uses adaptyst_receive_string() or its timeout variant.
| id | The module ID (use module_id). |
| str | String to send. |
Indicates to Adaptyst that a module error has occurred.
| id | The module ID (use module_id). |
| msg | Error message. |
| bool adaptyst_set_profile_info | ( | amod_t | id, |
| profile_info * | info | ||
| ) |
Sets information necessary for profiling a workflow in form of a profile_info struct. This function propagates information to all modules within an entity and is useful in case a module is in a directing node.
This method can be called inside adaptyst_module_init() ONLY. Otherwise, an error will be thrown.
| id | The module ID (use module_id). |
| info | Pointer to a profile_info struct with profiling information to be set. |
Indicates to Adaptyst whether a module will profile a workflow. By default, Adaptyst assumes that modules do not profile.
This method can be called inside adaptyst_module_init() ONLY. Otherwise, an error will be thrown.
| id | The module ID (use module_id). |
| will_profile | Whether a module will profile a workflow. |