oe->max_alloc_size = (u64) -1;
oe->cur_alloc_size = 0;
}
+
+void ordered_events__free(struct ordered_events *oe)
+{
+ while (!list_empty(&oe->to_free)) {
+ struct ordered_event *event;
+
+ event = list_entry(oe->to_free.next, struct ordered_event, list);
+ list_del(&event->list);
+ free(event);
+ }
+}
int ordered_events__flush(struct perf_session *s, struct perf_tool *tool,
enum oe_flush how);
void ordered_events__init(struct ordered_events *oe);
+void ordered_events__free(struct ordered_events *oe);
#endif /* __ORDERED_EVENTS_H */
[PERF_RECORD_HEADER_MAX] = NULL,
};
-static void perf_session_free_sample_buffers(struct perf_session *session)
-{
- struct ordered_events *oe = &session->ordered_events;
-
- while (!list_empty(&oe->to_free)) {
- struct ordered_event *event;
-
- event = list_entry(oe->to_free.next, struct ordered_event, list);
- list_del(&event->list);
- free(event);
- }
-}
-
/*
* When perf record finishes a pass on every buffers, it records this pseudo
* event.
out_err:
free(buf);
perf_session__warn_about_errors(session, tool);
- perf_session_free_sample_buffers(session);
+ ordered_events__free(&session->ordered_events);
return err;
}
out_err:
ui_progress__finish();
perf_session__warn_about_errors(session, tool);
- perf_session_free_sample_buffers(session);
+ ordered_events__free(&session->ordered_events);
session->one_mmap = false;
return err;
}