Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 323748
b: refs/heads/master
c: d25380c
h: refs/heads/master
v: v3
  • Loading branch information
David Ahern authored and Arnaldo Carvalho de Melo committed Sep 5, 2012
1 parent 759bc93 commit 355c71a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 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: ff1a70e75fd005821ab5f2211312a8aa13bbf959
refs/heads/master: d25380cd3be38baff4ab31935b9d19b7f58ba7ac
24 changes: 15 additions & 9 deletions trunk/tools/perf/util/session.c
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ static int perf_session_deliver_event(struct perf_session *session,
struct perf_tool *tool,
u64 file_offset);

static void flush_sample_queue(struct perf_session *s,
static int flush_sample_queue(struct perf_session *s,
struct perf_tool *tool)
{
struct ordered_samples *os = &s->ordered_samples;
Expand All @@ -705,7 +705,7 @@ static void flush_sample_queue(struct perf_session *s,
int ret;

if (!tool->ordered_samples || !limit)
return;
return 0;

list_for_each_entry_safe(iter, tmp, head, list) {
if (iter->timestamp > limit)
Expand All @@ -715,9 +715,12 @@ static void flush_sample_queue(struct perf_session *s,
s->header.needs_swap);
if (ret)
pr_err("Can't parse sample, err = %d\n", ret);
else
perf_session_deliver_event(s, iter->event, &sample, tool,
iter->file_offset);
else {
ret = perf_session_deliver_event(s, iter->event, &sample, tool,
iter->file_offset);
if (ret)
return ret;
}

os->last_flush = iter->timestamp;
list_del(&iter->list);
Expand All @@ -737,6 +740,8 @@ static void flush_sample_queue(struct perf_session *s,
}

os->nr_samples = 0;

return 0;
}

/*
Expand Down Expand Up @@ -782,10 +787,11 @@ static int process_finished_round(struct perf_tool *tool,
union perf_event *event __used,
struct perf_session *session)
{
flush_sample_queue(session, tool);
session->ordered_samples.next_flush = session->ordered_samples.max_timestamp;
int ret = flush_sample_queue(session, tool);
if (!ret)
session->ordered_samples.next_flush = session->ordered_samples.max_timestamp;

return 0;
return ret;
}

/* The queue is ordered by time */
Expand Down Expand Up @@ -1443,7 +1449,7 @@ int __perf_session__process_events(struct perf_session *session,
err = 0;
/* do the final flush for ordered samples */
session->ordered_samples.next_flush = ULLONG_MAX;
flush_sample_queue(session, tool);
err = flush_sample_queue(session, tool);
out_err:
perf_session__warn_about_errors(session, tool);
perf_session_free_sample_buffers(session);
Expand Down

0 comments on commit 355c71a

Please sign in to comment.