Skip to content

Commit

Permalink
rdtmon: Use pqos callback to redirect pqos library messages to collectd.
Browse files Browse the repository at this point in the history
Change-Id: I142e8940878926adf7752eabbad34a6c37cca1d4
Signed-off-by: Korynkevych, RomanX <romanx.korynkevych@intel.com>
  • Loading branch information
rkorynkx committed Dec 8, 2016
1 parent 27d117e commit 2c3aa39
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/intel_rdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,10 @@ static int rdt_config_cgroups(oconfig_item_t *item) {
return (0);
}

static void rdt_pqos_log(void *context, const size_t size, const char *msg) {
DEBUG(RDT_PLUGIN ": %s", msg);
}

static int rdt_preinit(void) {
int ret;

Expand All @@ -478,11 +482,12 @@ static int rdt_preinit(void) {
* call fini and ignore return code. */
pqos_fini();

/* TODO:
* stdout should not be used here. Will be reworked when support of log
* callback is added to PQoS library.
*/
ret = pqos_init(&(struct pqos_config){.fd_log = STDOUT_FILENO});
struct pqos_config pqos = {.fd_log = -1,
.callback_log = rdt_pqos_log,
.context_log = NULL,
.verbose = 0};

ret = pqos_init(&pqos);
if (ret != PQOS_RETVAL_OK) {
ERROR(RDT_PLUGIN ": Error initializing PQoS library!");
goto rdt_preinit_error1;
Expand Down

0 comments on commit 2c3aa39

Please sign in to comment.