Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 177343
b: refs/heads/master
c: 13f16d2
h: refs/heads/master
i:
  177341: c8a5f39
  177339: 66dd756
  177335: 1b1894c
  177327: d69f5c7
  177311: fb4ca35
  177279: 00084cf
v: v3
  • Loading branch information
Li Zefan authored and Frederic Weisbecker committed Dec 13, 2009
1 parent 174840b commit 5efb123
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 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: fdb372ed4cadbfe9dbba0e932a77d0523682e690
refs/heads/master: 13f16d209161c95e92aef40e350cc6cf56ac440b
24 changes: 15 additions & 9 deletions trunk/kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -3366,21 +3366,18 @@ tracing_mark_write(struct file *filp, const char __user *ubuf,
return cnt;
}

static ssize_t tracing_clock_read(struct file *filp, char __user *ubuf,
size_t cnt, loff_t *ppos)
static int tracing_clock_show(struct seq_file *m, void *v)
{
char buf[64];
int bufiter = 0;
int i;

for (i = 0; i < ARRAY_SIZE(trace_clocks); i++)
bufiter += snprintf(buf + bufiter, sizeof(buf) - bufiter,
seq_printf(m,
"%s%s%s%s", i ? " " : "",
i == trace_clock_id ? "[" : "", trace_clocks[i].name,
i == trace_clock_id ? "]" : "");
bufiter += snprintf(buf + bufiter, sizeof(buf) - bufiter, "\n");
seq_putc(m, '\n');

return simple_read_from_buffer(ubuf, cnt, ppos, buf, bufiter);
return 0;
}

static ssize_t tracing_clock_write(struct file *filp, const char __user *ubuf,
Expand Down Expand Up @@ -3422,6 +3419,13 @@ static ssize_t tracing_clock_write(struct file *filp, const char __user *ubuf,
return cnt;
}

static int tracing_clock_open(struct inode *inode, struct file *file)
{
if (tracing_disabled)
return -ENODEV;
return single_open(file, tracing_clock_show, NULL);
}

static const struct file_operations tracing_max_lat_fops = {
.open = tracing_open_generic,
.read = tracing_max_lat_read,
Expand Down Expand Up @@ -3460,8 +3464,10 @@ static const struct file_operations tracing_mark_fops = {
};

static const struct file_operations trace_clock_fops = {
.open = tracing_open_generic,
.read = tracing_clock_read,
.open = tracing_clock_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
.write = tracing_clock_write,
};

Expand Down

0 comments on commit 5efb123

Please sign in to comment.