#include <BatchServer.hpp>
◆ BatchServer()
geopm::BatchServer::BatchServer |
( |
| ) |
|
|
default |
Interface called by geopmd to create the server for batch commands.
◆ ~BatchServer()
virtual geopm::BatchServer::~BatchServer |
( |
| ) |
|
|
virtualdefault |
◆ get_control_shmem_key()
std::string geopm::BatchServer::get_control_shmem_key |
( |
const std::string & |
server_key | ) |
|
|
static |
- Returns
- The shm key to use for the control shared memory region.
◆ get_signal_shmem_key()
std::string geopm::BatchServer::get_signal_shmem_key |
( |
const std::string & |
server_key | ) |
|
|
static |
- Returns
- The shm key to use for the signal shared memory region.
◆ is_active()
virtual bool geopm::BatchServer::is_active |
( |
void |
| ) |
|
|
pure virtual |
◆ make_unique()
Supports the D-Bus interface for starting a batch server.
This function is called directly by geopmd in order to fork a new process that will support calls within the client_pid to read_batch_client() and write_batch_client(). The client initiates the server by calling start_batch_client() within the client_pid which make the request through D-Bus to start the server. The server_pid and server_key are stored by the client to enable interactions with the server while the batch session is open.
The method will return after the shared memory regions supporting the service have been created and the child thread that updates those regions is waiting for a signal. Access is provided through the SharedMemory interface with two shm file descriptors created, one for signals and one for controls. The shm keys created will be of the form:
"<prefix>/geopm-service-batch-buffer-<KEY>-signals"
"<prefix>/geopm-service-batch-buffer-<KEY>-controls"
where <KEY> is the "server_key". This key is used by the client side with the SharedMemory::make_unique_user() as the shm_key parameter.
- Parameters
-
[in] | client_pid | The Unix process ID of the client process that is initiating the batch server. |
[in] | signal_config | A vector of requests for signals to be sampled. |
[in] | control_config | Avector of requests for controls to be adjusted. |
◆ server_key()
virtual std::string geopm::BatchServer::server_key |
( |
void |
| ) |
const |
|
pure virtual |
- Returns
- The key used to identify the server connection: a substring in interprocess shared memory keys used for communication.
Implemented in geopm::BatchServerImp.
◆ server_pid()
virtual int geopm::BatchServer::server_pid |
( |
void |
| ) |
const |
|
pure virtual |
◆ stop_batch()
virtual void geopm::BatchServer::stop_batch |
( |
void |
| ) |
|
|
pure virtual |
Supports the D-Bus interface for stopping a batch server.
This function is called directly by geopmd in order to end a batch session and kill the batch server process created by start_batch_server().
Implemented in geopm::BatchServerImp.
◆ M_SHMEM_PREFIX
constexpr const char* geopm::BatchServer::M_SHMEM_PREFIX |
|
staticconstexprprotected |
Initial value:=
"/run/geopm/batch-buffer-"
The documentation for this class was generated from the following files: