1
2
3
4
5
6
7
8
9
10
11
12
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
23
24
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
39
40
41
42 struct gcov_info;
43
44
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
52
53 enum gcov_action {
54 GCOV_ADD,
55 GCOV_REMOVE,
56 };
57
58 void gcov_event(enum gcov_action action, struct gcov_info *info);
59 void gcov_enable_events(void);
60
61
62 struct seq_file;
63 struct gcov_iterator;
64
65 struct gcov_iterator *gcov_iter_new(struct gcov_info *info);
66 void gcov_iter_free(struct gcov_iterator *iter);
67 void gcov_iter_start(struct gcov_iterator *iter);
68 int gcov_iter_next(struct gcov_iterator *iter);
69 int gcov_iter_write(struct gcov_iterator *iter, struct seq_file *seq);
70 struct gcov_info *gcov_iter_get_info(struct gcov_iterator *iter);
71
72
73 void gcov_info_reset(struct gcov_info *info);
74 int gcov_info_is_compatible(struct gcov_info *info1, struct gcov_info *info2);
75 void gcov_info_add(struct gcov_info *dest, struct gcov_info *source);
76 struct gcov_info *gcov_info_dup(struct gcov_info *info);
77 void gcov_info_free(struct gcov_info *info);
78
79 struct gcov_link {
80 enum {
81 OBJ_TREE,
82 SRC_TREE,
83 } dir;
84 const char *ext;
85 };
86 extern const struct gcov_link gcov_link[];
87
88 extern int gcov_events_enabled;
89 extern struct mutex gcov_lock;
90
91 #endif