Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 121313
b: refs/heads/master
c: 34f3a81
h: refs/heads/master
i:
  121311: 882c8ed
v: v3
  • Loading branch information
Li Zefan authored and Ingo Molnar committed Oct 30, 2008
1 parent 3c05441 commit f0025f4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 37 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: eab172294d5e24464f332dd8e94a57a9819c81c4
refs/heads/master: 34f3a814eef8069a24e5b3ebcf27aba9dabac2ea
52 changes: 16 additions & 36 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -703,45 +703,18 @@ static __read_mostly char *sched_feat_names[] = {

#undef SCHED_FEAT

static int sched_feat_open(struct inode *inode, struct file *filp)
static int sched_feat_show(struct seq_file *m, void *v)
{
filp->private_data = inode->i_private;
return 0;
}

static ssize_t
sched_feat_read(struct file *filp, char __user *ubuf,
size_t cnt, loff_t *ppos)
{
char *buf;
int r = 0;
int len = 0;
int i;

for (i = 0; sched_feat_names[i]; i++) {
len += strlen(sched_feat_names[i]);
len += 4;
if (!(sysctl_sched_features & (1UL << i)))
seq_puts(m, "NO_");
seq_printf(m, "%s ", sched_feat_names[i]);
}
seq_puts(m, "\n");

buf = kmalloc(len + 2, GFP_KERNEL);
if (!buf)
return -ENOMEM;

for (i = 0; sched_feat_names[i]; i++) {
if (sysctl_sched_features & (1UL << i))
r += sprintf(buf + r, "%s ", sched_feat_names[i]);
else
r += sprintf(buf + r, "NO_%s ", sched_feat_names[i]);
}

r += sprintf(buf + r, "\n");
WARN_ON(r >= len + 2);

r = simple_read_from_buffer(ubuf, cnt, ppos, buf, r);

kfree(buf);

return r;
return 0;
}

static ssize_t
Expand Down Expand Up @@ -786,10 +759,17 @@ sched_feat_write(struct file *filp, const char __user *ubuf,
return cnt;
}

static int sched_feat_open(struct inode *inode, struct file *filp)
{
return single_open(filp, sched_feat_show, NULL);
}

static struct file_operations sched_feat_fops = {
.open = sched_feat_open,
.read = sched_feat_read,
.write = sched_feat_write,
.open = sched_feat_open,
.write = sched_feat_write,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};

static __init int sched_init_debug(void)
Expand Down

0 comments on commit f0025f4

Please sign in to comment.