Skip to content

Commit 6a9c981

Browse files
committed
ftrace: Remove unused function ftrace_arch_read_dyn_info()
ftrace_arch_read_dyn_info() was used so that archs could add its own debug information into the dyn_ftrace_total_info in the tracefs file system. That file is for debugging usage of dynamic ftrace. No arch uses that function anymore, so just get rid of it. This also allows for tracing_read_dyn_info() to be cleaned up a bit. Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
1 parent fbb789f commit 6a9c981

File tree

1 file changed

+3
-18
lines changed

1 file changed

+3
-18
lines changed

kernel/trace/trace.c

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6737,33 +6737,18 @@ static const struct file_operations tracing_stats_fops = {
67376737

67386738
#ifdef CONFIG_DYNAMIC_FTRACE
67396739

6740-
int __weak ftrace_arch_read_dyn_info(char *buf, int size)
6741-
{
6742-
return 0;
6743-
}
6744-
67456740
static ssize_t
67466741
tracing_read_dyn_info(struct file *filp, char __user *ubuf,
67476742
size_t cnt, loff_t *ppos)
67486743
{
6749-
static char ftrace_dyn_info_buffer[1024];
6750-
static DEFINE_MUTEX(dyn_info_mutex);
67516744
unsigned long *p = filp->private_data;
6752-
char *buf = ftrace_dyn_info_buffer;
6753-
int size = ARRAY_SIZE(ftrace_dyn_info_buffer);
6745+
char buf[64]; /* Not too big for a shallow stack */
67546746
int r;
67556747

6756-
mutex_lock(&dyn_info_mutex);
6757-
r = sprintf(buf, "%ld ", *p);
6758-
6759-
r += ftrace_arch_read_dyn_info(buf+r, (size-1)-r);
6748+
r = scnprintf(buf, 63, "%ld", *p);
67606749
buf[r++] = '\n';
67616750

6762-
r = simple_read_from_buffer(ubuf, cnt, ppos, buf, r);
6763-
6764-
mutex_unlock(&dyn_info_mutex);
6765-
6766-
return r;
6751+
return simple_read_from_buffer(ubuf, cnt, ppos, buf, r);
67676752
}
67686753

67696754
static const struct file_operations tracing_dyn_info_fops = {

0 commit comments

Comments
 (0)