Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 275108
b: refs/heads/master
c: 8866056
h: refs/heads/master
v: v3
  • Loading branch information
Arnaldo Carvalho de Melo committed Nov 2, 2011
1 parent 5796401 commit 82613b6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7b27509fc62686c53e9301560034e6b0b001174d
refs/heads/master: 886605636e656afeb6fad5e83dbf36967f65cfa5
9 changes: 9 additions & 0 deletions trunk/tools/perf/util/session.c
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,7 @@ static void flush_sample_queue(struct perf_session *s,
struct perf_sample sample;
u64 limit = os->next_flush;
u64 last_ts = os->last_sample ? os->last_sample->timestamp : 0ULL;
unsigned idx = 0, progress_next = os->nr_samples / 16;
int ret;

if (!ops->ordered_samples || !limit)
Expand All @@ -521,6 +522,11 @@ static void flush_sample_queue(struct perf_session *s,
os->last_flush = iter->timestamp;
list_del(&iter->list);
list_add(&iter->list, &os->sample_cache);
if (++idx >= progress_next) {
progress_next += os->nr_samples / 16;
ui_progress__update(idx, os->nr_samples,
"Processing time ordered events...");
}
}

if (list_empty(head)) {
Expand All @@ -529,6 +535,8 @@ static void flush_sample_queue(struct perf_session *s,
os->last_sample =
list_entry(head->prev, struct sample_queue, list);
}

os->nr_samples = 0;
}

/*
Expand Down Expand Up @@ -588,6 +596,7 @@ static void __queue_event(struct sample_queue *new, struct perf_session *s)
u64 timestamp = new->timestamp;
struct list_head *p;

++os->nr_samples;
os->last_sample = new;

if (!sample) {
Expand Down
1 change: 1 addition & 0 deletions trunk/tools/perf/util/session.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ struct ordered_samples {
struct sample_queue *sample_buffer;
struct sample_queue *last_sample;
int sample_buffer_idx;
unsigned int nr_samples;
};

struct perf_session {
Expand Down

0 comments on commit 82613b6

Please sign in to comment.