Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 146155
b: refs/heads/master
c: c142b15
h: refs/heads/master
i:
  146153: a96d458
  146151: c58c7aa
v: v3
  • Loading branch information
Li Zefan authored and Ingo Molnar committed May 8, 2009
1 parent e83cde5 commit 7748c67
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 35 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: 8f31bfe538ebafac187d2d4465a92e1d9ee6d8c2
refs/heads/master: c142b15dc56ee6d55cb97a062e3c8e9c61e384c0
40 changes: 6 additions & 34 deletions trunk/kernel/trace/trace_events.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,10 +414,11 @@ static ssize_t
system_enable_read(struct file *filp, char __user *ubuf, size_t cnt,
loff_t *ppos)
{
const char set_to_char[4] = { '?', '0', '1', 'X' };
const char *system = filp->private_data;
struct ftrace_event_call *call;
char buf[2];
int set = -1;
int set = 0;
int ret;

mutex_lock(&event_mutex);
Expand All @@ -433,47 +434,18 @@ system_enable_read(struct file *filp, char __user *ubuf, size_t cnt,
* or if all events or cleared, or if we have
* a mixture.
*/
if (call->enabled) {
switch (set) {
case -1:
set = 1;
break;
case 0:
set = 2;
break;
}
} else {
switch (set) {
case -1:
set = 0;
break;
case 1:
set = 2;
break;
}
}
set |= (1 << !!call->enabled);

/*
* If we have a mixture, no need to look further.
*/
if (set == 2)
if (set == 3)
break;
}
mutex_unlock(&event_mutex);

buf[0] = set_to_char[set];
buf[1] = '\n';
switch (set) {
case 0:
buf[0] = '0';
break;
case 1:
buf[0] = '1';
break;
case 2:
buf[0] = 'X';
break;
default:
buf[0] = '?';
}

ret = simple_read_from_buffer(ubuf, cnt, ppos, buf, 2);

Expand Down

0 comments on commit 7748c67

Please sign in to comment.