Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 158440
b: refs/heads/master
c: 2fc5f0c
h: refs/heads/master
v: v3
  • Loading branch information
Li Zefan authored and Ingo Molnar committed Aug 17, 2009
1 parent be7eb64 commit 2aacb49
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 23 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: 97d53202a5670a08b79c8ef2e4fff1c1ee21317c
refs/heads/master: 2fc5f0cff4cf1c4cd336d0f61f11bca6eeee1d84
34 changes: 12 additions & 22 deletions trunk/kernel/trace/trace_stack.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,43 +186,33 @@ static const struct file_operations stack_max_size_fops = {
};

static void *
t_next(struct seq_file *m, void *v, loff_t *pos)
__next(struct seq_file *m, loff_t *pos)
{
long i;
long n = *pos - 1;

(*pos)++;

if (v == SEQ_START_TOKEN)
i = 0;
else {
i = *(long *)v;
i++;
}

if (i >= max_stack_trace.nr_entries ||
stack_dump_trace[i] == ULONG_MAX)
if (n >= max_stack_trace.nr_entries || stack_dump_trace[n] == ULONG_MAX)
return NULL;

m->private = (void *)i;

m->private = (void *)n;
return &m->private;
}

static void *t_start(struct seq_file *m, loff_t *pos)
static void *
t_next(struct seq_file *m, void *v, loff_t *pos)
{
void *t = SEQ_START_TOKEN;
loff_t l = 0;
(*pos)++;
return __next(m, pos);
}

static void *t_start(struct seq_file *m, loff_t *pos)
{
local_irq_disable();
__raw_spin_lock(&max_stack_lock);

if (*pos == 0)
return SEQ_START_TOKEN;

for (; t && l < *pos; t = t_next(m, t, &l))
;

return t;
return __next(m, pos);
}

static void t_stop(struct seq_file *m, void *p)
Expand Down

0 comments on commit 2aacb49

Please sign in to comment.