Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 121216
b: refs/heads/master
c: 50cdaf0
h: refs/heads/master
v: v3
  • Loading branch information
Liming Wang authored and Ingo Molnar committed Nov 28, 2008
1 parent 2883d1d commit 38ceffb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 19 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: 65c6dc6adbe7ee0acf207445243400a68c77af15
refs/heads/master: 50cdaf08a8ec1d7f43987705da7aff7cf949708f
27 changes: 10 additions & 17 deletions trunk/kernel/trace/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,6 @@ enum {
#define FTRACE_BUFF_MAX (KSYM_SYMBOL_LEN+4) /* room for wildcards */

struct ftrace_iterator {
loff_t pos;
struct ftrace_page *pg;
unsigned idx;
unsigned flags;
Expand All @@ -811,6 +810,8 @@ t_next(struct seq_file *m, void *v, loff_t *pos)
iter->pg = iter->pg->next;
iter->idx = 0;
goto retry;
} else {
iter->idx = -1;
}
} else {
rec = &iter->pg->records[iter->idx++];
Expand All @@ -833,22 +834,22 @@ t_next(struct seq_file *m, void *v, loff_t *pos)
}
spin_unlock(&ftrace_lock);

iter->pos = *pos;

return rec;
}

static void *t_start(struct seq_file *m, loff_t *pos)
{
struct ftrace_iterator *iter = m->private;
void *p = NULL;
loff_t l = -1;

if (*pos > iter->pos)
*pos = iter->pos;
if (*pos > 0) {
if (iter->idx < 0)
return p;
(*pos)--;
iter->idx--;
}

l = *pos;
p = t_next(m, p, &l);
p = t_next(m, p, pos);

return p;
}
Expand All @@ -859,21 +860,15 @@ static void t_stop(struct seq_file *m, void *p)

static int t_show(struct seq_file *m, void *v)
{
struct ftrace_iterator *iter = m->private;
struct dyn_ftrace *rec = v;
char str[KSYM_SYMBOL_LEN];
int ret = 0;

if (!rec)
return 0;

kallsyms_lookup(rec->ip, NULL, NULL, NULL, str);

ret = seq_printf(m, "%s\n", str);
if (ret < 0) {
iter->pos--;
iter->idx--;
}
seq_printf(m, "%s\n", str);

return 0;
}
Expand All @@ -899,7 +894,6 @@ ftrace_avail_open(struct inode *inode, struct file *file)
return -ENOMEM;

iter->pg = ftrace_pages_start;
iter->pos = 0;

ret = seq_open(file, &show_ftrace_seq_ops);
if (!ret) {
Expand Down Expand Up @@ -986,7 +980,6 @@ ftrace_regex_open(struct inode *inode, struct file *file, int enable)

if (file->f_mode & FMODE_READ) {
iter->pg = ftrace_pages_start;
iter->pos = 0;
iter->flags = enable ? FTRACE_ITER_FILTER :
FTRACE_ITER_NOTRACE;

Expand Down
1 change: 0 additions & 1 deletion trunk/kernel/trace/trace_branch.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include <linux/kallsyms.h>
#include <linux/seq_file.h>
#include <linux/spinlock.h>
#include <linux/irqflags.h>
#include <linux/debugfs.h>
#include <linux/uaccess.h>
#include <linux/module.h>
Expand Down

0 comments on commit 38ceffb

Please sign in to comment.