Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 100571
b: refs/heads/master
c: eb9a7bf
h: refs/heads/master
i:
  100569: b7c9923
  100567: 522d644
v: v3
  • Loading branch information
Abhishek Sagar authored and Ingo Molnar committed Jun 10, 2008
1 parent ca7a46e commit 63a6025
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 2 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: 1d74f2a0f64b4091e5e91b55ac1b17dff93f4b59
refs/heads/master: eb9a7bf09172f409c10ec9560adeea95bb4045f5
40 changes: 39 additions & 1 deletion trunk/kernel/trace/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,7 @@ enum {
FTRACE_ITER_FILTER = (1 << 0),
FTRACE_ITER_CONT = (1 << 1),
FTRACE_ITER_NOTRACE = (1 << 2),
FTRACE_ITER_FAILURES = (1 << 3),
};

#define FTRACE_BUFF_MAX (KSYM_SYMBOL_LEN+4) /* room for wildcards */
Expand Down Expand Up @@ -799,9 +800,16 @@ t_next(struct seq_file *m, void *v, loff_t *pos)
}
} else {
rec = &iter->pg->records[iter->idx++];
if ((rec->flags & FTRACE_FL_FAILED) ||
if ((!(iter->flags & FTRACE_ITER_FAILURES) &&
(rec->flags & FTRACE_FL_FAILED)) ||

((iter->flags & FTRACE_ITER_FAILURES) &&
(!(rec->flags & FTRACE_FL_FAILED) ||
(rec->flags & FTRACE_FL_FREE))) ||

((iter->flags & FTRACE_ITER_FILTER) &&
!(rec->flags & FTRACE_FL_FILTER)) ||

((iter->flags & FTRACE_ITER_NOTRACE) &&
!(rec->flags & FTRACE_FL_NOTRACE))) {
rec = NULL;
Expand Down Expand Up @@ -896,6 +904,24 @@ int ftrace_avail_release(struct inode *inode, struct file *file)
return 0;
}

static int
ftrace_failures_open(struct inode *inode, struct file *file)
{
int ret;
struct seq_file *m;
struct ftrace_iterator *iter;

ret = ftrace_avail_open(inode, file);
if (!ret) {
m = (struct seq_file *)file->private_data;
iter = (struct ftrace_iterator *)m->private;
iter->flags = FTRACE_ITER_FAILURES;
}

return ret;
}


static void ftrace_filter_reset(int enable)
{
struct ftrace_page *pg;
Expand Down Expand Up @@ -1309,6 +1335,13 @@ static struct file_operations ftrace_avail_fops = {
.release = ftrace_avail_release,
};

static struct file_operations ftrace_failures_fops = {
.open = ftrace_failures_open,
.read = seq_read,
.llseek = seq_lseek,
.release = ftrace_avail_release,
};

static struct file_operations ftrace_filter_fops = {
.open = ftrace_filter_open,
.read = ftrace_regex_read,
Expand Down Expand Up @@ -1386,6 +1419,11 @@ static __init int ftrace_init_debugfs(void)
pr_warning("Could not create debugfs "
"'available_filter_functions' entry\n");

entry = debugfs_create_file("failures", 0444,
d_tracer, NULL, &ftrace_failures_fops);
if (!entry)
pr_warning("Could not create debugfs 'failures' entry\n");

entry = debugfs_create_file("set_ftrace_filter", 0644, d_tracer,
NULL, &ftrace_filter_fops);
if (!entry)
Expand Down

0 comments on commit 63a6025

Please sign in to comment.