Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 141030
b: refs/heads/master
c: 0983352
h: refs/heads/master
v: v3
  • Loading branch information
Steven Rostedt committed Mar 24, 2009
1 parent e2cf50e commit 7ca81d1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 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: 45b9560895b07a4a09d55d49235c984db512c5aa
refs/heads/master: 098335215a4921a8a54193829eaed602dca24df5
23 changes: 13 additions & 10 deletions trunk/kernel/trace/trace_stat.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ static int stat_seq_init(struct tracer_stat_session *session)
{
struct trace_stat_list *iter_entry, *new_entry;
struct tracer_stat *ts = session->ts;
void *prev_stat;
void *stat;
int ret = 0;
int i;

Expand All @@ -85,6 +85,10 @@ static int stat_seq_init(struct tracer_stat_session *session)
if (!ts->stat_cmp)
ts->stat_cmp = dummy_cmp;

stat = ts->stat_start();
if (!stat)
goto exit;

/*
* The first entry. Actually this is the second, but the first
* one (the stat_list head) is pointless.
Expand All @@ -99,26 +103,27 @@ static int stat_seq_init(struct tracer_stat_session *session)

list_add(&new_entry->list, &session->stat_list);

new_entry->stat = ts->stat_start();
prev_stat = new_entry->stat;
new_entry->stat = stat;

/*
* Iterate over the tracer stat entries and store them in a sorted
* list.
*/
for (i = 1; ; i++) {
stat = ts->stat_next(stat, i);

/* End of insertion */
if (!stat)
break;

new_entry = kmalloc(sizeof(struct trace_stat_list), GFP_KERNEL);
if (!new_entry) {
ret = -ENOMEM;
goto exit_free_list;
}

INIT_LIST_HEAD(&new_entry->list);
new_entry->stat = ts->stat_next(prev_stat, i);

/* End of insertion */
if (!new_entry->stat)
break;
new_entry->stat = stat;

list_for_each_entry(iter_entry, &session->stat_list, list) {

Expand All @@ -137,8 +142,6 @@ static int stat_seq_init(struct tracer_stat_session *session)
break;
}
}

prev_stat = new_entry->stat;
}
exit:
mutex_unlock(&session->stat_mutex);
Expand Down

0 comments on commit 7ca81d1

Please sign in to comment.