staging: greybus: loopback: use gb_loopback_async_wait_all don't spin
[linux/fpc-iii.git] / kernel / gcov / gcov.h
blob92c8e22a29ede59be2c942fda5a07ff1c63849f5
1 /*
2 * Profiling infrastructure declarations.
4 * This file is based on gcc-internal definitions. Data structures are
5 * defined to be compatible with gcc counterparts. For a better
6 * understanding, refer to gcc source: gcc/gcov-io.h.
8 * Copyright IBM Corp. 2009
9 * Author(s): Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
11 * Uses gcc-internal data definitions.
14 #ifndef GCOV_H
15 #define GCOV_H GCOV_H
17 #include <linux/types.h>
20 * Profiling data types used for gcc 3.4 and above - these are defined by
21 * gcc and need to be kept as close to the original definition as possible to
22 * remain compatible.
24 #define GCOV_DATA_MAGIC ((unsigned int) 0x67636461)
25 #define GCOV_TAG_FUNCTION ((unsigned int) 0x01000000)
26 #define GCOV_TAG_COUNTER_BASE ((unsigned int) 0x01a10000)
27 #define GCOV_TAG_FOR_COUNTER(count) \
28 (GCOV_TAG_COUNTER_BASE + ((unsigned int) (count) << 17))
30 #if BITS_PER_LONG >= 64
31 typedef long gcov_type;
32 #else
33 typedef long long gcov_type;
34 #endif
36 /* Opaque gcov_info. The gcov structures can change as for example in gcc 4.7 so
37 * we cannot use full definition here and they need to be placed in gcc specific
38 * implementation of gcov. This also means no direct access to the members in
39 * generic code and usage of the interface below.*/
40 struct gcov_info;
42 /* Interface to access gcov_info data */
43 const char *gcov_info_filename(struct gcov_info *info);
44 unsigned int gcov_info_version(struct gcov_info *info);
45 struct gcov_info *gcov_info_next(struct gcov_info *info);
46 void gcov_info_link(struct gcov_info *info);
47 void gcov_info_unlink(struct gcov_info *prev, struct gcov_info *info);
49 /* Base interface. */
50 enum gcov_action {
51 GCOV_ADD,
52 GCOV_REMOVE,
55 void gcov_event(enum gcov_action action, struct gcov_info *info);
56 void gcov_enable_events(void);
58 /* Iterator control. */
59 struct seq_file;
60 struct gcov_iterator;
62 struct gcov_iterator *gcov_iter_new(struct gcov_info *info);
63 void gcov_iter_free(struct gcov_iterator *iter);
64 void gcov_iter_start(struct gcov_iterator *iter);
65 int gcov_iter_next(struct gcov_iterator *iter);
66 int gcov_iter_write(struct gcov_iterator *iter, struct seq_file *seq);
67 struct gcov_info *gcov_iter_get_info(struct gcov_iterator *iter);
69 /* gcov_info control. */
70 void gcov_info_reset(struct gcov_info *info);
71 int gcov_info_is_compatible(struct gcov_info *info1, struct gcov_info *info2);
72 void gcov_info_add(struct gcov_info *dest, struct gcov_info *source);
73 struct gcov_info *gcov_info_dup(struct gcov_info *info);
74 void gcov_info_free(struct gcov_info *info);
76 struct gcov_link {
77 enum {
78 OBJ_TREE,
79 SRC_TREE,
80 } dir;
81 const char *ext;
83 extern const struct gcov_link gcov_link[];
85 #endif /* GCOV_H */