[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250429003359.375508-31-tony.luck@intel.com>
Date: Mon, 28 Apr 2025 17:33:56 -0700
From: Tony Luck <tony.luck@...el.com>
To: Fenghua Yu <fenghuay@...dia.com>,
Reinette Chatre <reinette.chatre@...el.com>,
Maciej Wieczor-Retman <maciej.wieczor-retman@...el.com>,
Peter Newman <peternewman@...gle.com>,
James Morse <james.morse@....com>,
Babu Moger <babu.moger@....com>,
Drew Fustini <dfustini@...libre.com>,
Dave Martin <Dave.Martin@....com>,
Anil Keshavamurthy <anil.s.keshavamurthy@...el.com>,
Chen Yu <yu.c.chen@...el.com>
Cc: x86@...nel.org,
linux-kernel@...r.kernel.org,
patches@...ts.linux.dev,
Tony Luck <tony.luck@...el.com>
Subject: [PATCH v4 30/31] x86/resctrl: Add info/PERF_PKG_MON/status file
Each telemetry aggregator provides three status registers at the top
end of MMIO space after all the per-RMID per-event counters:
agg_data_loss_count: This counts the number of times that this aggregator
failed to accumulate a counter value supplied by a CPU core.
agg_data_loss_timestamp: This is a "timestamp" from a free running
25MHz uncore timer indicating when the most recent data loss occurred.
last_update_timestamp: Another 25MHz timestamp indicating when the
most recent counter update was successfully applied.
When the resctrl file system is mounted with the "-o debug" option
display the values of each of these status registers for each aggregator
in each enabled event group.
Signed-off-by: Tony Luck <tony.luck@...el.com>
---
arch/x86/kernel/cpu/resctrl/intel_aet.c | 30 +++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/arch/x86/kernel/cpu/resctrl/intel_aet.c b/arch/x86/kernel/cpu/resctrl/intel_aet.c
index eec5eb625f13..80a8af3c4711 100644
--- a/arch/x86/kernel/cpu/resctrl/intel_aet.c
+++ b/arch/x86/kernel/cpu/resctrl/intel_aet.c
@@ -16,6 +16,7 @@
#include <linux/io.h>
#include <linux/minmax.h>
#include <linux/resctrl.h>
+#include <linux/seq_file.h>
/* Temporary - delete from final version */
#include "fake_intel_aet_features.h"
@@ -241,6 +242,33 @@ static bool get_pmt_feature(enum pmt_feature_id feature)
return false;
}
+static void show_debug(struct seq_file *s, struct event_group *e, int pkg, int instance)
+{
+ u64 *info __iomem = e->pkginfo[pkg]->addrs[instance] + e->mmio_size;
+
+ /* Information registers are the last three qwords in MMIO space */
+ seq_printf(s, "%s %d:%d agg_data_loss_count = %llu\n", e->name, pkg, instance,
+ readq(&info[-3]));
+ seq_printf(s, "%s %d:%d agg_data_loss_timestamp = %llu\n", e->name, pkg, instance,
+ readq(&info[-2]));
+ seq_printf(s, "%s %d:%d last_update_timestamp = %llu\n", e->name, pkg, instance,
+ readq(&info[-1]));
+}
+
+static void info_debug(struct seq_file *s)
+{
+ int num_pkgs = topology_max_packages();
+ struct event_group **eg;
+
+ for (eg = &known_event_groups[0]; eg < &known_event_groups[NUM_KNOWN_GROUPS]; eg++) {
+ if (!(*eg)->pfg)
+ continue;
+ for (int i = 0; i < num_pkgs; i++)
+ for (int j = 0; j < (*eg)->pkginfo[i]->count; j++)
+ show_debug(s, *eg, i, j);
+ }
+}
+
/*
* Ask OOBMSM discovery driver for all the RMID based telemetry groups
* that it supports.
@@ -263,6 +291,8 @@ bool intel_aet_get_events(void)
r->num_rmid = (*eg)->num_rmids;
}
+ r->info_debug = info_debug;
+
return ret1 || ret2;
}
--
2.48.1
Powered by blists - more mailing lists