1 /* SPDX-License-Identifier: GPL-2.0 */
12 struct perf_data_file {
18 enum perf_data_mode mode;
21 static inline bool perf_data_file__is_read(struct perf_data_file *file)
23 return file->mode == PERF_DATA_MODE_READ;
26 static inline bool perf_data_file__is_write(struct perf_data_file *file)
28 return file->mode == PERF_DATA_MODE_WRITE;
31 static inline int perf_data_file__is_pipe(struct perf_data_file *file)
36 static inline int perf_data_file__fd(struct perf_data_file *file)
41 static inline unsigned long perf_data_file__size(struct perf_data_file *file)
46 int perf_data_file__open(struct perf_data_file *file);
47 void perf_data_file__close(struct perf_data_file *file);
48 ssize_t perf_data_file__write(struct perf_data_file *file,
49 void *buf, size_t size);
51 * If at_exit is set, only rename current perf.data to
52 * perf.data.<postfix>, continue write on original file.
53 * Set at_exit when flushing the last output.
55 * Return value is fd of new output.
57 int perf_data_file__switch(struct perf_data_file *file,
59 size_t pos, bool at_exit);
60 #endif /* __PERF_DATA_H */