ARM: shmobile: Add DT bindings for Renesas memory controllers
[linux/fpc-iii.git] / tools / perf / util / data.h
blob2b15d0c95c7f312de08a36a05b08c8356b039616
1 #ifndef __PERF_DATA_H
2 #define __PERF_DATA_H
4 #include <stdbool.h>
6 enum perf_data_mode {
7 PERF_DATA_MODE_WRITE,
8 PERF_DATA_MODE_READ,
9 };
11 struct perf_data_file {
12 const char *path;
13 int fd;
14 bool is_pipe;
15 bool force;
16 unsigned long size;
17 enum perf_data_mode mode;
20 static inline bool perf_data_file__is_read(struct perf_data_file *file)
22 return file->mode == PERF_DATA_MODE_READ;
25 static inline bool perf_data_file__is_write(struct perf_data_file *file)
27 return file->mode == PERF_DATA_MODE_WRITE;
30 static inline int perf_data_file__is_pipe(struct perf_data_file *file)
32 return file->is_pipe;
35 static inline int perf_data_file__fd(struct perf_data_file *file)
37 return file->fd;
40 static inline unsigned long perf_data_file__size(struct perf_data_file *file)
42 return file->size;
45 int perf_data_file__open(struct perf_data_file *file);
46 void perf_data_file__close(struct perf_data_file *file);
47 ssize_t perf_data_file__write(struct perf_data_file *file,
48 void *buf, size_t size);
50 #endif /* __PERF_DATA_H */