blob: d6c262e42f4728aab1ef8dba7566f00477f002e6 [file] [log] [blame]
Jiri Olsaf5fc14122013-10-15 16:27:32 +02001#ifndef __PERF_DATA_H
2#define __PERF_DATA_H
3
4#include <stdbool.h>
5
6enum perf_data_mode {
7 PERF_DATA_MODE_WRITE,
8 PERF_DATA_MODE_READ,
9};
10
11struct perf_data_file {
12 const char *path;
13 int fd;
14 bool is_pipe;
15 bool force;
Jiri Olsa6a4d98d2013-10-15 16:27:33 +020016 unsigned long size;
Jiri Olsaf5fc14122013-10-15 16:27:32 +020017 enum perf_data_mode mode;
18};
19
20static inline bool perf_data_file__is_read(struct perf_data_file *file)
21{
22 return file->mode == PERF_DATA_MODE_READ;
23}
24
25static inline bool perf_data_file__is_write(struct perf_data_file *file)
26{
27 return file->mode == PERF_DATA_MODE_WRITE;
28}
29
Jiri Olsa6a4d98d2013-10-15 16:27:33 +020030int perf_data_file__open(struct perf_data_file *file);
31void perf_data_file__close(struct perf_data_file *file);
32
Jiri Olsaf5fc14122013-10-15 16:27:32 +020033#endif /* __PERF_DATA_H */