Allows errors to propogate through event processing code and back to
commands.
Signed-off-by: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1346005487-62961-2-git-send-email-dsahern@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
struct perf_tool *tool,
u64 file_offset);
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;
struct perf_tool *tool)
{
struct ordered_samples *os = &s->ordered_samples;
int ret;
if (!tool->ordered_samples || !limit)
int ret;
if (!tool->ordered_samples || !limit)
list_for_each_entry_safe(iter, tmp, head, list) {
if (iter->timestamp > limit)
list_for_each_entry_safe(iter, tmp, head, list) {
if (iter->timestamp > limit)
s->header.needs_swap);
if (ret)
pr_err("Can't parse sample, err = %d\n", ret);
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);
os->last_flush = iter->timestamp;
list_del(&iter->list);
union perf_event *event __used,
struct perf_session *session)
{
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;
}
/* The queue is ordered by time */
}
/* The queue is ordered by time */
err = 0;
/* do the final flush for ordered samples */
session->ordered_samples.next_flush = ULLONG_MAX;
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);
out_err:
perf_session__warn_about_errors(session, tool);
perf_session_free_sample_buffers(session);