From: Michał Aleksiński Date: Mon, 7 Sep 2020 07:38:22 +0000 (+0100) Subject: intel_rdt: Added memory bandwidth total metric X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f8fe003ff97ec6d030a811e8a1e4d497789e4d2;p=thirdparty%2Fcollectd.git intel_rdt: Added memory bandwidth total metric --- diff --git a/src/intel_rdt.c b/src/intel_rdt.c index 81ea40d17..945d51d50 100644 --- a/src/intel_rdt.c +++ b/src/intel_rdt.c @@ -155,6 +155,21 @@ static void rdt_submit(const struct pqos_mon_data *group) { } } + if (events & PQOS_MON_EVENT_TMEM_BW) { + const struct pqos_monitor *mon = NULL; + + int retval = + pqos_cap_get_event(g_rdt->pqos_cap, PQOS_MON_EVENT_TMEM_BW, &mon); + if (retval == PQOS_RETVAL_OK) { + uint64_t value = values->mbm_total; + + if (mon->scale_factor != 0) + value = value * mon->scale_factor; + + rdt_submit_derive(desc, "memory_bandwidth", "total", value); + } + } + if (events & PQOS_MON_EVENT_RMEM_BW) { const struct pqos_monitor *mon = NULL;