Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 141038
b: refs/heads/master
c: 220ba35
h: refs/heads/master
v: v3
  • Loading branch information
Lai Jiangshan authored and Ingo Molnar committed Mar 25, 2009
1 parent d5cef83 commit ad32f7e
Show file tree
Hide file tree
Showing 2 changed files with 9 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: e6f489013b985b58d096a3091ece0ed579367232
refs/heads/master: 220ba351dfa57eca4bec5ce0098a276446a47958
18 changes: 8 additions & 10 deletions trunk/kernel/trace/trace_stat.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,23 +125,21 @@ static int stat_seq_init(struct tracer_stat_session *session)
INIT_LIST_HEAD(&new_entry->list);
new_entry->stat = stat;

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

/* Insertion with a descendent sorting */
if (ts->stat_cmp(new_entry->stat,
iter_entry->stat) > 0) {
if (ts->stat_cmp(iter_entry->stat,
new_entry->stat) >= 0) {

list_add_tail(&new_entry->list,
&iter_entry->list);
break;

/* The current smaller value */
} else if (list_is_last(&iter_entry->list,
&session->stat_list)) {
list_add(&new_entry->list, &iter_entry->list);
break;
}
}

/* The current larger value */
if (list_empty(&new_entry->list))
list_add(&new_entry->list, &session->stat_list);
}
exit:
mutex_unlock(&session->stat_mutex);
Expand Down

0 comments on commit ad32f7e

Please sign in to comment.