]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
intel_rdt: added support for LLC misses monitoring event
authorMichał Aleksiński <michal.aleksinski@mobica.com>
Mon, 25 Mar 2024 06:42:45 +0000 (07:42 +0100)
committerMichał Aleksiński <michal.aleksinski@mobica.com>
Mon, 25 Mar 2024 07:14:10 +0000 (08:14 +0100)
src/collectd.conf.in
src/collectd.conf.pod
src/intel_rdt.c

index 9eb6f013020465dd7bb499aee679902d6a2a7442..2a3cc9e2ea12794b14f8c6990c7d825adbda3f69 100644 (file)
 #<Plugin "intel_rdt">
 #  MonIPCEnabled true
 #  MonLLCRefEnabled false
+#  MonLLCMissEnabled false
 #  Cores "0-2"
 #  Processes "sshd"
 #</Plugin>
index 01cba6077d3027e16fd77151c130f4e208ed2a26..6dccae4464244c1b65bf886ef148a89c0761b02f 100644 (file)
@@ -4033,6 +4033,7 @@ B<Synopsis:>
   <Plugin "intel_rdt">
     MonIPCEnabled true
     MonLLCRefEnabled false
+    MonLLCMissEnabled false
     Cores "0-2" "3,4,6" "8-10,15"
     Processes "sshd,qemu-system-x86" "bash"
   </Plugin>
@@ -4059,6 +4060,12 @@ Determines whether or not to enable LLC references monitoring. If set to
 B<false> (the default), LLC references monitoring statistics will not be
 collected by intel_rdt plugin.
 
+=item B<MonLLCMissEnabled> B<true>|B<false>
+
+Determines whether or not to enable LLC misses  monitoring. If set to B<false>
+(the default), LLC misses monitoring statistics will not be collected by
+intel_rdt plugin.
+
 =item B<Cores> I<cores groups>
 
 Monitoring of the events can be configured for group of cores
index fb2adf32595d87485824246d758157c8e527c503..ea93ac1cebaa541cf46838f87c55ea9dd782f597 100644 (file)
 #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);
     }