[PATCH] kernel/profile: remove setup_profiling_timer

From: Anthony Iliopoulos

Date: Fri Aug 21 2026 - 05:41:38 EST


No architecture uses setup_profiling_timer() at this point for setting a
multiplier, so it can be safely removed. This allows arch-specific stub
functions to be cleaned up in subsequent commits.

There are no functional changes, as writing to /proc/profile will still
reset the counters.

Signed-off-by: Anthony Iliopoulos <ailiop@xxxxxxxx>
---
include/linux/profile.h | 1 -
kernel/profile.c | 20 --------------------
2 files changed, 21 deletions(-)

diff --git a/include/linux/profile.h b/include/linux/profile.h
index 3f53cdb0c27c..68edf60173b9 100644
--- a/include/linux/profile.h
+++ b/include/linux/profile.h
@@ -32,7 +32,6 @@ extern int prof_on __read_mostly;
int profile_init(void);
int profile_setup(char *str);
void profile_tick(int type);
-int setup_profiling_timer(unsigned int multiplier);

/*
* Add multiple profiler hits to a given address:
diff --git a/kernel/profile.c b/kernel/profile.c
index 1fcf1adcf4eb..5002ea558951 100644
--- a/kernel/profile.c
+++ b/kernel/profile.c
@@ -177,32 +177,12 @@ read_profile(struct file *file, char __user *buf, size_t count, loff_t *ppos)
return read;
}

-/* default is to not implement this call */
-int __weak setup_profiling_timer(unsigned mult)
-{
- return -EINVAL;
-}
-
/*
* Writing to /proc/profile resets the counters
- *
- * Writing a 'profiling multiplier' value into it also re-sets the profiling
- * interrupt frequency, on architectures that support this.
*/
static ssize_t write_profile(struct file *file, const char __user *buf,
size_t count, loff_t *ppos)
{
-#ifdef CONFIG_SMP
- if (count == sizeof(int)) {
- unsigned int multiplier;
-
- if (copy_from_user(&multiplier, buf, sizeof(int)))
- return -EFAULT;
-
- if (setup_profiling_timer(multiplier))
- return -EINVAL;
- }
-#endif
memset(prof_buffer, 0, prof_len * sizeof(atomic_t));
return count;
}
--
2.55.0