From: linux@treblig.org
To: irogers@google.com, mark.rutland@arm.com,
alexander.shishkin@linux.intel.com, jolsa@kernel.org,
adrian.hunter@intel.com, kan.liang@linux.intel.com,
namhyung@kernel.org
Cc: peterz@infradead.org, mingo@redhat.com, acme@kernel.org,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
"Dr. David Alan Gilbert" <linux@treblig.org>
Subject: [PATCH 1/6] perf core: Remove perf_event_attrs and perf_event_refresh
Date: Wed, 5 Mar 2025 02:31:15 +0000 [thread overview]
Message-ID: <20250305023120.155420-2-linux@treblig.org> (raw)
In-Reply-To: <20250305023120.155420-1-linux@treblig.org>
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>
---
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 8333f132f4a9..3ed023e63d6a 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -1136,7 +1136,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);
@@ -1147,7 +1146,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);
extern struct perf_event *
@@ -1841,10 +1839,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)
{
@@ -1853,10 +1847,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 bcb09e011e9e..c3d9ad84bb52 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -3224,22 +3224,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)
{
@@ -13639,14 +13623,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(struct perf_event_attr *attr)
{
if (sysctl_perf_event_paranoid > 1 && !perfmon_capable())
--
2.48.1
next prev parent reply other threads:[~2025-03-05 2:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-05 2:31 [PATCH 0/6] perf: Deadcode - the P's linux
2025-03-05 2:31 ` linux [this message]
2025-03-05 2:31 ` [PATCH 2/6] perf util: Remove unused perf_color_default_config linux
2025-03-05 2:31 ` [PATCH 3/6] perf util: Remove unused pstack__pop linux
2025-03-05 2:31 ` [PATCH 4/6] perf util: Remove unused perf_data__update_dir linux
2025-03-05 2:31 ` [PATCH 5/6] perf util: Remove unused perf_pmus__default_pmu_name linux
2025-03-05 2:31 ` [PATCH 6/6] perf util: Remove unused perf_config__refresh linux
2025-03-06 7:17 ` [PATCH 0/6] perf: Deadcode - the P's Ian Rogers
2025-03-06 13:13 ` Dr. David Alan Gilbert
2025-03-11 16:11 ` (subset) " Namhyung Kim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250305023120.155420-2-linux@treblig.org \
--to=linux@treblig.org \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).