ftrace: nmi safe code clean ups

Impact: cleanup

This patch cleans up the NMI safe code for dynamic ftrace as suggested
by Andrew Morton.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
Steven Rostedt
2008-10-31 00:03:22 -04:00
committed by Ingo Molnar
parent b807c3d0f8
commit a26a2a2739
8 changed files with 28 additions and 26 deletions

View File

@@ -2815,10 +2815,6 @@ static struct file_operations tracing_mark_fops = {
#ifdef CONFIG_DYNAMIC_FTRACE
#define DYN_INFO_BUF_SIZE 1023
static char ftrace_dyn_info_buffer[DYN_INFO_BUF_SIZE+1];
static DEFINE_MUTEX(dyn_info_mutex);
int __weak ftrace_arch_read_dyn_info(char *buf, int size)
{
return 0;
@@ -2828,14 +2824,17 @@ static ssize_t
tracing_read_dyn_info(struct file *filp, char __user *ubuf,
size_t cnt, loff_t *ppos)
{
static char ftrace_dyn_info_buffer[1024];
static DEFINE_MUTEX(dyn_info_mutex);
unsigned long *p = filp->private_data;
char *buf = ftrace_dyn_info_buffer;
int size = ARRAY_SIZE(ftrace_dyn_info_buffer);
int r;
mutex_lock(&dyn_info_mutex);
r = sprintf(buf, "%ld ", *p);
r += ftrace_arch_read_dyn_info(buf+r, DYN_INFO_BUF_SIZE-r);
r += ftrace_arch_read_dyn_info(buf+r, (size-1)-r);
buf[r++] = '\n';
r = simple_read_from_buffer(ubuf, cnt, ppos, buf, r);