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

TOMOYO Linux Cross Reference
Linux/kernel/gcov/gcov.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 /*
  3  *  Profiling infrastructure declarations.
  4  *
  5  *  This file is based on gcc-internal definitions. Data structures are
  6  *  defined to be compatible with gcc counterparts. For a better
  7  *  understanding, refer to gcc source: gcc/gcov-io.h.
  8  *
  9  *    Copyright IBM Corp. 2009
 10  *    Author(s): Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
 11  *
 12  *    Uses gcc-internal data definitions.
 13  */
 14 
 15 #ifndef GCOV_H
 16 #define GCOV_H GCOV_H
 17 
 18 #include <linux/module.h>
 19 #include <linux/types.h>
 20 
 21 /*
 22  * Profiling data types used for gcc 3.4 and above - these are defined by
 23  * gcc and need to be kept as close to the original definition as possible to
 24  * remain compatible.
 25  */
 26 #define GCOV_DATA_MAGIC         ((unsigned int) 0x67636461)
 27 #define GCOV_TAG_FUNCTION       ((unsigned int) 0x01000000)
 28 #define GCOV_TAG_COUNTER_BASE   ((unsigned int) 0x01a10000)
 29 #define GCOV_TAG_FOR_COUNTER(count)                                     \
 30         (GCOV_TAG_COUNTER_BASE + ((unsigned int) (count) << 17))
 31 
 32 #if BITS_PER_LONG >= 64
 33 typedef long gcov_type;
 34 #else
 35 typedef long long gcov_type;
 36 #endif
 37 
 38 /* Opaque gcov_info. The gcov structures can change as for example in gcc 4.7 so
 39  * we cannot use full definition here and they need to be placed in gcc specific
 40  * implementation of gcov. This also means no direct access to the members in
 41  * generic code and usage of the interface below.*/
 42 struct gcov_info;
 43 
 44 /* Interface to access gcov_info data  */
 45 const char *gcov_info_filename(struct gcov_info *info);
 46 unsigned int gcov_info_version(struct gcov_info *info);
 47 struct gcov_info *gcov_info_next(struct gcov_info *info);
 48 void gcov_info_link(struct gcov_info *info);
 49 void gcov_info_unlink(struct gcov_info *prev, struct gcov_info *info);
 50 bool gcov_info_within_module(struct gcov_info *info, struct module *mod);
 51 size_t convert_to_gcda(char *buffer, struct gcov_info *info);
 52 
 53 /* Base interface. */
 54 enum gcov_action {
 55         GCOV_ADD,
 56         GCOV_REMOVE,
 57 };
 58 
 59 void gcov_event(enum gcov_action action, struct gcov_info *info);
 60 void gcov_enable_events(void);
 61 
 62 /* writing helpers */
 63 size_t store_gcov_u32(void *buffer, size_t off, u32 v);
 64 size_t store_gcov_u64(void *buffer, size_t off, u64 v);
 65 
 66 /* gcov_info control. */
 67 void gcov_info_reset(struct gcov_info *info);
 68 int gcov_info_is_compatible(struct gcov_info *info1, struct gcov_info *info2);
 69 void gcov_info_add(struct gcov_info *dest, struct gcov_info *source);
 70 struct gcov_info *gcov_info_dup(struct gcov_info *info);
 71 void gcov_info_free(struct gcov_info *info);
 72 
 73 struct gcov_link {
 74         enum {
 75                 OBJ_TREE,
 76                 SRC_TREE,
 77         } dir;
 78         const char *ext;
 79 };
 80 extern const struct gcov_link gcov_link[];
 81 
 82 extern int gcov_events_enabled;
 83 extern struct mutex gcov_lock;
 84 
 85 #endif /* GCOV_H */
 86 

~ [ 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