~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/tools/perf/util/data.h

Version: ~ [ linux-5.6-rc3 ] ~ [ linux-5.5.6 ] ~ [ linux-5.4.22 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.106 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.171 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.214 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.214 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.82 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef __PERF_DATA_H
  3 #define __PERF_DATA_H
  4 
  5 #include <stdbool.h>
  6 
  7 enum perf_data_mode {
  8         PERF_DATA_MODE_WRITE,
  9         PERF_DATA_MODE_READ,
 10 };
 11 
 12 struct perf_data_file {
 13         char            *path;
 14         int              fd;
 15         unsigned long    size;
 16 };
 17 
 18 struct perf_data {
 19         const char              *path;
 20         struct perf_data_file    file;
 21         bool                     is_pipe;
 22         bool                     is_dir;
 23         bool                     force;
 24         enum perf_data_mode      mode;
 25 
 26         struct {
 27                 u64                      version;
 28                 struct perf_data_file   *files;
 29                 int                      nr;
 30         } dir;
 31 };
 32 
 33 static inline bool perf_data__is_read(struct perf_data *data)
 34 {
 35         return data->mode == PERF_DATA_MODE_READ;
 36 }
 37 
 38 static inline bool perf_data__is_write(struct perf_data *data)
 39 {
 40         return data->mode == PERF_DATA_MODE_WRITE;
 41 }
 42 
 43 static inline int perf_data__is_pipe(struct perf_data *data)
 44 {
 45         return data->is_pipe;
 46 }
 47 
 48 static inline bool perf_data__is_dir(struct perf_data *data)
 49 {
 50         return data->is_dir;
 51 }
 52 
 53 static inline int perf_data__fd(struct perf_data *data)
 54 {
 55         return data->file.fd;
 56 }
 57 
 58 int perf_data__open(struct perf_data *data);
 59 void perf_data__close(struct perf_data *data);
 60 ssize_t perf_data__write(struct perf_data *data,
 61                               void *buf, size_t size);
 62 ssize_t perf_data_file__write(struct perf_data_file *file,
 63                               void *buf, size_t size);
 64 /*
 65  * If at_exit is set, only rename current perf.data to
 66  * perf.data.<postfix>, continue write on original data.
 67  * Set at_exit when flushing the last output.
 68  *
 69  * Return value is fd of new output.
 70  */
 71 int perf_data__switch(struct perf_data *data,
 72                            const char *postfix,
 73                            size_t pos, bool at_exit, char **new_filepath);
 74 
 75 int perf_data__create_dir(struct perf_data *data, int nr);
 76 int perf_data__open_dir(struct perf_data *data);
 77 void perf_data__close_dir(struct perf_data *data);
 78 int perf_data__update_dir(struct perf_data *data);
 79 unsigned long perf_data__size(struct perf_data *data);
 80 #endif /* __PERF_DATA_H */
 81 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp