Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski...
[linux-2.6-block.git] / tools / perf / util / data.h
index 8c2df80152a519f02c2e699bf703840ce46efd1c..ae510ce16cb1277721bd132438c08311febb7156 100644 (file)
@@ -9,12 +9,12 @@ enum perf_data_mode {
 };
 
 struct perf_data_file {
-       const char *path;
-       int fd;
-       bool is_pipe;
-       bool force;
-       unsigned long size;
-       enum perf_data_mode mode;
+       const char              *path;
+       int                      fd;
+       bool                     is_pipe;
+       bool                     force;
+       unsigned long            size;
+       enum perf_data_mode      mode;
 };
 
 static inline bool perf_data_file__is_read(struct perf_data_file *file)
@@ -44,5 +44,16 @@ static inline unsigned long perf_data_file__size(struct perf_data_file *file)
 
 int perf_data_file__open(struct perf_data_file *file);
 void perf_data_file__close(struct perf_data_file *file);
-
+ssize_t perf_data_file__write(struct perf_data_file *file,
+                             void *buf, size_t size);
+/*
+ * If at_exit is set, only rename current perf.data to
+ * perf.data.<postfix>, continue write on original file.
+ * Set at_exit when flushing the last output.
+ *
+ * Return value is fd of new output.
+ */
+int perf_data_file__switch(struct perf_data_file *file,
+                          const char *postfix,
+                          size_t pos, bool at_exit);
 #endif /* __PERF_DATA_H */