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

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

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef PERF_COMPRESS_H
  3 #define PERF_COMPRESS_H
  4 
  5 #include <stdbool.h>
  6 #include <stddef.h>
  7 #include <sys/types.h>
  8 #ifdef HAVE_ZSTD_SUPPORT
  9 #include <zstd.h>
 10 #endif
 11 
 12 #ifdef HAVE_ZLIB_SUPPORT
 13 int gzip_decompress_to_file(const char *input, int output_fd);
 14 bool gzip_is_compressed(const char *input);
 15 #endif
 16 
 17 #ifdef HAVE_LZMA_SUPPORT
 18 int lzma_decompress_to_file(const char *input, int output_fd);
 19 bool lzma_is_compressed(const char *input);
 20 #endif
 21 
 22 struct zstd_data {
 23 #ifdef HAVE_ZSTD_SUPPORT
 24         ZSTD_CStream    *cstream;
 25         ZSTD_DStream    *dstream;
 26         int comp_level;
 27 #endif
 28 };
 29 
 30 #ifdef HAVE_ZSTD_SUPPORT
 31 
 32 int zstd_init(struct zstd_data *data, int level);
 33 int zstd_fini(struct zstd_data *data);
 34 
 35 ssize_t zstd_compress_stream_to_records(struct zstd_data *data, void *dst, size_t dst_size,
 36                                        void *src, size_t src_size, size_t max_record_size,
 37                                        size_t process_header(void *record, size_t increment));
 38 
 39 size_t zstd_decompress_stream(struct zstd_data *data, void *src, size_t src_size,
 40                               void *dst, size_t dst_size);
 41 #else /* !HAVE_ZSTD_SUPPORT */
 42 
 43 static inline int zstd_init(struct zstd_data *data __maybe_unused, int level __maybe_unused)
 44 {
 45         return 0;
 46 }
 47 
 48 static inline int zstd_fini(struct zstd_data *data __maybe_unused)
 49 {
 50         return 0;
 51 }
 52 
 53 static inline
 54 ssize_t zstd_compress_stream_to_records(struct zstd_data *data __maybe_unused,
 55                                        void *dst __maybe_unused, size_t dst_size __maybe_unused,
 56                                        void *src __maybe_unused, size_t src_size __maybe_unused,
 57                                        size_t max_record_size __maybe_unused,
 58                                        size_t process_header(void *record, size_t increment) __maybe_unused)
 59 {
 60         return 0;
 61 }
 62 
 63 static inline size_t zstd_decompress_stream(struct zstd_data *data __maybe_unused, void *src __maybe_unused,
 64                                             size_t src_size __maybe_unused, void *dst __maybe_unused,
 65                                             size_t dst_size __maybe_unused)
 66 {
 67         return 0;
 68 }
 69 #endif
 70 
 71 #endif /* PERF_COMPRESS_H */
 72 

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

kernel.org | git.kernel.org | LWN.net | Project Home | 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.

sflogo.php