]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
intel_rdt: added support for LLC references monitoring event
authorMichał Aleksiński <michal.aleksinski@mobica.com>
Wed, 16 Aug 2023 10:50:01 +0000 (12:50 +0200)
committerMatthias Runge <mrunge@matthias-runge.de>
Mon, 28 Aug 2023 07:19:56 +0000 (09:19 +0200)
src/collectd.conf.in
src/collectd.conf.pod
src/intel_rdt.c

index 6d46187a90492f8121c239f98062f11443a535ed..dc38189ec1e11fd2219627538ca1e2ee011f94df 100644 (file)
 
 #<Plugin "intel_rdt">
 #  MonIPCEnabled true
+#  MonLLCRefEnabled false
 #  Cores "0-2"
 #  Processes "sshd"
 #</Plugin>
index 8e7cb4d0c6a98ada8def59b0d36daaf879bb5359..9b7be761f9fa8b1bf0fdd2555ac659aae4bc7150 100644 (file)
@@ -3977,6 +3977,7 @@ B<Synopsis:>
 
   <Plugin "intel_rdt">
     MonIPCEnabled true
+    MonLLCRefEnabled false
     Cores "0-2" "3,4,6" "8-10,15"
     Processes "sshd,qemu-system-x86" "bash"
   </Plugin>
@@ -3997,6 +3998,12 @@ recommended to set interval higher than 1 sec.
 Determines whether or not to enable IPC monitoring. If set to B<true> (the
 default), IPC monitoring statistics will be collected by intel_rdt plugin.
 
+=item B<MonLLCRefEnabled> B<true>|B<false>
+
+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<Cores> I<cores groups>
 
 Monitoring of the events can be configured for group of cores
index 15e12f7efbd558c7a427a8bc7466e1d05764532e..37fc833693271d1d436b56c0d9ca08a0f0a44367 100644 (file)
@@ -46,7 +46,8 @@
 
 #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_REF)
+
 
 #define RDT_MAX_SOCKETS 8
 #define RDT_MAX_SOCKET_CORES 64
@@ -80,6 +81,9 @@ typedef struct rdt_name_group_s rdt_name_group_t;
 
 struct rdt_ctx_s {
   bool mon_ipc_enabled;
+#if PQOS_VERSION >= 40400
+  bool mon_llc_ref_enabled;
+#endif
   core_groups_list_t cores;
   enum pqos_mon_event events[RDT_MAX_CORES];
   struct pqos_mon_data *pcgroups[RDT_MAX_CORES];
@@ -145,6 +149,16 @@ static void rdt_submit(const struct pqos_mon_data *group) {
   if (events & PQOS_PERF_EVENT_IPC)
     rdt_submit_gauge(desc, "ipc", NULL, values->ipc);
 
+#if PQOS_VERSION >= 40400
+  if (events & PQOS_PERF_EVENT_LLC_REF) {
+    uint64_t value;
+
+    int ret = pqos_mon_get_value(group, PQOS_PERF_EVENT_LLC_REF, &value, NULL);
+    if (ret == PQOS_RETVAL_OK)
+      rdt_submit_gauge(desc, "bytes", "llc_ref", value);
+  }
+#endif
+
   if (events & PQOS_MON_EVENT_LMEM_BW) {
     const struct pqos_monitor *mon = NULL;
 
@@ -557,6 +571,12 @@ static int rdt_config_events(rdt_ctx_t *rdt) {
   if (!rdt->mon_ipc_enabled)
     events &= ~(PQOS_PERF_EVENT_IPC);
 
+#if PQOS_VERSION >= 40400
+  /* LLC references monitoring is disabled */
+  if (!rdt->mon_llc_ref_enabled)
+    events &= ~(PQOS_PERF_EVENT_LLC_REF);
+#endif
+
   DEBUG(RDT_PLUGIN ": Available events to monitor: %#x", events);
 
   for (size_t i = 0; i < rdt->cores.num_cgroups; i++) {
@@ -1218,6 +1238,10 @@ static int rdt_config(oconfig_item_t *ci) {
 #endif /* LIBPQOS2 */
     } else if (strcasecmp("MonIPCEnabled", child->key) == 0) {
       cf_util_get_boolean(child, &g_rdt->mon_ipc_enabled);
+#if PQOS_VERSION >= 40400
+    } else if (strcasecmp("MonLLCRefEnabled", child->key) == 0) {
+      cf_util_get_boolean(child, &g_rdt->mon_llc_ref_enabled);
+#endif
     } else {
       ERROR(RDT_PLUGIN ": Unknown configuration parameter \"%s\".", child->key);
     }