[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250407234032.241215-13-tony.luck@intel.com>
Date: Mon, 7 Apr 2025 16:40:14 -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>
Cc: linux-kernel@...r.kernel.org,
patches@...ts.linux.dev,
Tony Luck <tony.luck@...el.com>
Subject: [PATCH v3 12/26] fs/resctrl: Add hook for architecture code to set monitor event attributes
Architecture code knows whether an event can be read from any CPU, or
from a CPU on a specific domain. It also knows what format to use
when printing each event value.
Add a hook to set mon_event.any_cpu and mon_event.type.
Signed-off-by: Tony Luck <tony.luck@...el.com>
---
include/linux/resctrl.h | 3 +++
fs/resctrl/monitor.c | 12 ++++++++++++
2 files changed, 15 insertions(+)
diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h
index 0fce626605b9..8ac77b738de5 100644
--- a/include/linux/resctrl.h
+++ b/include/linux/resctrl.h
@@ -418,6 +418,9 @@ void resctrl_offline_mon_domain(struct rdt_resource *r, struct rdt_mon_domain *d
void resctrl_online_cpu(unsigned int cpu);
void resctrl_offline_cpu(unsigned int cpu);
+int resctrl_set_event_attributes(enum resctrl_event_id evt,
+ enum resctrl_event_type type, bool any_cpu);
+
/**
* resctrl_arch_rmid_read() - Read the eventid counter corresponding to rmid
* for this resource and domain.
diff --git a/fs/resctrl/monitor.c b/fs/resctrl/monitor.c
index 1efad57d1d85..5846a13c631a 100644
--- a/fs/resctrl/monitor.c
+++ b/fs/resctrl/monitor.c
@@ -863,6 +863,18 @@ static struct mon_evt all_events[QOS_NUM_EVENTS] = {
},
};
+int resctrl_set_event_attributes(enum resctrl_event_id evt,
+ enum resctrl_event_type type, bool any_cpu)
+{
+ if (evt >= QOS_NUM_EVENTS)
+ return -ENOENT;
+
+ all_events[evt].type = type;
+ all_events[evt].any_cpu = any_cpu;
+
+ return 0;
+}
+
int rdt_lookup_evtid_by_name(char *name)
{
int evt;
--
2.48.1
Powered by blists - more mailing lists