projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
python: Addressed review comments
[collectd.git]
/
src
/
intel_rdt.c
diff --git
a/src/intel_rdt.c
b/src/intel_rdt.c
index
21f3a20
..
6beac7b
100644
(file)
--- a/
src/intel_rdt.c
+++ b/
src/intel_rdt.c
@@
-25,8
+25,8
@@
* Serhiy Pshyk <serhiyx.pshyk@intel.com>
**/
* Serhiy Pshyk <serhiyx.pshyk@intel.com>
**/
-#include "collectd.h"
#include "common.h"
#include "common.h"
+#include "collectd.h"
#include <pqos.h>
#include <pqos.h>
@@
-460,6
+460,10
@@
static int rdt_config_cgroups(oconfig_item_t *item) {
return (0);
}
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;
static int rdt_preinit(void) {
int ret;
@@
-474,15
+478,12
@@
static int rdt_preinit(void) {
return (-ENOMEM);
}
return (-ENOMEM);
}
- /* In case previous instance of the application was not closed properly
- * call fini and ignore return code. */
- pqos_fini();
+ struct pqos_config pqos = {.fd_log = -1,
+ .callback_log = rdt_pqos_log,
+ .context_log = NULL,
+ .verbose = 0};
- /* 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});
+ ret = pqos_init(&pqos);
if (ret != PQOS_RETVAL_OK) {
ERROR(RDT_PLUGIN ": Error initializing PQoS library!");
goto rdt_preinit_error1;
if (ret != PQOS_RETVAL_OK) {
ERROR(RDT_PLUGIN ": Error initializing PQoS library!");
goto rdt_preinit_error1;
@@
-507,6
+508,9
@@
static int rdt_preinit(void) {
goto rdt_preinit_error2;
}
goto rdt_preinit_error2;
}
+ /* Reset pqos monitoring groups registers */
+ pqos_mon_reset();
+
return (0);
rdt_preinit_error2:
return (0);
rdt_preinit_error2: