return 0;
 }
 
-static int __ordered_events__flush(struct ordered_events *oe,
-                                  bool show_progress)
+static int do_flush(struct ordered_events *oe, bool show_progress)
 {
        struct list_head *head = &oe->events;
        struct ordered_event *tmp, *iter;
        return 0;
 }
 
-int ordered_events__flush(struct ordered_events *oe, enum oe_flush how)
+static int __ordered_events__flush(struct ordered_events *oe, enum oe_flush how,
+                                  u64 timestamp)
 {
        static const char * const str[] = {
                "NONE",
                break;
        }
 
+       case OE_FLUSH__TIME:
+               oe->next_flush = timestamp;
+               show_progress = false;
+               break;
+
        case OE_FLUSH__ROUND:
        case OE_FLUSH__NONE:
        default:
                   str[how], oe->nr_events);
        pr_oe_time(oe->max_timestamp, "max_timestamp\n");
 
-       err = __ordered_events__flush(oe, show_progress);
+       err = do_flush(oe, show_progress);
 
        if (!err) {
                if (how == OE_FLUSH__ROUND)
        return err;
 }
 
+int ordered_events__flush(struct ordered_events *oe, enum oe_flush how)
+{
+       return __ordered_events__flush(oe, how, 0);
+}
+
+int ordered_events__flush_time(struct ordered_events *oe, u64 timestamp)
+{
+       return __ordered_events__flush(oe, OE_FLUSH__TIME, timestamp);
+}
+
 void ordered_events__init(struct ordered_events *oe, ordered_events__deliver_t deliver,
                          void *data)
 {
 
        OE_FLUSH__ROUND,
        OE_FLUSH__HALF,
        OE_FLUSH__TOP,
+       OE_FLUSH__TIME,
 };
 
 struct ordered_events;
                          u64 timestamp, u64 file_offset);
 void ordered_events__delete(struct ordered_events *oe, struct ordered_event *event);
 int ordered_events__flush(struct ordered_events *oe, enum oe_flush how);
+int ordered_events__flush_time(struct ordered_events *oe, u64 timestamp);
 void ordered_events__init(struct ordered_events *oe, ordered_events__deliver_t deliver,
                          void *data);
 void ordered_events__free(struct ordered_events *oe);