Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 162951
b: refs/heads/master
c: 4896636
h: refs/heads/master
i:
  162949: 8f99ec3
  162947: 83b27a1
  162943: 60cebe3
v: v3
  • Loading branch information
jolsa@redhat.com authored and Steven Rostedt committed Sep 11, 2009
1 parent 383a79d commit 4a0ef65
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 48 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b63f39ea50330f836e301ddda21c6a93dcf0d6a3
refs/heads/master: 489663644c35d50a20f58d468a7cbc705e6a29ce
60 changes: 13 additions & 47 deletions trunk/kernel/trace/trace_events.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,9 @@ static ssize_t
ftrace_event_write(struct file *file, const char __user *ubuf,
size_t cnt, loff_t *ppos)
{
struct trace_parser parser;
size_t read = 0;
int i, set = 1;
ssize_t ret;
char *buf;
char ch;

if (!cnt || cnt < 0)
return 0;
Expand All @@ -243,60 +241,28 @@ ftrace_event_write(struct file *file, const char __user *ubuf,
if (ret < 0)
return ret;

ret = get_user(ch, ubuf++);
if (ret)
return ret;
read++;
cnt--;

/* skip white space */
while (cnt && isspace(ch)) {
ret = get_user(ch, ubuf++);
if (ret)
return ret;
read++;
cnt--;
}

/* Only white space found? */
if (isspace(ch)) {
file->f_pos += read;
ret = read;
return ret;
}

buf = kmalloc(EVENT_BUF_SIZE+1, GFP_KERNEL);
if (!buf)
if (trace_parser_get_init(&parser, EVENT_BUF_SIZE + 1))
return -ENOMEM;

if (cnt > EVENT_BUF_SIZE)
cnt = EVENT_BUF_SIZE;
read = trace_get_user(&parser, ubuf, cnt, ppos);

if (trace_parser_loaded((&parser))) {
int set = 1;

i = 0;
while (cnt && !isspace(ch)) {
if (!i && ch == '!')
if (*parser.buffer == '!')
set = 0;
else
buf[i++] = ch;

ret = get_user(ch, ubuf++);
parser.buffer[parser.idx] = 0;

ret = ftrace_set_clr_event(parser.buffer + !set, set);
if (ret)
goto out_free;
read++;
cnt--;
goto out_put;
}
buf[i] = 0;

file->f_pos += read;

ret = ftrace_set_clr_event(buf, set);
if (ret)
goto out_free;

ret = read;

out_free:
kfree(buf);
out_put:
trace_parser_put(&parser);

return ret;
}
Expand Down

0 comments on commit 4a0ef65

Please sign in to comment.