0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #ifndef GCOV_H
0016 #define GCOV_H GCOV_H
0017
0018 #include <linux/module.h>
0019 #include <linux/types.h>
0020
0021
0022
0023
0024
0025
0026 #define GCOV_DATA_MAGIC ((unsigned int) 0x67636461)
0027 #define GCOV_TAG_FUNCTION ((unsigned int) 0x01000000)
0028 #define GCOV_TAG_COUNTER_BASE ((unsigned int) 0x01a10000)
0029 #define GCOV_TAG_FOR_COUNTER(count) \
0030 (GCOV_TAG_COUNTER_BASE + ((unsigned int) (count) << 17))
0031
0032 #if BITS_PER_LONG >= 64
0033 typedef long gcov_type;
0034 #else
0035 typedef long long gcov_type;
0036 #endif
0037
0038
0039
0040
0041
0042 struct gcov_info;
0043
0044
0045 const char *gcov_info_filename(struct gcov_info *info);
0046 unsigned int gcov_info_version(struct gcov_info *info);
0047 struct gcov_info *gcov_info_next(struct gcov_info *info);
0048 void gcov_info_link(struct gcov_info *info);
0049 void gcov_info_unlink(struct gcov_info *prev, struct gcov_info *info);
0050 bool gcov_info_within_module(struct gcov_info *info, struct module *mod);
0051 size_t convert_to_gcda(char *buffer, struct gcov_info *info);
0052
0053
0054 enum gcov_action {
0055 GCOV_ADD,
0056 GCOV_REMOVE,
0057 };
0058
0059 void gcov_event(enum gcov_action action, struct gcov_info *info);
0060 void gcov_enable_events(void);
0061
0062
0063 size_t store_gcov_u32(void *buffer, size_t off, u32 v);
0064 size_t store_gcov_u64(void *buffer, size_t off, u64 v);
0065
0066
0067 void gcov_info_reset(struct gcov_info *info);
0068 int gcov_info_is_compatible(struct gcov_info *info1, struct gcov_info *info2);
0069 void gcov_info_add(struct gcov_info *dest, struct gcov_info *source);
0070 struct gcov_info *gcov_info_dup(struct gcov_info *info);
0071 void gcov_info_free(struct gcov_info *info);
0072
0073 struct gcov_link {
0074 enum {
0075 OBJ_TREE,
0076 SRC_TREE,
0077 } dir;
0078 const char *ext;
0079 };
0080 extern const struct gcov_link gcov_link[];
0081
0082 extern int gcov_events_enabled;
0083 extern struct mutex gcov_lock;
0084
0085 #endif