提交 7d63e635 编写于 作者: L Linus Torvalds

Merge branch 'tracing-fixes-for-linus' of...

Merge branch 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  tracing: Fix too large stack usage in do_one_initcall()
  tracing: handle broken names in ftrace filter
  ftrace: Unify effect of writing to trace_options and option/*
...@@ -733,13 +733,14 @@ static void __init do_ctors(void) ...@@ -733,13 +733,14 @@ static void __init do_ctors(void)
int initcall_debug; int initcall_debug;
core_param(initcall_debug, initcall_debug, bool, 0644); core_param(initcall_debug, initcall_debug, bool, 0644);
static char msgbuf[64];
static struct boot_trace_call call;
static struct boot_trace_ret ret;
int do_one_initcall(initcall_t fn) int do_one_initcall(initcall_t fn)
{ {
int count = preempt_count(); int count = preempt_count();
ktime_t calltime, delta, rettime; ktime_t calltime, delta, rettime;
char msgbuf[64];
struct boot_trace_call call;
struct boot_trace_ret ret;
if (initcall_debug) { if (initcall_debug) {
call.caller = task_pid_nr(current); call.caller = task_pid_nr(current);
......
...@@ -2278,7 +2278,11 @@ ftrace_regex_write(struct file *file, const char __user *ubuf, ...@@ -2278,7 +2278,11 @@ ftrace_regex_write(struct file *file, const char __user *ubuf,
read++; read++;
cnt--; cnt--;
if (!(iter->flags & ~FTRACE_ITER_CONT)) { /*
* If the parser haven't finished with the last write,
* continue reading the user input without skipping spaces.
*/
if (!(iter->flags & FTRACE_ITER_CONT)) {
/* skip white space */ /* skip white space */
while (cnt && isspace(ch)) { while (cnt && isspace(ch)) {
ret = get_user(ch, ubuf++); ret = get_user(ch, ubuf++);
...@@ -2288,8 +2292,9 @@ ftrace_regex_write(struct file *file, const char __user *ubuf, ...@@ -2288,8 +2292,9 @@ ftrace_regex_write(struct file *file, const char __user *ubuf,
cnt--; cnt--;
} }
/* only spaces were written */
if (isspace(ch)) { if (isspace(ch)) {
file->f_pos += read; *ppos += read;
ret = read; ret = read;
goto out; goto out;
} }
...@@ -2319,12 +2324,12 @@ ftrace_regex_write(struct file *file, const char __user *ubuf, ...@@ -2319,12 +2324,12 @@ ftrace_regex_write(struct file *file, const char __user *ubuf,
if (ret) if (ret)
goto out; goto out;
iter->buffer_idx = 0; iter->buffer_idx = 0;
} else } else {
iter->flags |= FTRACE_ITER_CONT; iter->flags |= FTRACE_ITER_CONT;
iter->buffer[iter->buffer_idx++] = ch;
}
*ppos += read;
file->f_pos += read;
ret = read; ret = read;
out: out:
mutex_unlock(&ftrace_regex_lock); mutex_unlock(&ftrace_regex_lock);
......
...@@ -3896,17 +3896,9 @@ trace_options_core_write(struct file *filp, const char __user *ubuf, size_t cnt, ...@@ -3896,17 +3896,9 @@ trace_options_core_write(struct file *filp, const char __user *ubuf, size_t cnt,
if (ret < 0) if (ret < 0)
return ret; return ret;
switch (val) { if (val != 0 && val != 1)
case 0:
trace_flags &= ~(1 << index);
break;
case 1:
trace_flags |= 1 << index;
break;
default:
return -EINVAL; return -EINVAL;
} set_tracer_flags(1 << index, val);
*ppos += cnt; *ppos += cnt;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册