aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r--kernel/trace/trace.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index bc36febc0771..7f86067d760c 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -2815,10 +2815,6 @@ static struct file_operations tracing_mark_fops = {
2815 2815
2816#ifdef CONFIG_DYNAMIC_FTRACE 2816#ifdef CONFIG_DYNAMIC_FTRACE
2817 2817
2818#define DYN_INFO_BUF_SIZE 1023
2819static char ftrace_dyn_info_buffer[DYN_INFO_BUF_SIZE+1];
2820static DEFINE_MUTEX(dyn_info_mutex);
2821
2822int __weak ftrace_arch_read_dyn_info(char *buf, int size) 2818int __weak ftrace_arch_read_dyn_info(char *buf, int size)
2823{ 2819{
2824 return 0; 2820 return 0;
@@ -2828,14 +2824,17 @@ static ssize_t
2828tracing_read_dyn_info(struct file *filp, char __user *ubuf, 2824tracing_read_dyn_info(struct file *filp, char __user *ubuf,
2829 size_t cnt, loff_t *ppos) 2825 size_t cnt, loff_t *ppos)
2830{ 2826{
2827 static char ftrace_dyn_info_buffer[1024];
2828 static DEFINE_MUTEX(dyn_info_mutex);
2831 unsigned long *p = filp->private_data; 2829 unsigned long *p = filp->private_data;
2832 char *buf = ftrace_dyn_info_buffer; 2830 char *buf = ftrace_dyn_info_buffer;
2831 int size = ARRAY_SIZE(ftrace_dyn_info_buffer);
2833 int r; 2832 int r;
2834 2833
2835 mutex_lock(&dyn_info_mutex); 2834 mutex_lock(&dyn_info_mutex);
2836 r = sprintf(buf, "%ld ", *p); 2835 r = sprintf(buf, "%ld ", *p);
2837 2836
2838 r += ftrace_arch_read_dyn_info(buf+r, DYN_INFO_BUF_SIZE-r); 2837 r += ftrace_arch_read_dyn_info(buf+r, (size-1)-r);
2839 buf[r++] = '\n'; 2838 buf[r++] = '\n';
2840 2839
2841 r = simple_read_from_buffer(ubuf, cnt, ppos, buf, r); 2840 r = simple_read_from_buffer(ubuf, cnt, ppos, buf, r);