From: Michał Aleksiński Date: Mon, 25 Mar 2024 06:42:45 +0000 (+0100) Subject: intel_rdt: added support for LLC misses monitoring event X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5e218ea3bfe28d71ad692a2331e82468c199ea33;p=thirdparty%2Fcollectd.git intel_rdt: added support for LLC misses monitoring event --- diff --git a/src/collectd.conf.in b/src/collectd.conf.in index 9eb6f0130..2a3cc9e2e 100644 --- a/src/collectd.conf.in +++ b/src/collectd.conf.in @@ -849,6 +849,7 @@ # # MonIPCEnabled true # MonLLCRefEnabled false +# MonLLCMissEnabled false # Cores "0-2" # Processes "sshd" # diff --git a/src/collectd.conf.pod b/src/collectd.conf.pod index 01cba6077..6dccae446 100644 --- a/src/collectd.conf.pod +++ b/src/collectd.conf.pod @@ -4033,6 +4033,7 @@ B MonIPCEnabled true MonLLCRefEnabled false + MonLLCMissEnabled false Cores "0-2" "3,4,6" "8-10,15" Processes "sshd,qemu-system-x86" "bash" @@ -4059,6 +4060,12 @@ Determines whether or not to enable LLC references monitoring. If set to B (the default), LLC references monitoring statistics will not be collected by intel_rdt plugin. +=item B B|B + +Determines whether or not to enable LLC misses monitoring. If set to B +(the default), LLC misses monitoring statistics will not be collected by +intel_rdt plugin. + =item B I Monitoring of the events can be configured for group of cores diff --git a/src/intel_rdt.c b/src/intel_rdt.c index fb2adf325..ea93ac1ce 100644 --- a/src/intel_rdt.c +++ b/src/intel_rdt.c @@ -47,11 +47,12 @@ #if PQOS_VERSION >= 40400 #define RDT_EVENTS \ (PQOS_MON_EVENT_L3_OCCUP | PQOS_PERF_EVENT_IPC | PQOS_MON_EVENT_LMEM_BW | \ - PQOS_MON_EVENT_TMEM_BW | PQOS_MON_EVENT_RMEM_BW | PQOS_PERF_EVENT_LLC_REF) + PQOS_MON_EVENT_TMEM_BW | PQOS_MON_EVENT_RMEM_BW | PQOS_PERF_EVENT_LLC_REF | \ + PQOS_PERF_EVENT_LLC_MISS) #else #define RDT_EVENTS \ (PQOS_MON_EVENT_L3_OCCUP | PQOS_PERF_EVENT_IPC | PQOS_MON_EVENT_LMEM_BW | \ - PQOS_MON_EVENT_TMEM_BW | PQOS_MON_EVENT_RMEM_BW) + PQOS_MON_EVENT_TMEM_BW | PQOS_MON_EVENT_RMEM_BW | PQOS_PERF_EVENT_LLC_MISS) #endif #define RDT_MAX_SOCKETS 8 @@ -89,6 +90,7 @@ struct rdt_ctx_s { #if PQOS_VERSION >= 40400 bool mon_llc_ref_enabled; #endif + bool mon_llc_miss_enabled; core_groups_list_t cores; enum pqos_mon_event events[RDT_MAX_CORES]; struct pqos_mon_data *pcgroups[RDT_MAX_CORES]; @@ -164,6 +166,18 @@ static void rdt_submit(const struct pqos_mon_data *group) { } #endif + if (events & PQOS_PERF_EVENT_LLC_MISS) { +#if PQOS_VERSION >= 40400 + uint64_t value; + + int ret = pqos_mon_get_value(group, PQOS_PERF_EVENT_LLC_MISS, &value, NULL); + if (ret == PQOS_RETVAL_OK) + rdt_submit_gauge(desc, "bytes", "llc_miss", value); +#else + rdt_submit_gauge(desc, "ipc", NULL, values->llc_misses); +#endif + } + if (events & PQOS_MON_EVENT_LMEM_BW) { const struct pqos_monitor *mon = NULL; @@ -586,6 +600,10 @@ static int rdt_config_events(rdt_ctx_t *rdt) { events &= ~(PQOS_PERF_EVENT_LLC_REF); #endif + /* LLC misses monitoring is disabled */ + if (!rdt->mon_llc_miss_enabled) + events &= ~(PQOS_PERF_EVENT_LLC_MISS); + DEBUG(RDT_PLUGIN ": Available events to monitor: %#x", events); for (size_t i = 0; i < rdt->cores.num_cgroups; i++) { @@ -1269,6 +1287,8 @@ static int rdt_config(oconfig_item_t *ci) { } else if (strcasecmp("MonLLCRefEnabled", child->key) == 0) { cf_util_get_boolean(child, &g_rdt->mon_llc_ref_enabled); #endif + } else if (strcasecmp("MonLLCMissEnabled", child->key) == 0) { + cf_util_get_boolean(child, &g_rdt->mon_llc_miss_enabled); } else { ERROR(RDT_PLUGIN ": Unknown configuration parameter \"%s\".", child->key); }