Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 119157
b: refs/heads/master
c: 5821e1b
h: refs/heads/master
i:
  119155: c9a03d2
v: v3
  • Loading branch information
walimis authored and Ingo Molnar committed Nov 16, 2008
1 parent 3b1f069 commit 10ee1d9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 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: ee51a1de7e3837577412be269e0100038068e691
refs/heads/master: 5821e1b74f0d08952cb5da4bfd2d9a388d8df58e
26 changes: 15 additions & 11 deletions trunk/kernel/trace/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ static int __init ftrace_dyn_table_alloc(unsigned long num_to_init)

cnt = num_to_init / ENTRIES_PER_PAGE;
pr_info("ftrace: allocating %ld entries in %d pages\n",
num_to_init, cnt);
num_to_init, cnt + 1);

for (i = 0; i < cnt; i++) {
pg->next = (void *)get_zeroed_page(GFP_KERNEL);
Expand Down Expand Up @@ -753,13 +753,11 @@ static void *t_start(struct seq_file *m, loff_t *pos)
void *p = NULL;
loff_t l = -1;

if (*pos != iter->pos) {
for (p = t_next(m, p, &l); p && l < *pos; p = t_next(m, p, &l))
;
} else {
l = *pos;
p = t_next(m, p, &l);
}
if (*pos > iter->pos)
*pos = iter->pos;

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

return p;
}
Expand All @@ -770,15 +768,21 @@ 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);

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

return 0;
}
Expand All @@ -804,7 +808,7 @@ ftrace_avail_open(struct inode *inode, struct file *file)
return -ENOMEM;

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

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

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

Expand Down

0 comments on commit 10ee1d9

Please sign in to comment.