Commit 58a8c85e authored by Micha Müller's avatar Micha Müller
Browse files

Pusher:

Caliper-plugin QOL improvement
Add missing config documentation for Caliper service
parent 8d178a73
......@@ -677,6 +677,12 @@ Caliper is an application introspection system. Its functionality stems from so
Caliper has to be integrated into the application. This can be done either manually from the application developer or more automated by the system administrator by "hijacking" applications, e.g. overwriting main methods before execution. For the dcdbpusher service it is sufficient to use the Caliper framework just once, i.e. initialize it somewhere. However, one can still use the full functionality of Caliper services at own will in parallel.
The dcdbpusher service retrieves all symbol (function name) data from the application and associated libraries and stores it in a file shared with the Pusher plugin. The service processes snapshots from the sampler on a per-thread basis. It retrieves all required data (program counter, cpu and timestamp) and makes the data accessible for the Pusher plugin via a queue realized in the shared memory file.
The dcdbpusher Caliper service can be controlled by the environment variables listed below:
| Value | Explanation |
|:----- |:----------- |
| CALI_DCDBPUSHER_SUS_CYCLE | Symbol update service (SUS) cycle. In case a symbol could not be resolved by the Pusher plugin it informs the background SUS on Caliper service side to update the symbol data in the shared memory file. Updating the symbol data is a heavy blocking task. To limit overhead and avoid continuous rebuild of symbol data this environment variable can be used to set the cycle interval of the SUS in seconds (e.g. `export CALI_DCDBPUSHER_SUS_CYCLE=x`). The SUS only checks every x seconds if a symbol data update is requested. Increasing this value reduces overhead of repeated symbol data rebuilds but decreases responsiveness if rebuilds are requested seldomly. Default is 15 seconds.
### Pusher plugin side
The pusher plugin serves as data sink for the snapshot data from the Caliper service. It can handle multiple different applications at once. However, it is mainly intended for only one application with multiple threads/(MPI-)processes.
The plugin consumes the PC (snapshot) data from shared memory and resolves it to function names via the provided shared symbol data. If a PC value could not be resolved it requests a rebuild of the symbol data index. Every read cycle the plugin consumes all snapshots available in the queue of a process.
......
......@@ -27,8 +27,10 @@
#include "CaliperSensorGroup.h"
#include <chrono>
#include <errno.h>
#include <stdio.h>
#include <thread>
#include <utility>
#include <sys/mman.h>
......@@ -144,11 +146,19 @@ void CaliperSensorGroup::read() {
}
//got new incoming connection
ssize_t nrec;
const size_t bufSize = 64;
char buf[bufSize];
//receive message with PID
const ssize_t nrec = recv(_connection, (void*) buf, bufSize, MSG_DONTWAIT);
//try to receive message three times. Should leave the sender with enough time to send
for (unsigned short i = 0; i < 3; ++i) {
std::this_thread::sleep_for(std::chrono::microseconds(10));
//receive message with PID
nrec = recv(_connection, (void*) buf, bufSize, MSG_DONTWAIT);
if (nrec != -1 || (errno != EAGAIN && errno != EWOULDBLOCK)) {
break;
}
}
close(_connection);
_connection = -1;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment