Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 158439
b: refs/heads/master
c: 97d5320
h: refs/heads/master
i:
  158437: 9d939e6
  158435: 7185fc3
  158431: 2457e4d
v: v3
  • Loading branch information
Li Zefan authored and Ingo Molnar committed Aug 17, 2009
1 parent 4a16dfe commit be7eb64
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 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: ba8b3a40ba7e06d00c27508f090803af90e8dbbf
refs/heads/master: 97d53202a5670a08b79c8ef2e4fff1c1ee21317c
10 changes: 7 additions & 3 deletions trunk/kernel/trace/trace_stat.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,17 +203,21 @@ static void *stat_seq_start(struct seq_file *s, loff_t *pos)
{
struct stat_session *session = s->private;
struct rb_node *node;
int n = *pos;
int i;

/* Prevent from tracer switch or rbtree modification */
mutex_lock(&session->stat_mutex);

/* If we are in the beginning of the file, print the headers */
if (!*pos && session->ts->stat_headers)
return SEQ_START_TOKEN;
if (session->ts->stat_headers) {
if (n == 0)
return SEQ_START_TOKEN;
n--;
}

node = rb_first(&session->stat_root);
for (i = 0; node && i < *pos; i++)
for (i = 0; node && i < n; i++)
node = rb_next(node);

return node;
Expand Down

0 comments on commit be7eb64

Please sign in to comment.