linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf core: Remove perf_event_attrs and perf_event_refresh
@ 2025-07-16 13:51 linux
  0 siblings, 0 replies; only message in thread
From: linux @ 2025-07-16 13:51 UTC (permalink / raw)
  To: mingo, acme, namhyung, irogers, peterz
  Cc: alexander.shishkin, jolsa, adrian.hunter, kan.liang,
	linux-perf-users, linux-kernel, Dr. David Alan Gilbert

From: "Dr. David Alan Gilbert" <linux@treblig.org>

perf_event_refresh() has been unused since the 2015
commit f63a8daa5812 ("perf: Fix event->ctx locking")

perf_event_attrs() has been unused since the 2017
commit f91840a32dee ("perf, bpf: Add BPF support to all perf_event types")
(Note the _ prefix version is still used)

Remove them.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
  This was originally sent as part of a set with a load of tools/perf
  cleanups, Ian pointed out it needed to be separate.

 include/linux/perf_event.h | 10 ----------
 kernel/events/core.c       | 24 ------------------------
 2 files changed, 34 deletions(-)

diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index ec9d96025683..4cecd5122404 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -1224,7 +1224,6 @@ extern void perf_event_free_task(struct task_struct *task);
 extern void perf_event_delayed_put(struct task_struct *task);
 extern struct file *perf_event_get(unsigned int fd);
 extern const struct perf_event *perf_get_event(struct file *file);
-extern const struct perf_event_attr *perf_event_attrs(struct perf_event *event);
 extern void perf_event_print_debug(void);
 extern void perf_pmu_disable(struct pmu *pmu);
 extern void perf_pmu_enable(struct pmu *pmu);
@@ -1235,7 +1234,6 @@ extern int perf_event_task_enable(void);
 
 extern void perf_pmu_resched(struct pmu *pmu);
 
-extern int perf_event_refresh(struct perf_event *event, int refresh);
 extern void perf_event_update_userpage(struct perf_event *event);
 extern int perf_event_release_kernel(struct perf_event *event);
 
@@ -1945,10 +1943,6 @@ static inline const struct perf_event *perf_get_event(struct file *file)
 {
 	return ERR_PTR(-EINVAL);
 }
-static inline const struct perf_event_attr *perf_event_attrs(struct perf_event *event)
-{
-	return ERR_PTR(-EINVAL);
-}
 static inline int perf_event_read_local(struct perf_event *event, u64 *value,
 					u64 *enabled, u64 *running)
 {
@@ -1957,10 +1951,6 @@ static inline int perf_event_read_local(struct perf_event *event, u64 *value,
 static inline void perf_event_print_debug(void)				{ }
 static inline int perf_event_task_disable(void)				{ return -EINVAL; }
 static inline int perf_event_task_enable(void)				{ return -EINVAL; }
-static inline int perf_event_refresh(struct perf_event *event, int refresh)
-{
-	return -EINVAL;
-}
 
 static inline void
 perf_sw_event(u32 event_id, u64 nr, struct pt_regs *regs, u64 addr)	{ }
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 22fdf0c187cd..4b84e808eef7 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -3340,22 +3340,6 @@ static int _perf_event_refresh(struct perf_event *event, int refresh)
 	return 0;
 }
 
-/*
- * See perf_event_disable()
- */
-int perf_event_refresh(struct perf_event *event, int refresh)
-{
-	struct perf_event_context *ctx;
-	int ret;
-
-	ctx = perf_event_ctx_lock(event);
-	ret = _perf_event_refresh(event, refresh);
-	perf_event_ctx_unlock(event, ctx);
-
-	return ret;
-}
-EXPORT_SYMBOL_GPL(perf_event_refresh);
-
 static int perf_event_modify_breakpoint(struct perf_event *bp,
 					 struct perf_event_attr *attr)
 {
@@ -14196,14 +14180,6 @@ const struct perf_event *perf_get_event(struct file *file)
 	return file->private_data;
 }
 
-const struct perf_event_attr *perf_event_attrs(struct perf_event *event)
-{
-	if (!event)
-		return ERR_PTR(-EINVAL);
-
-	return &event->attr;
-}
-
 int perf_allow_kernel(void)
 {
 	if (sysctl_perf_event_paranoid > 1 && !perfmon_capable())
-- 
2.50.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2025-07-16 13:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-16 13:51 [PATCH] perf core: Remove perf_event_attrs and perf_event_refresh linux

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).